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.

CodeDescription
200OK
201Created
202Accepted
401Unauthorized
403Not allowed
404Not found
422Invalid data was sent
429Too many requests or duplicate request detected
502Bad 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 nameDescription
request_idThe request ID used by Checkout.com to trace what went wrong in the payment.
error_typeThe type of error.
error_codesAn 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].