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:

CodeDescription
INVALID_AMOUNTThe amount is invalid. See Handling monetary values.
MISSING_AMOUNTThe amount field is missing.
MISSING_CURRENCYThe currency field is missing.
MISSING_MERCHANT_DOMAINThe merchant domain is missing.
INVALID_MERCHANT_DOMAINThe merchant domain is invalid.
MISSING_MERCHANT_REFERENCEThe merchant reference is missing.
MISSING_SUCCESS_PATHThe success path is missing.
MISSING_FAILURE_PATHThe failure path is missing.
MISSING_CLOSE_PATHThe close path is missing.
MISSING_COUNTRY_CODEThe country code is missing.
INVALID_COUNTRY_CODEThe country code is invalid.
INVALID_SWEDISH_SSNThe Swedish social security number is invalid.
INVALID_MERCHANT_IDThe merchant is either not registered or the merchant has been deactivated.
INVALID_JSONThe request body is not valid JSON.
INVALID_CURRENCYThe currency code is invalid. See Handling monetary values.
INVALID_SUCCESS_PATHThe success path is invalid.
INVALID_FAILURE_PATHThe failure path is invalid.
INVALID_CLOSE_PATHThe close path is invalid.
INVALID_NOTIFICATION_URLThe notification URL is invalid.
MISSING_NOTIFICATION_URLThe notification URL is missing.
BAD_END_USER_TOKENThe end user token is invalid.