TOPIC 05/2220 MINNOT STARTED

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.

  1. Send it twice
  2. Send it at once
  3. Send old after new
  4. Read the ledger
Press twice, get once

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The lift buttonA request that might repeat
Pressing twiceA retry or a duplicate
One lift arrivingOne charge and one plan upgrade
A button that says the lift is comingA 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.

What each part of the trick stands for
In the trickWhat it stands for
Same request againretry key
Same message againduplicate delivery
Old news after newout-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
  1. 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.

    The definition of what an idempotent request method is, alongside safe methods, the status-code semantics an API contract is built on, and conditional requests.

    Used here for the systems-design questions a Payments Software Engineer and a Payments Solution Architect are asked, where the question turns on HTTP's own guarantees rather than on a scheme's rules. · Checked 2026-08-18

    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.

  2. 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 tracker/front matter/draft08§§1–2.7reviewed. Updated22October2026,expires25April2027,activeInternetDraft not RFC. Provider-defined uniqueness/expiry/fingerprints and proposed400/409/422handling are draft-scoped. Earlier07expired descriptions remain historical, not current status. · Checked 2026-11-06

    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.

  3. 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 complete short reference reviewed. APIv1 saved result begins with execution, includes500results, parameter/retention/pruning semantics and unsaved validation/concurrency conflicts. APIv2 can resume incomplete work and return updated responses. Not identical-response semantics for every idempotent operation. · Checked 2026-11-06

    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.

  4. 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.

    Stripe event identity, duplicate deliveries and immutable event versions. This documents Stripe behavior, not a general delivery guarantee. · Checked 2026-09-24

    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
  1. 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.

    The definition of what an idempotent request method is, alongside safe methods, the status-code semantics an API contract is built on, and conditional requests.

    Used here for the systems-design questions a Payments Software Engineer and a Payments Solution Architect are asked, where the question turns on HTTP's own guarantees rather than on a scheme's rules. · Checked 2026-08-18

    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.

  2. 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 tracker/front matter/draft08§§1–2.7reviewed. Updated22October2026,expires25April2027,activeInternetDraft not RFC. Provider-defined uniqueness/expiry/fingerprints and proposed400/409/422handling are draft-scoped. Earlier07expired descriptions remain historical, not current status. · Checked 2026-11-06

    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.

  3. 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 complete short reference reviewed. APIv1 saved result begins with execution, includes500results, parameter/retention/pruning semantics and unsaved validation/concurrency conflicts. APIv2 can resume incomplete work and return updated responses. Not identical-response semantics for every idempotent operation. · Checked 2026-11-06

    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.

  4. 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.

    Stripe event identity, duplicate deliveries and immutable event versions. This documents Stripe behavior, not a general delivery guarantee. · Checked 2026-09-24

    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.