For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Online API
    • API Environments
    • Direct Payment Flow
    • REST
    • HTTPS
    • Dates
    • Pagination
    • Authentication
    • Idempotent Requests
    • Timeouts
    • API Simulator
  • Models
    • Introduction
    • Contact Object
    • Consumer Object
    • Discount Object
    • Item Object
    • Money Object
    • Order Details Object
    • Payment Object
    • Refund Object
    • Shipping Courier Object
  • Service Status
    • GETPing
  • Configuration
    • GETGet Configuration
  • Orders
    • Introduction
    • GETGet Order
    • POSTCreate Order
  • Javascript afterpay.js
    • Information
    • Redirect Method
  • Payments
    • Introduction
    • POSTCapture Payment
    • PUTUpdate Shipping Courier
    • GETGet Payment By Order ID
    • GETGet Payment By Token
    • GETList Payment(s)
    • POSTCreate Refund
    • PUTUpdate Payment by Order ID
    • POSTReverse Payment By Token
  • Errors
    • Introduction
    • Get Errors
    • Put/Post Errors
  • Reference
LogoLogo
On this page
  • Response
  • Attribute
Errors

Errors

Was this page helpful?
Previous

Get Errors

Next
Built with

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

HTTP Status CodesDescription
200-299The request was processed successfully.
400-499The request was not valid (e.g. a required parameter was missing).
500-599The request could not be processed for an unexpected reason.

Response

Returns a JSON object and an appropriate HTTP status code.

Please note that the human-readable textual messages included within the error object are improved over time. For validation and mapping purposes, please use the error code or HTTP status code values.

Attribute

AttributeTypeDescription
errorCodestringThe type of error returned. For example, invalid_object, unsupported_currency, or invalid_token.
errorIdstringA unique error ID.
messagestringA human-readable message which provides more details about the error. In most cases, these messages can be displayed to the end user.
httpStatusCodeintegerThe HTTP status code.

If you intend to contact Afterpay about an unexpected API response, please make sure you record the raw headers & body from your request, along with the raw headers & body received in response.