ROOKDocs
Getting Started Guide

Errors

Failures use the matching HTTP status and a uniform JSON envelope. Every response, including errors, includes X-Request-ID. On failures that value matches error.request_id.

json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_request",
    "message": "invalid order by: foo. Valid options are: [created_at updated_at]",
    "param": "order_by",
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "doc_url": "https://docs.rookpayments.com/errors/invalid_request"
  }
}

Branch on HTTP status and error.code. Do not parse error.message as a stable contract. param names the JSON field, query parameter, or header that failed, or is null.

Catalogue

HTTPtypecodeWhen
400invalid_request_errorinvalid_requestMalformed JSON, failed schema validation, or conflicting query parameters.
400invalid_request_errorprogram_requiredX-Program-ID omitted while the API key can access more than one program.
401authentication_errorauthentication_errorMissing or invalid API key.
403permission_errorpermission_deniedThe key cannot access this program or resource.
404not_found_errornot_foundUnknown id, or the resource is not visible to this key.
409conflict_errorconflictIncompatible state transition.
409conflict_erroridempotency_conflictIdempotency-Key reused with a different body, or a matching request is in flight.
422invalid_request_errorinsufficient_fundsThe source financial account does not have enough available balance.
422invalid_request_errorcard_not_activeThe card is not in a state that can authorize or capture.
422invalid_request_errorcard_expiredThe card's expiration date has passed.
422invalid_request_errorwallet_closedThe financial account or wallet entity is closed.
422invalid_request_errorlimit_exceededThe request would exceed a spend, velocity, or balance limit.
429rate_limit_errorrate_limitedThe key exceeded its rate limit. Honor Retry-After.
500api_errorinternal_errorUnexpected failure. Retry with the same Idempotency-Key.
doc_url is https://docs.rookpayments.com/errors/{code}.

Rate limits

Limits are enforced per API key. Burst and sustained ceilings can differ between sandbox and production. When a limit is exceeded the API returns 429 with:

  • Retry-After: integer seconds to wait before retrying
  • error.code of rate_limited
Back off exponentially and cap parallel callers per key. Prefer webhooks over tight polling. Idempotent retries after a 429 are safe when Idempotency-Key is set.