Skip to main content
Network failures happen: a request times out, a connection drops, or your service retries before it sees the response. Without protection, a retried create call could produce a duplicate payment. Idempotency keys let you retry safely: Quidkey recognises the repeat and replays the original result instead of creating a duplicate.

Send an Idempotency Key

Add an Idempotency-Key header to create requests. Use a unique value (a UUID v4 is ideal) for each logical payment attempt.
This matters most on create endpoints such as POST /api/v1/payment-requests:redirect, where a duplicate would create a second payment request.
Body abbreviated. See the Redirect guide for the full required payload.

How Replay Works

Quidkey scopes idempotency keys per merchant. When it sees a key it has handled before, it returns the original response rather than performing the action again.
Idempotency keys are scoped to your merchant. The same key value used by a different merchant is treated as an independent request.

Concurrent Requests

If two requests carrying the same key arrive before the first finishes, the second returns 409 IDEMPOTENT_REQUEST_IN_PROGRESS. The first request is still being processed, so wait briefly and retry with the same key to pick up the replayed result.

When the Store Is Unavailable

If Quidkey cannot reach the idempotency store, it fails closed rather than risk a duplicate, returning 503 IDEMPOTENCY_STORE_UNAVAILABLE.
A 503 IDEMPOTENCY_STORE_UNAVAILABLE means the request was not processed. It is safe (and expected) to retry with the same idempotency key, ideally with exponential backoff.

Best Practices

Generate a fresh key when you start a new payment attempt. Persist it alongside your order so retries of that same attempt reuse it.
On a timeout or transient error, retry with the same key. A new key on retry defeats the protection and can create a duplicate.
If the customer deliberately starts over (e.g. a new checkout for a new basket), mint a new key, since it is a different logical attempt.

Next Steps

Errors

Status codes including 409 and 503

Accept a Payment (Redirect)

Create a redirect payment request

Authentication

Obtain and refresh access tokens

Webhooks

Receive payment results reliably