When idempotency is required
TheIdempotency-Key header is required on write operations that create or mutate state:
Commitment creation is idempotent by the quote ID — the same quote can only have one commitment. Confirming a commitment is idempotent by the quote ID and external reference.
How to use it
Pass anIdempotency-Key header on every quote creation request:
Key rules
- Format: Any string up to 200 characters. Trimmed of whitespace.
- Uniqueness: Use a unique key per logical operation. A UUID, a nanoid, or a deterministic hash of your request payload all work.
- Scope: The key is scoped to your account. Two different accounts can use the same key without conflict.
- Replay: Retrying with the same key returns the original response. The quote is not duplicated.
- Expiry: Idempotency keys are retained for a reasonable window. If you retry days later, a new quote may be created.
Missing key error
If you omit theIdempotency-Key header on a write operation that requires it, the API returns:
Retry pattern
When a request fails due to a network error or a5xx response, retry with the same Idempotency-Key:
- Generate a unique key for the logical operation.
- Send the request with the key.
- If you receive a timeout or
5xx, retry with the same key. - If you receive a
4xx, the request was processed — do not retry blindly. Check the error code. - If you receive a
2xx, the operation succeeded. Retrying with the same key returns the same response.