Handling Errors
Handling Errors
All API endpoints may return an error response containing the following fields:
error: A human-readable string describing the error.code: A unique identifier for the specific error.
Below is an example of an error response returned by the API:
{
"error": "Invalid amount, must be greater than 0",
"code": "INVALID_AMOUNT"
}The following table describes the error codes:
| Code | Description |
|---|---|
INVALID_AMOUNT | The amount is invalid. See Handling monetary values. |
MISSING_AMOUNT | The amount field is missing. |
MISSING_CURRENCY | The currency field is missing. |
MISSING_MERCHANT_DOMAIN | The merchant domain is missing. |
INVALID_MERCHANT_DOMAIN | The merchant domain is invalid. |
MISSING_MERCHANT_REFERENCE | The merchant reference is missing. |
MISSING_SUCCESS_PATH | The success path is missing. |
MISSING_FAILURE_PATH | The failure path is missing. |
MISSING_CLOSE_PATH | The close path is missing. |
MISSING_COUNTRY_CODE | The country code is missing. |
INVALID_COUNTRY_CODE | The country code is invalid. |
INVALID_SWEDISH_SSN | The Swedish social security number is invalid. |
INVALID_MERCHANT_ID | The merchant is either not registered or the merchant has been deactivated. |
INVALID_JSON | The request body is not valid JSON. |
INVALID_CURRENCY | The currency code is invalid. See Handling monetary values. |
INVALID_SUCCESS_PATH | The success path is invalid. |
INVALID_FAILURE_PATH | The failure path is invalid. |
INVALID_CLOSE_PATH | The close path is invalid. |
INVALID_NOTIFICATION_URL | The notification URL is invalid. |
MISSING_NOTIFICATION_URL | The notification URL is missing. |
BAD_END_USER_TOKEN | The end user token is invalid. |