Idempotency keys in payment APIs
How to retry a payment after a timeout without ever sending it twice.
An idempotency key is a unique value you attach to a write request so that retrying it is safe. If the same key arrives twice, the server returns the original result instead of performing the action again.
The problem
Networks time out. Your request to create a payment may have succeeded on the server even though you never got the response. Retry blindly and you've paid twice. For money movement, that's unacceptable.
How the key fixes it
With an idempotency key, the retry carries the same key as the first attempt. The server recognizes it, and returns the same payment — never a second one. A different request body under an already-used key is a conflict, not a silent overwrite.
On DigitalTreasury
Every write on the API accepts an Idempotency-Key. Retry a timed-out payment order with the same key and you get the same order back — a timeout can never become a duplicate payment. See the API docs.
Webhooks for payments: delivery you can trust
How to get told the instant money moves — and be sure the notification is real and never lost.
ACH return codes explained (R01, R02, R03…)
Why a payment came back — and why 'insufficient funds' and 'account closed' should be different branches in your code.
What is RTP (real-time payments)?
Instant, always-on, and final — how real-time payments change what a payout can feel like.