Idempotency
Retrying a request should never mean doing it twice.
Every POST needs an Idempotency-Key header of 1 to 255 characters. Generate a new value, such as a UUID, for each action you mean to take, and reuse it only when you retry that same action.
Idempotency-Key: 4b1e6f0c-1d0e-4a51-9a2b-6a3c1f9d2e77| You send | You get |
|---|---|
No Idempotency-Key | 400 IDEMPOTENCY_KEY_REQUIRED |
| A key longer than 255 characters | 400 VALIDATION_ERROR |
| A new key | The request is processed. |
| The same key with the same body | The original result, not a second wallet or operation. |
| The same key with a different body | 409 IDEMPOTENCY_KEY_CONFLICT |
Keys are scoped to your organization. A timeout or a dropped connection is the moment to retry with the same key: you either get the original result or the request is processed once.