Idempotency, duplicates and webhooks
Networks repeat and reorder messages. Learn how to test that a repeated request or a message that arrives twice, or late, leaves exactly one correct result.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: pressing the lift button twice. You press the button to call the lift. Nothing seems to happen, so you press again. The lift must still come once, not twice. Pressing more than once should not change the result.
Daily List has a slow network on Lily's train. She taps Upgrade. The app waits, gets no answer and sends the same request again. Tom must check that Lily pays only once.
A is a value sent with a request so the receiver can identify a repeat within its key contract and avoid an extra effect. A is the same message arriving more than once. An out-of-order event is a message that arrives after a newer one, so old news could overwrite new.
These three problems are normal on networks, not rare. The system must be built for them, and the tester must try them.
The picture has limits. A lift has one button and one answer. A payment system has many messages, and they can reach it in any order.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
Pressing twice expresses the same intended action, but a reply may change from pending to complete. Idempotency prevents an extra effect within the promised scope; it does not universally promise identical response bytes forever.
PLAIN WORDS · 3 in this section
- retry
- trying the same action again after it failed
- overwrite
- replace stored data with new data
- bytes
- units of data size, each usually eight bits
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Making sure a request or message that arrives twice, or late, leaves one correct result.
- Send it twice
- Send it at once
- Send old after new
- Read the ledger
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The lift button | A request that might repeat |
| Pressing twice | A retry or a duplicate |
| One lift arriving | One charge and one plan upgrade |
| A button that says the lift is coming | A retry key following a documented replay/resumption contract |
WHERE THIS PICTURE STOPS
- A lift has one button. A payment system has many messages.
- A lift never gets an older press after a newer one. Messages can.
- A lift button is pressed by a person. Retries are done by programs.
- Idempotency preserves the intended effect, not necessarily response bytes; a durable claim must be atomic or recoverable.
HOOK
Press twice, get once.
REMEMBER IT THIS WAY
A contrast: two neighbours told apart by one test.
Tell the three look-alikes apart by what repeats. A marks the same request again, a is the same message again, an out-of-order event is old news after new.
| In the trick | What it stands for |
|---|---|
| Same request again | retry key |
| Same message again | duplicate delivery |
| Old news after new | out-of-order event |
Idempotency preserves the intended effect, not necessarily response bytes; a durable claim must be atomic or recoverable.
TELL A FRIEND
Pressing the lift button twice. The lift must still come once.
OFTEN MIXED UP WITH HTTP methods and status codes. The HyperText Transfer Protocol (HTTP) methods lesson names idempotent methods. This lesson tests repeats and late messages in a payment system.
Sources & standards — 4 sources
- Market practice
RFC 9110 — HTTP Semantics ↗ — IETF · RFC 9110 §9.2.2: intended effects, safe methods, PUT/DELETE, response/log differences, application-known POST semantics and retry constraints.
Internet Standard, June 2022, obsoleting RFC 7230 through 7235.
Cited for method semantics only. "Idempotent" in RFC 9110 is a property of a method: that repeating the request has the same intended effect on the origin server. It is not the same claim as "this payment cannot be duplicated", which is a scheme-level guarantee with its own documents.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read in full from the HTTP Working Group's own publication mirror at httpwg.github.io.
- Market practice
The Idempotency-Key HTTP Header Field — active Internet-Draft 08 (22 October 2026) ↗ — Internet Engineering Task Force · Actual tracker/front matter and draft 08 §§1–2.7 reviewed. Updated 22 October 2026, expires 25 April 2027; active Internet-Draft, not an RFC. Provider-defined uniqueness, expiry, fingerprints and proposed 400/409/422 handling are draft-scoped. Earlier expired draft 07 remains historical, not current status.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
Stripe API — Idempotent requests ↗ — Stripe · Actual complete short reference reviewed. API v1 saves results once execution begins, including 500 results; parameter, retention/pruning and unsaved validation/concurrency conflicts have specific rules. API v2 can resume incomplete work and return updated responses. Identical replies are not universal idempotency semantics.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
Stripe — Receive events in your webhook endpoint ↗ — Stripe · Actual ordering, duplicates, asynchronous processing, signature and quick-response sections reviewed. No order guarantee; event ID versus object/type distinctions; raw-body, signature and recency checks. Application durability and crash recovery remain necessary.
Publisher documentation read through web search on the access date. The interview cases are original hypothetical examples; provider behavior is scoped to this documentation. Event delivery behaviors; duplicate events; API versioning.
PRACTISE AND KEEP
Sources for this topic — 4 sources
- Market practice
RFC 9110 — HTTP Semantics ↗ — IETF · RFC 9110 §9.2.2: intended effects, safe methods, PUT/DELETE, response/log differences, application-known POST semantics and retry constraints.
Internet Standard, June 2022, obsoleting RFC 7230 through 7235.
Cited for method semantics only. "Idempotent" in RFC 9110 is a property of a method: that repeating the request has the same intended effect on the origin server. It is not the same claim as "this payment cannot be duplicated", which is a scheme-level guarantee with its own documents.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read in full from the HTTP Working Group's own publication mirror at httpwg.github.io.
- Market practice
The Idempotency-Key HTTP Header Field — active Internet-Draft 08 (22 October 2026) ↗ — Internet Engineering Task Force · Actual tracker/front matter and draft 08 §§1–2.7 reviewed. Updated 22 October 2026, expires 25 April 2027; active Internet-Draft, not an RFC. Provider-defined uniqueness, expiry, fingerprints and proposed 400/409/422 handling are draft-scoped. Earlier expired draft 07 remains historical, not current status.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
Stripe API — Idempotent requests ↗ — Stripe · Actual complete short reference reviewed. API v1 saves results once execution begins, including 500 results; parameter, retention/pruning and unsaved validation/concurrency conflicts have specific rules. API v2 can resume incomplete work and return updated responses. Identical replies are not universal idempotency semantics.
Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.
- Market practice
Stripe — Receive events in your webhook endpoint ↗ — Stripe · Actual ordering, duplicates, asynchronous processing, signature and quick-response sections reviewed. No order guarantee; event ID versus object/type distinctions; raw-body, signature and recency checks. Application durability and crash recovery remain necessary.
Publisher documentation read through web search on the access date. The interview cases are original hypothetical examples; provider behavior is scoped to this documentation. Event delivery behaviors; duplicate events; API versioning.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.