Errors & rate limits

Errors are JSON, signed like any other response, and carry a request_id to quote to support.

Error body
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "amount must be a string with exactly two decimals, e.g. \"150.00\".",
    "request_id": "req_xxxxxxxxxxxxxxxx"
  }
}

Branch on code, not on message: messages are for humans and may be reworded.

Signature and request errors #

HTTPcodeMeaning / fix
401AUTH_MISSING_HEADERA required X-Aegis-* header is missing.
401AUTH_MALFORMED_HEADERA header has the wrong format or appears twice.
401AUTH_TIMESTAMP_OUT_OF_RANGEYour clock is more than 300 s off. Run NTP.
401AUTH_FAILEDBad signature, unknown or revoked key, or inactive account. Deliberately vague: see debugging.
409AUTH_REPLAYED_REQUESTThis nonce was already used. Use a new nonce for every request, including retries.
413AUTH_BODY_TOO_LARGEBody over 64 KiB.
400AUTH_IDEMPOTENCY_KEY_REQUIREDPOST without an Idempotency-Key.
400INVALID_JSONThe body isn't valid UTF-8 JSON.
403HTTPS_REQUIREDPlain HTTP. Use https://.
429RATE_LIMITEDToo many requests. Wait Retry-After seconds.

Payment errors #

HTTPcodeMeaning / fix
400VALIDATION_ERRORA field is missing, unknown or invalid. The message says which.
404PAYMENT_NOT_FOUNDNo payment with that ID for your account.
409DUPLICATE_MERCHANT_REFERENCEThat merchant_reference was already used. Each order gets one payment.
409IDEMPOTENCY_IN_PROGRESSThe first request with this Idempotency-Key is still running. Retry shortly.
422IDEMPOTENCY_KEY_REUSEDThis Idempotency-Key was used for a different request.
422METHOD_NOT_ENABLEDThat payment method isn't enabled for your account.
422AMOUNT_TOO_SMALLThe amount doesn't cover the fee.
502PROVIDER_REJECTEDThe bank network refused the payment; it's marked failed. Use a new merchant_reference.
502 / 503PROVIDER_UNAVAILABLEThe bank network didn't answer. 503: outcome unknown, retry with the SAME Idempotency-Key. 502: marked failed.
503METHOD_UNAVAILABLEThe method is temporarily unavailable. Try later.
500INTERNAL_ERROROur problem. Retry with the same Idempotency-Key and back off.
503SERVICE_UNAVAILABLEThe API is starting up or unavailable. This one is NOT signed: treat the outcome as unknown and retry after Retry-After.

Retrying safely #

Retry on network errors, timeouts, 409 IDEMPOTENCY_IN_PROGRESS, 429 and 5xx, with the same Idempotency-Key and a new nonce, timestamp and signature. Back off (e.g. 1 s, 2 s, 4 s…). Don't retry other 4xx errors unchanged: fix the request first.

Rate limits #

WhatLimitNotes
Signed requests, per merchant600 per 10 sAbout 60 per second, with bursts. Need more for a big sale? Ask us in advance.
Failed signatures, per IP20 per minuteWhile exceeded, ALL requests from that IP get 429 for up to a minute. Fix the signing bug first.
GET /v1/platform-keys, per IP120 per minuteCache the keys.

A limited request gets 429 RATE_LIMITED with a Retry-After header (seconds), still signed.