QuataPay
Developer

Response codes

HTTP status codes and the JSON envelope you can rely on.

Browse developer docs
Back to developer docs

Envelope

Every response — success or error — comes back in the same envelope:

// success
{ "success": true, "data": { ... }, "error": null }

// error
{
  "success": false,
  "data": null,
  "error": "human-friendly message",
  "code": "HTTP_404",
  "details": null
}

error is a sentence for your logs. code is VALIDATION_ERROR for a 422 (and details then lists the fields that failed) and HTTP_<status> for the others, such as HTTP_401 or HTTP_409. Branch on the HTTP status first. A few money errors carry their own code (for example a locked account).

HTTP status codes

CodeMeaningRetry?
200OK—
201Created—
400Bad request — for example an unknown currencyNo — fix it
401Missing or invalid API keyNo — check the key
403Wrong key mode for the path (test key on a live path or the reverse), or the merchant account is suspendedNo
404Resource not found (or it belongs to another merchant or mode)No
409Conflict — Idempotency-Key reused with a different body, or a payment method the checkout does not allowNo — fix it
422A field failed validation, or an unknown field was sentNo — fix it
423Currency not enabled for the account, or the account is lockedNo
429Rate-limited (60 requests per 60 seconds per key and endpoint) — honour Retry-AfterYes, after the delay
500–504Server problem on our sideYes, with backoff + jitter
503The developer API is temporarily pausedYes, later

Retry 5xx, timeouts and 429 with the same Idempotency-Key. Do not retry other 4xx responses.