2xx means the call
worked, a 4xx means something about the request needs fixing, and a 5xx
means the problem is ours.
Every error has a type, an optional code and a message for a person
The envelope
Every error has the same shape:
Successful responses are just as plain. Objects and lists come back under
data:
Types
Common cases
401 authentication_error
401 authentication_error
The key was missing, malformed, or revoked. Check that you are sending
Api-Key: rk_live_... and that the key has not been deleted
in the dashboard.We answer the same way for a key that never existed and one that was
revoked, so the endpoint cannot be used to find out which.403 permission_error
403 permission_error
The key is good but lacks the permission for this endpoint. Mint a key with
the permission, or add it to the existing one. See
Authentication.
400 invalid_request_error
400 invalid_request_error
A field is missing or will not parse. The message names the field. Amounts
are decimal strings such as
"29.00", dates are RFC 3339, and networks are
lowercase names such as base.409 on a usage record
409 on a usage record
A usage record with that
idempotency_key already exists. That is the
safeguard working: the original record stands and nothing was billed twice.
See Idempotency.429 too many requests
429 too many requests
You hit a rate limit. Back off and retry. Payer-facing endpoints on the
hosted checkout are throttled harder than merchant endpoints, because a
link is public and anyone holding the URL can call them.
500 api_error
500 api_error
Ours. Retry with the same request. If it persists, write to support with
the time and the object reference.
Handling errors well
Infrastructure failures
When something fails deep in the stack, we answer with a plainapi_error
instead of echoing the underlying failure. Internal detail such as SQL
fragments, table names or host addresses never reaches a response body. The
full error is logged on our side with the handler that produced it, so support
can find it from the time and the reference.
