Documentation/Guides/
Idempotency and retries
A network can fail after the request reached us and before the answer reached you. Every write of this API can be sent again safely, as long as you send it the same way.
| Endpoint | What makes two requests the same | A repeat answers |
|---|---|---|
POST /v1/transactions | The same source_system and external_transaction_id, or the same Idempotency-Key, within your institution. The key is optional. | 200, duplicate: true, the payment's current decision (its status may have moved on). Nothing new is stored. A repeat must carry the first request's customer_ref, amount, currency, direction, channel and instant (left out is false), or it is refused 409. |
POST /v1/card-authorizations | The same Idempotency-Key within your institution, only. The key is required (400 without it), at most 255 characters. | 200, duplicate: true, the card event's first decision. A repeat must carry the first request's card_token, event_type, amount and currency, or it is refused 409. |
POST /v1/customer-events | The same source_system and external_event_id within your institution. No key is needed. | 200, duplicate: true, the first answer. A repeat must carry the first request's customer_ref and event_type, or it is refused 409. |
POST /v1/cdd-ingest | Rows are matched by customer_ref, accounts by account_number. | A row that changes nothing counts as unchanged and makes no new CDD version. |
GET /v1/transactions/{id}/decision | Read only. | The current decision. |
A repeat is the same request sent again. Amounts are compared as numbers (140 and 140.00 are one amount) and codes as we store them (outgoing and OUTGOING are one direction). A request that reuses a key or a reference with another body is refused 409 with error_code IDEMPOTENCY_CONFLICT, and its error names the fields that differ, never a value; nothing is stored. A payment whose Idempotency-Key belongs to one of your payments and whose external_transaction_id to another is refused 409 with REFERENCE_KEY_MISMATCH. A 409 is never retried unchanged: a retry sends the first body; a new payment or event needs a new reference and a new key.
Two requests that are the same and arrive at the same moment wait for each other: the second answers like a repeat. When both reach the same server instance while the first is still being decided, the second is answered at once 503 Service busy with Retry-After: 1; its retry is then answered like any repeat.
When to retry
| Answer | Retry? |
|---|---|
200, 202 | No: it is the answer. |
400, 401, 403, 404, 405, 409, 413 | Never unchanged: correct the request. |
429 | Yes, after the seconds in Retry-After. |
500 | Once, the same request. If the same code comes back, contact Underlayer. |
503 | Yes, after Retry-After (1 s for Service busy, 5 s for Service unavailable), with back-off. A 503 without Retry-After (SERVICE_SETTINGS_UNUSABLE): with back-off from 1 s. |
A bare 502 or 504, or a 5xx answer that is not JSON | Yes, with back-off: it comes from our hosting provider. |
The status decides first: a 4xx of the rows above is never retried unchanged, even when its body is not JSON. Back off by doubling the wait (1 s, 2 s, 4 s ... up to a minute), never less than Retry-After. Always retry with the same body, the same external_transaction_id and the same Idempotency-Key: a retry with a new reference is a new payment.
When the first answer never arrived (a timeout, a dropped connection), the retry can be the request's first answer you see: 200 with duplicate: true for a payment, a card event or a customer event, 200 with changed: false for a card. That is the result of your request, not a failure: read it as the first answer.
A payment's repeat
{
"duplicate": true,
"transaction_id": "00000000-0000-4000-8000-000000000001",
"decision_id": "00000000-0000-4000-8000-000000000002",
"decision_ref": "DEC-2026-000123",
"status": "HUMAN_REVIEW",
"rejection_action": null,
"correlation_id": "6f1c2f9e-0000-4000-8000-000000000003",
"received_at": "2026-09-01T09:15:01.102345+00:00",
"policy_version": "decision-policy-v1.6"
}
A repeat answers 200 whatever its status: check status before you settle.
© 2026 Underlayer, Lithuania. info@underlayer.eu System status Privacy notice