NuruPay Docs

Idempotency

Retry safely without charging twice.

Networks fail. If a request times out, you don't know whether NuruPay received it. Idempotency lets you retry safely.

Send an Idempotency-Key header on every POST (a UUID is ideal):

Idempotency-Key: 4f6c2b1e-8d0a-4c55-9e7b-3a2f1c0d9e8b
You sendYou get
A new keyThe request is processed normally.
The same key and the same bodyThe original response, with header Idempotent-Replayed: true. Nothing is processed twice.
The same key with a different body409 idempotency_key_reused
The same key while the first request is still running409 idempotency_request_in_progress: retry in a moment
No key on a POST400 idempotency_key_required
  • Keys are scoped to your account and mode, and remembered for 24 hours.
  • If the original request failed with a 5xx or 429, the key is released so your retry is processed normally.
  • Keys are 1–255 printable ASCII characters.

Separately, your collection reference must be unique, which protects against double charges even if you generate a new idempotency key by mistake.