Skip to content

Errors ​

Success and failure use one envelope.

json
{ "ok": true, "description": "Checkout created", "data": { } }
json
{ "ok": false, "description": "Missing, unknown or revoked API key", "data": {}, "code": 2781 }
FieldMeaning
oktrue on success. false on error
descriptionText for logs and for people. Do not branch on it
dataPayload on success. {} on error
codeErrors only. Branch on this number

Branch on the HTTP status, then on code.

HTTP status ​

HTTPMeaningAction
200Success, or a replayed createUse data
201Checkout createdUse data
400Invalid requestFix the request. Do not retry the same body
401Key missing, unknown, or revokedFix the key. Do not retry
404No checkout for your keyCheck the id
409Wallet not ready, on createSee the code
422Amount or rail refusedFix the amount, or wait until collection is on
429Over the rate limitWait, then retry
503A dependency is downRetry with the same Idempotency-Key

Merchant API codes ​

CodeHTTPMeaning
1701400Invalid body or headers, or a bad return_url. description says return_url is not a URL or return_url must be https
1804429More than 120 requests in one minute
2781401Missing, unknown, or revoked API key
2782503The key service did not answer
2783404Checkout not found, including another merchant's id
2702422Amount outside the rail limits, or not a whole unit where the rail requires it
2721422Collection is off on this deployment
2709409The wallet is not provisioned. Finish account setup in the hub
2752503The ledger did not answer the wallet check. Retry

A refused create does not open a checkout. If a create times out, retry with the same Idempotency-Key. You get the checkout that exists, or a new one.

Payer-page codes ​

These come from the hosted page, not from your server calls.

CodeHTTPMeaning
2784409Checkout expired
2785409Checkout already paid
2786409A card payment is already in progress

Card setup on that page can also return 2771 to 2777. Your confirm call is still GET /checkouts/:id.

Retry ​

ResultAction
503 or a network errorRetry the same body and the same Idempotency-Key
429Wait, then retry. The same key is valid
400, 401, 404, 409, 422Change the request. The same request fails again

Staging documentation. Staging charges real money. See Environments.