Back to glossary
What is an Idempotency Key?
A unique identifier that prevents duplicate API operations.
An idempotency key is a unique string you include with API requests to ensure the same operation isn't executed twice. If a network error causes your request to retry, the API recognizes the duplicate key and returns the original result instead of creating a duplicate payment.
Why It Matters for Payments
In payment processing, duplicate charges are catastrophic for customer trust. Idempotency keys ensure that even if your server retries a payment creation request, only one payment session is created.
Usage with Zateway API
Include an Idempotency-Key header with every POST /api/v1/sessions request. Use a UUID or a deterministic key based on your order ID. Zateway stores the key for 24 hours.