API reference · Idempotent requests
API reference / Overview
Idempotent requests
Apps can retry a write safely. Send an Idempotency-Key header and a repeat of the same request returns the first response instead of doing the work twice.
When it applies
- Requests made with an app's OAuth token (
inka_…). Secret-key requests aren't covered; use a uniquereference_idinstead. POST,PUTandDELETE.- Keys of 8 to 255 characters. A UUID works well.
A key belongs to your app and the merchant the token acts for, and lasts 24 hours.
What happens on a repeat
| You send | You get |
|---|---|
| The same key and body | The first response again, with the header idempotency-replay: true. |
| The same key with a different body | 409 idempotency_key_reuse_with_different_payload. |
| The same key while the first is still running | 409 request_in_progress. Wait and retry. |