How it works
Include anIdempotency-Key header with a UUID v4 value on any POST, PUT, or PATCH request. The API stores the response for that key and returns the cached result if the same key is sent again.
Request with idempotency key
Behavior
| Scenario | Result |
|---|---|
| First request with a key | Processes normally and caches the response |
| Same key, same body | Returns the cached response with X-Idempotency-Cached: true header |
| Same key, different body | Returns a 409 Conflict error |
Both successful and failed responses are cached. If the original request failed, retrying with the same key returns the same error.
Key expiration
Idempotency keys expire after 24 hours. After expiration, the same key can be reused for a new request.Best practices
- Generate a new UUID v4 for each unique operation. Do not reuse keys across different operations.
- Store the key before sending the request. If your application crashes mid-request, you can safely retry with the same key.
- Use idempotency keys on all mutation requests (
POST,PUT,PATCH), especially for transactions and customer creation.