Skip to main content
Use idempotency keys when retrying create or money-moving POST requests. If your first request times out, retry with the same key and the same body.

How it works

  1. Send a stable Idempotency-Key for one business operation.
  2. Reuse that key only when retrying the same request.
  3. If the original request completed, Ionic returns the original result.
  4. If the same key is reused with a different body or endpoint, Ionic rejects the request.
For PaymentIntent creation, confirmation, and Refund creation, the key remains associated with the original operation if the response is lost or the result is unknown. Retrying can recover that operation’s current result. A timeout does not authorize a second charge or refund. While the result remains unknown, inspect the original resource and wait for reconciliation. After a confirmed decline or failure, a separately permitted payment attempt uses a new key. Reusing the original key retrieves the original attempt. A new key does not bypass an unresolved attempt on the same PaymentIntent. Completed keys normally remain available for 24 hours. Unresolved payment operations retain their association beyond that window; do not rotate keys to work around an unknown result. A key is not a permanent order-level uniqueness constraint. Replayed responses include:

Conflict behavior

Key design

Use a key derived from your own operation ID, not a random key generated per retry. Good:
Avoid: