> This page is for Afterpay Partner API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.afterpay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.afterpay.com/_mcp/server.

# 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 Code                | Description                                                                                                                                  |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| 400 - Bad Request               | Invalid request or missing parameters.                                                                                                       |
| 401 - Unauthorized              | Invalid authentication, including an incorrect API key.                                                                                      |
| 402 - Payment Required          | The checkout token is invalid, expired, or does not exist. Checkout tokens expire after 60 minutes.                                          |
| 404 - Not Found                 | The requested onboarding does not exist.                                                                                                     |
| 409 - Conflict                  | The onboarding already exists.                                                                                                               |
| 412 - Precondition failed       | The consumer payment was not successful.                                                                                                     |
| 422 - Unprocessable entity      | The checkout token is missing or empty.                                                                                                      |
| 500-599 - Request not processed | Internal 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:

* [400 - short error](/afterpay-partner-api/api-reference/reference-partner-api/schemas/400-response)
* [400 - expanded error](/afterpay-partner-api/api-reference/reference-partner-api/schemas/400-response-2)
* [401](/afterpay-partner-api/api-reference/reference-partner-api/schemas/401-response)
* [409](/afterpay-partner-api/api-reference/reference-partner-api/schemas/409-response)
* [404](/afterpay-partner-api/api-reference/reference-partner-api/schemas/404-response)
* [503](/afterpay-partner-api/api-reference/reference-partner-api/schemas/503-response)