ByRecordDocs
byrecord.com›

Idempotency

How an Idempotency-Key makes every POST safe to retry, and exactly what a retry gets back.

Networks drop answers. Every POST in the partner API honours an Idempotency-Key header, so a request can be retried after a timeout without creating a second quote or sending a proposal twice.

HTTP

Any string of up to 255 characters works. A UUID is ideal. Make one per logical request (per deal you are quoting, say) and keep it with the request until it has an answer.

What a retry gets

SituationAnswer
First request with the keyProcessed normally. The answer is stored, success or refusal alike
Same key, same body, after an answerThe stored answer, byte for byte, with Idempotent-Replayed: true. Nothing is created or sent again
Same key, different body422. Use a new key for a new request
Same key while the first is still running409. Retry shortly
Same key after the quote was created but before its answer was stored201 with that quote, never a second one
Same key after one of our 5xx, with nothing createdProcessed again: a 5xx before anything was created is not stored
Same key after a request died part way with nothing createdHeld for 15 minutes, then a retry with the same body takes it over

"Same body" means the same method, path and JSON body, and for a multipart upload the same file. Keys are scoped to the API key that sent them, so two of your systems cannot collide, and are kept for seven days.

How the guarantee holds

POST /quotes binds the quote it creates to the idempotency key in the same database transaction that creates it. Whatever goes wrong afterwards (a later step failing, a timeout, a restart on our side), the quote and the key are already joined, and the retry is answered with that quote.

A retry loop

JavaScript

Reading a quote document can take a while, so allow a generous timeout on POST /quotes with a document. A retry while it is still being read answers 409 and is harmless.

© 2026 ByRecord · byrecord.com · Status