API Reference

Errors

The semantic error codes and their HTTP mapping.

Every failure uses the error envelope. The error.code is a stable semantic token; the HTTP status is its transport mapping.

Error envelope

{
  "ok": false,
  "data": null,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "human-readable summary",
    "details": {}
  },
  "meta": { "result_type": "error" }
}
FieldTypeRules
error.codestringStable semantic error token. Always present.
error.messagestringHuman-readable summary. Always present. Not stable; do not branch on it.
error.detailsobject | nullOptional structured detail. MAY be omitted or null.

Semantic codes

error.codeHTTP statusMeaning
VALIDATION_ERROR400Request was malformed: non-object body, unknown field, unexpected null, or a field that failed the documented contract.
FORBIDDEN403The caller is authenticated but not authorized for the requested action or resource. Returned when a request targets a resource outside the caller's authorized merchant scope, or when an action requires elevated authorization that the credential does not carry.
NOT_FOUND404A singleton selector did not resolve to an existing resource.
PRECONDITION_FAILED409The request was well-formed but the resource's current state does not satisfy a required precondition.
CONFLICT409A mutation was attempted on a resource that no longer permits it — for example, a duplicate resource or a transition from a terminal state.
IDEMPOTENCY_CONFLICT409An idempotency key was reused with a different request payload. The original request's outcome cannot be extended to the new input.
SESSION_BLOCKED409A checkout session or operation was blocked by pre-deposit compliance screening (geoblock or bot detection).
RATE_LIMITED429The caller exceeded the allowed request rate.
DEPENDENCY_UNAVAILABLE503An upstream dependency required to complete the request was unavailable.
TIMEOUT504The request could not be completed within its time bound.
INTERNAL_ERROR500An unexpected internal failure. No recoverable action for the caller; treat as transient, back off and retry, and contact support if the condition persists.

Code preservation

  • The semantic error.code is always preserved. Branch on error.code, never on HTTP status alone or on error.message.
  • A code not listed above is still returned verbatim in error.code. Its exact HTTP status is not guaranteed by this table; the code remains authoritative.
  • Branch on ok first, then on error.code.

Rate limiting — RATE_LIMITED

A caller that exceeds the allowed request rate is rejected with error.code RATE_LIMITED and HTTP 429.

  • The response carries a Retry-After header: the number of whole seconds to wait before retrying. Honour it — retrying sooner is rejected again and counts against the per-source-IP ceiling.
  • The body is the standard error envelope. It does not disclose which limit was exceeded or the configured ceiling; pace retries off Retry-After, not off the message.
  • On a retry, supply the endpoint's idempotency_key where one is offered so a retry after a 429 cannot create a duplicate resource. See Idempotency.

A well-behaved client waits for Retry-After, then applies exponential backoff with jitter if a retry is itself rejected, and caps total retries rather than retrying indefinitely. The dimensions limiting is measured against and the published numbers are documented in Reference › Rate limits.

On this page