Skip to main content
Use an Idempotency-Key to prevent duplicate charges or refunds when you retry a request. Reuse the same key and request body for each retry.

Supported endpoints

  • Create a payment with POST /payments.
  • Refund a payment with POST /payments/{id}/refund.
  • Void a payment with POST /payments/{id}/void.
The header is optional, but strongly recommended on every production charge, refund, and void.

Sending the header

Pass a unique string (max 255 characters) in the Idempotency-Key header. Use a UUID generated with $(uuidgen) in shell or crypto.randomUUID() in Node. Keys are scoped to your API account.

Replay behaviour

If you send the same key with the same request body, the API returns the original response without charging or refunding again, with the header:
A replay does not create another charge or refund. Error responses (4xx) are replayed too.

Idempotency conflicts

After a 5xx on create payment, the key stays reserved so that a retry cannot charge the card twice. A retry returns IDEMPOTENCY_RECONCILIATION_REQUIRED. After a 5xx on refund or void, the key is released, so you can retry the operation with the same key.

Retrying without a key

If you do not send an Idempotency-Key and the request times out or errors, a retry may charge the cardholder twice.

Key expiry

Responses are kept for 24 hours. After that, sending the same key and body is treated as a new request. Generate the key once before your first attempt, store it with the pending charge, and reuse it on retries.