Validation

Let's take a look at some of the error responses you may encounter if information is passed incorrectly.

Common Validation Errors

This example demonstrates returning JSON indicating the 'amount' attribute was either set incorrectly. Make sure the request contains the mentioned field and that it contains a non-zero value.

{
    "errorCode":"ValidationError",
    "message":"Validation error happened",
    "details":["Zero is not a valid value."]
}

This response indicates that you have passed the incorrect merchantid.

{
    "errorCode":"ValidationError",
    "message":"Validation error happened",
    "details":["Object not set to instance of an Object."]
}

A common mistake is to enter the expiryMonth or expiryYear field as expirationMonth or expMonth. Doing so will result in an error.

{
    "errorCode":"ValidationError",
    "message":"Validation error happened",
    "details":["Value for expiryMonth or expiryYear can not be null"]
}