POST, PATCH, DELETE) accept an optional Idempotency-Key header. When you supply one, the server caches the response for 24 hours and replays it verbatim on retries — so a network timeout or process crash can’t cause a duplicate payment link, session, or webhook endpoint.
Key requirements
- Unique per request — use a value tied to the operation, not a random UUID you generate on every retry. A good pattern:
{orderId}-{operation}-{version}. - String, any format — up to 255 characters.
- Scope — idempotency is scoped per API key. The same key used by two different API keys is treated as two independent operations.
Replay behavior
When the server returns a cached response, the reply includes the header:Conflict: different body, same key
If you send the sameIdempotency-Key with a different request body, you get a 409 conflict:
When to use it
Always useIdempotency-Key for operations where duplicates matter:
- Creating a checkout session for a specific order
- Creating a payment link for a product
- Creating a webhook endpoint during setup