Idempotency key.
also: idempotency keys · Idempotency-Key · idempotency record · idempotency records · idempotency storeA unique ID the client sends with each logical operation; the server stores it with the result and replays that result on retries.
the two-minute refresher
- The coat-check ticket: hand in the coat once, show the ticket as often as you like.
- First request: store key → 'processing', do the work, store the result. Retry: return the stored result.
- Pre-register the key BEFORE calling the bank, so a timeout leaves a record you can reconcile.
- Hash the request body too: the same key with a different amount must be rejected.
- Only completed records block retries: 'processing' makes the caller wait, 'failed' lets a retry run.