Meaning
Unique value passed by a client in an application programming interface request to ensure the same operation is not executed more than once. The idempotency key serves to protect the integrity of financial ledgers during network interruptions or timeout events. It is a standard component of modern payment api designs.
Duplicate Protection
When a server receives a request with a previously seen key, it returns the cached result of the first successful operation instead of performing the action again. This prevents a duplicate charge on an account if a browser is refreshed or if a mobile app retries a failed connection. The use of these keys is essential in distributed systems where network reliability cannot be guaranteed and duplicate instructions are common.
Key Persistence
The receiving system must maintain a log of active keys and their associated responses for a predefined window of time. Once this window expires, the key is purged from the database and a new request with the same identifier may be treated as a fresh instruction.
Request Retry
Client applications are programmed to generate a new key only for a new transaction. Retrying the same logical action always involves sending the original identifier.