Errors

The Afterpay API follows a standard pattern for representing errors in API responses:

  • A non HTTP 2XX response code is returned (typically a 4XX or 5XX)
  • An error JSON object is returned with relevant error details

Error Codes

HTTP Status CodeDescription
400 - Bad RequestInvalid request or missing parameters.
401 - UnauthorizedInvalid authentication, including an incorrect API key.
402 - Payment RequiredThe checkout token is invalid, expired, or does not exist. Checkout tokens expire after 60 minutes.
404 - Not FoundThe requested onboarding does not exist.
409 - ConflictThe onboarding already exists.
412 - Precondition failedThe consumer payment was not successful.
422 - Unprocessable entityThe checkout token is missing or empty.
500-599 - Request not processedInternal server error or other response indicating request could not be processed. Please check our status page and/or escalate to our team.

Error Response Object

See the following schemas for each error code: