Payclave developers
Idempotency and retries
Operation keys, request keys, version conflicts, timeouts, and safe retry behavior.
Give each intended operation a stable key
Save the idempotency key before sending a supported mutation. Retry the same operation with its original key and unchanged payload after double taps, timeouts, connection loss, or a temporary server failure. A new order or a different action needs a different key.
In the server SDK, idempotencyKey is a request option that becomes the Idempotency-Key header. Subscriptions and marketplace orders also have body requestKey contracts; reuse those unchanged on creation retries. Check each route because public invoice recovery and payment-link submission require the header while other operations make it optional.
Resolve conflicts instead of creating duplicates
IDEMPOTENCY_KEY_CONFLICT means the key was already associated with different input. Inspect the existing operation and your stored order state. Do not automatically generate a new key and repeat a wallet-affecting or fulfillment operation.
Version checks solve a different problem: preventing one edit from replacing another. Re-read the current invoice, payment link, or subscription after a version conflict. Keep event deduplication separate as well; idempotent checkout creation does not make your webhook fulfillment idempotent.