Idempotency
Network problems can leave you unsure whether a booking went through. Idempotency keys make retries safe.
Send an Idempotency-Key header on:
POST /bookings(required)POST /bookings/{id}/cancel(required)
Use a value that is unique to the operation, 8 to 255 characters of letters, digits, -, _, :, or .. Your own order ID or a UUID works well.
How it behaves
| You send | You get |
|---|---|
| A new key | The request runs, and its result is stored for 24 hours. |
| The same key and the same body | The stored result, with the header Idempotent-Replayed: true. Nothing runs again. |
| The same key and a different body | 422 idempotency-key-reused. |
| The same key while the first request is still running | 409 idempotency-in-progress. Retry after Retry-After. |
If a request fails with an error, its key is released, so you can retry with the same key.
Keys are scoped to the app and the environment.