Safe retries (Idempotency-Key)
Retry any change without doing it twice.
Networks fail. To retry a change safely, send an Idempotency-Key header with any unique string — your order id plus the step is perfect:
Idempotency-Key: order-1001-shipped- A retry with the same key within 24 hours gets the first answer back, with
Idempotent-Replayed: true, and nothing runs again. - The same key with a different body is refused (
invalid_input). - While the first request is still running, a retry gets
409 conflict. Wait and retry. - Some operations — sends and imports — require the header.
Failures are not stored, so you can fix a bad request and retry it with the same key.