Send an Idempotency Key
Add anIdempotency-Key header to create requests. Use a unique value (a UUID v4 is ideal) for each logical payment attempt.
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.| Scenario | Result |
|---|---|
| Same key + same merchant, request already completed | Replays the original response. No duplicate is created. |
| Same key, request still in flight (concurrent) | 409 IDEMPOTENT_REQUEST_IN_PROGRESS |
| Idempotency store unavailable | 503 IDEMPOTENCY_STORE_UNAVAILABLE (retryable) |
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 returns409 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, returning503 IDEMPOTENCY_STORE_UNAVAILABLE.
Best Practices
One key per logical attempt
One key per logical attempt
Generate a fresh key when you start a new payment attempt. Persist it alongside your order so retries of that same attempt reuse it.
Reuse the key when retrying
Reuse the key when retrying
On a timeout or transient error, retry with the same key. A new key on retry defeats the protection and can create a duplicate.
Use a fresh key for a genuinely new attempt
Use a fresh key for a genuinely new attempt
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