Skip to main content
DevOps & CI/CD
DEFINITION

What is Idempotency?

An operation is idempotent if performing it multiple times has the same effect as performing it once. Idempotency is what makes retries safe: a repeated request must not double-charge, double-create, or otherwise compound its effect.

Free to start · 7-day trial on paid plans

IN DEPTH

In depth.

Networks are unreliable, so clients retry. If a payment request times out, the client does not know whether it succeeded, so it retries, and without idempotency that retry could charge the customer twice. Idempotency is the property that makes that retry safe. In HTTP, GET, PUT, and DELETE are defined as idempotent, while POST generally is not, which is why creating resources needs extra care.

The standard mechanism is an idempotency key: the client sends a unique key with the request, the server records the result against that key, and any repeat with the same key returns the stored result instead of doing the work again. Payment APIs (Stripe, PayPal) and any system that moves money or creates records rely on this.

Testing idempotency is a high-value QA skill: send the same request twice (and concurrently) and assert the effect happened exactly once, the second call returns the same result, no duplicate row, no second charge. It is closely tied to retries, exactly-once semantics, and reconciliation, and it comes up constantly in SDET and fintech interviews.

WHY IT MATTERS

Why interviewers ask about this.

Idempotency is one of the highest-signal topics for SDET, backend, and fintech QA interviews. Being able to define it and describe how you would test an idempotent endpoint under retries and concurrency demonstrates real distributed-systems testing maturity.

EXAMPLE

Example scenario.

A payment endpoint accepts an idempotency key. The test sends the same charge request twice with the same key, including two requests firing concurrently, and asserts exactly one charge is created and both responses are identical. A bug surfaces: under concurrency, two rows are created because the key check is not atomic.

TIP

Interview tip.

Define idempotency (same effect no matter how many times you apply it), connect it to safe retries and idempotency keys, and describe a concrete test: duplicate and concurrent requests asserting the effect happened exactly once.

FAQ

Frequently asked questions.

What is an idempotency key?

A unique value a client sends with a request so the server can recognise a retry. The server stores the result against the key and returns that stored result for any repeat, ensuring the operation happens only once even if the request is sent multiple times.

How do you test that an API is idempotent?

Send the same request multiple times (and concurrently) with the same idempotency key and assert the effect occurred exactly once, no duplicate record, no second charge, and identical responses. Concurrency often reveals non-atomic key checks.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining idempotency and other key concepts with our AI interviewer.

Join 1,200+ QA engineers already practicing with AssertHired.

Start your free QA interview
FREE.TO.START  ·  7.DAY.TRIAL ON PAID PLANS
Written by Aston Cook, Senior QA EngineerLast updated May 2026