HTTP Status Codes

API responds with the following HTTP status codes in case of errors:

Client Errors

  • 400 – Bad request, invalid body or parameters; business logic errors
  • 401 – Authentication failed or not sufficient (ie. when level 1 provided, but level 2 required)
  • 404 – Resource does not exist or is not available for this shop (belongs to another shop)
  • 409 – Resource conflict
  • 415 – Request content type is not application/json.

Server Errors

  • 500 – all server internal errors

Response Body

Client Errors

In case of client errors, API responds with a code and message parameter. An optional errors collection may be returned with more information about the error occurred.

POST /transactions
{
    "code": 1001,
    "message": "Invalid input",
    "errors": [
        {
            "resource": "transaction",
            "field": "currency",
            "type": "invalid"
        },
        {
            "resource": "customer",
            "field": "ip",
            "type": "missing"
        }
    ]

}

Server Errors

Server errors return no response body.

 

 

Business Logic Errors

All business logic errors are returned with a 400 HTTP Status.

Code Message
1001 Invalid request
1002 Resource not found
101x Errors related to shop or merchant
1011 Shop not active
1012 Card payments not enabled for this shop
1013 OCP or Recurring disabled for shop
102x Errors related to transactions
1021 Transaction in wrong status
103x Errors related to payments
1031 Payment in wrong status
1032 Cannot make payment (transaction status violation)
1033 Card expired
1034 Not sufficient funds
1035 Payment declined
1036 Authorization failed
104x Errors related to refunds
1041 Transaction in wrong status, cannot be refunded
1042 Refund amount greater than available to refund
105x Errors related to customers
106x Errors related to tokens
1061 Invalid transaction
1062 Transaction conflict
1063 Failed to create Payment Token
1064 Token expired
1065 Token in wrong status
1065 Token in wrong status
2003 Unable to deposit payment
2005 Unable to refund payment