Idempotency
Safe retries for POST requests via the Idempotency-Key header
Every POST request to the Admoji API must include an Idempotency-Key header. Duplicate requests carrying the same key within 24 hours return the original result without re-executing the operation — protecting you from double-charges and duplicate records when a client retries after a transient error.
Header format
Any unique string up to 48 characters is accepted. A UUID v4 is recommended.
GET, PUT, and DELETE requests are idempotent by definition — the Idempotency-Key header is ignored on those methods.
Why it matters
An API call is idempotent when applying it multiple times produces the same result as applying it once. Without an idempotency key, a client that retries a failed POST /signup-transaction may charge the card twice. With the same key on both attempts, the server recognizes the second request as a retry and returns the cached response of the original.
Generating keys
Use your language’s standard UUID generator. A short list:
Key lifecycle
- Keys expire 24 hours after first use.
- Reusing a key outside the 24-hour window creates a new operation.
- Reusing a key inside the window with a different request payload returns an error — the idempotency layer verifies the payload matches the original request.
Example
Retry that exact request with the same header within 24 hours and you get the cached response of the first successful call — no double-charge, no duplicate order.
