Back to dictionary

Technical / API

Idempotency

A property ensuring that repeating the same API request multiple times produces the same result as doing it once.

In simple terms

Idempotency means clicking 'book' twice by accident shouldn't create two separate bookings.

Real-world example

A booking API accepts an idempotency key so a retried request after a timeout doesn't duplicate the reservation.

Why it matters

Without idempotency, network retries and timeouts can create duplicate bookings, double charges, or inventory errors.

Common mistake

Retrying a failed booking request without an idempotency key, risking a duplicate reservation and double payment.

Interview question

Why does idempotency matter specifically for booking and payment endpoints?

Related terms
APIRetry LogicError Handling