Idempotency and retries
Networks fail. The Partner API lets you retry every write safely.
Idempotency-Key
Every authenticated POST requires an Idempotency-Key header. Use a new unique value (a
UUID is ideal) for each logical request, and the same value when you retry it.
| You send | You get |
|---|---|
No Idempotency-Key |
400 idempotency_key_required; nothing is done. |
| A new key | The request is processed. |
| The same key and the same body, within 24 hours | The original response, replayed. Nothing is done twice. |
| The same key with a different body | 409 idempotency_key_reused; nothing is done. |
Keys are kept for 24 hours, per partner.
When to retry
| Response | Retry? |
|---|---|
| Network error or timeout | Yes, with the same Idempotency-Key. |
429 |
Yes, after Retry-After seconds. |
500, 502, 503, 504 |
Yes, with backoff (for example 1 s, 2 s, 4 s, up to 5 tries), same key. |
400, 401, 403, 404, 409, 422 |
No. Fix the request first. |
Quotes that take longer
POST /v1/quotes answers within about 20 seconds. If the carrier's checks need longer, it
answers 202 with status pending and a Location. That is not an error: the quote finishes
in the background and quote.updated follows. Do not resubmit a pending quote; read it with
GET /v1/quotes/{quote_id} or wait for the webhook.