Choose your depth. Learn at your own pace.
Understand it
You submit a fictional order and the connection drops. Did the order fail, or did only the reply disappear? Blindly trying again can create another order. A duplicate-safe request design helps the service recognize the same intended operation.
Think of a numbered claim ticket. Repeating ticket A should refer to the same operation; a genuinely new operation needs a new identity. The server has to enforce the rule: a label alone does not prevent duplicates.
Under the hood
An idempotency key can identify retries within an API’s documented scope and retention window. The implementation must handle concurrency, payload mismatches and storage of results. Provider rules differ; use the same key only for retries of the same intended operation.
Practitioner perspective
Test the boundary where work commits but its response is lost. Define key scope, expiry, conflict responses and atomic handling with the business operation. Also consider downstream effects, which may require their own duplicate-safe processing.
Watch it work
A fictional, simplified model. Select a component to inspect it, or follow the steps in order.
Explore the system
Operation accepted
The service records a fictional order with operation key A.
Read every step without animation
Reply lost
- Operation accepted. The service records a fictional order with operation key A.
- Connection lost. The client does not receive the reply.
- Same-key retry. Under the service contract, a retry uses A and retrieves the recorded result.
Lost acknowledgement is different from failed work.
New operation
- First order. An initial order uses key A.
- Different intention. The customer deliberately creates another order.
- New identity. The second operation receives a different key.
Reuse a key for a retry, not for a different intention.
Attack view
A timeout leads an application to submit the same intended operation twice.
Defender view
- Follow the API’s documented retry and idempotency contract.
- Test retries, concurrent duplicates and different payloads sharing a key.
Common mistakes
- A timeout does not prove that the server did no work.
- One shared key for every new order confuses different operations.
Check your understanding
Active recall: explain this idea in 30 seconds
You submit a fictional order and the connection drops. Did the order fail, or did only the reply disappear? Blindly trying again can create another order. A duplicate-safe request design helps the service recognize the same intended operation.
Now give an example and name one limitation. Revisit the explanation if you get stuck.
Primary sources
Original explanations informed by these specifications and official resources. Source versions and lesson review are separate from product updates.
Content reviewed 2026-09-11. Read the editorial policy.