API usage
Our APIs accept and return JSON in the HTTP body and return HTTP response codes to indicate errors. You can consume the APIs directly using your favorite HTTP/REST library, or use one of our SDKs.
To view details of any recent changes to our API, check out our changelog.
Authentication
To initiate a request to any of Checkout.comās endpoints, you will need to provide an API key in the Authorization
header. Unless otherwise specified, you should use your secret key.
You can find your API keys in the Settings > Channels section of the Hub.
HTTP response codes
The table below describes the possible response codes you can receive when sending an API request.
Code | Description |
---|---|
| OK |
| Created |
| Accepted |
| Unauthorized |
| Not allowed |
| Not found |
| Invalid data was sent |
| Too many requests or duplicate request detected |
| Bad gateway |
Validation errors
If an error occurs while validating a request, the API responds with a 422 HTTP
response code, accompanied by a JSON response containing the error details. Find out more in the example below.
The JSON response includes the following fields:
Field name | Description |
---|---|
| The request ID used by Checkout.com to trace what went wrong in the payment. |
| The type of error. |
| An array of validation errors. |
Request example
The following example is a JSON payload with the token
and currency
fields missing.
{
"source": {
"type": "token"
},
"amount": 6500,
"reference": "ORD-5023-4E89"
}
Response example
{
"request_id": "7e881fbc-fc9d-4d60-bcdb-54479e32f466",
"error_type": "request_invalid",
"error_codes": [
"currency_required",
"token_required"
]
}
Can we help?
Thanks for using Checkout.com. If you need any help or support, then message our support team at [email protected].
Updated 5 months ago