Idempotency key
Also called: deduplication key, client request token
An idempotency key identifies one intended operation across repeated requests. A supporting server records or coordinates the operation under that key so that a retry does not simply execute it again. Its contract must define scope, retention, parameter matching and what happens when requests overlap.
After a create-order response is lost, a client can repeat the same request with the same key and obtain the already-created order under a suitable API contract. A genuinely new order needs a new key. Sending a random header to an unsupported endpoint provides no protection, and reusing a key after its record expires may create a new operation.
- Read first
- Idempotency
- Further reading
- Stripe — Idempotent requests