i·dem·po·ten·cy
/ˌaɪ.dəmˈpoʊ.tən.si/ (eye-dem-POH-tun-see) noun
- An operation that has the same effect whether it is performed once or many times, making retries safe. Sending an idempotency key with each payment request lets the server ignore duplicates.
Origin
From Latin idem, 'the same', and potent-, 'having power'. Coined by the mathematician Benjamin Peirce in 1870.
In practice
Any request that can be retried will be. Idempotency keys turn a duplicate charge into a no-op.
Say to your AI
Make the payment endpoint idempotent: accept an Idempotency-Key header, store the first result for 24 hours, and return it for any repeat.
In plain words
- the customer got charged twice
- the user clicked submit twice
- retrying created duplicates
- make it safe to retry
See also at-least-once delivery exponential backoff with jitter race condition