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

200

OK

201

Created

202

Accepted

401

Unauthorized

403

Not allowed

404

Not found

422

Invalid data was sent

429

Too many requests or duplicate request detected

502

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

request_id

The request ID used by Checkout.com to trace what went wrong in the payment.

error_type

The type of error.

error_codes

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].