In-Store API

Errors

The Afterpay API uses conventional HTTP response codes to indicate success or failure of an API request.

In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing), and codes in the 5xx range indicate an error with the Afterpay servers.

Response

Returns a JSON response and appropriate HTTP status code. The JSON body object will contain the following four properties.

PropertyDescription
httpStatusCodeThe HTTP status code.
errorIdA unique error ID.
errorCodeThe type of error returned. For example, invalid_object, transaction_error, or server_error.
messageA human-readable message giving more details about the error. For card errors, these messages can be shown to your users.