An idempotency key identifies one client operation. The server stores the key and outcome for a defined period, returning that outcome for a retry with the same key. This helps when the network drops a response after the operation succeeded.
In the demo, two POST attempts share a key and create one order. The server must define key scope, retention time, and how it handles a different payload under the same key.
When to use
Use it for payment or order creation where retries could duplicate a side effect.