The problem
You send a request to create a transfer, but the network drops the response before it reaches you. Did it go through? If you simply retry, you risk doing it twice — a double transfer or double charge.The solution
Every create request takes anidempotencyKey: a unique ID you generate (a UUID works well). The rule is simple:
- First request with a key → the operation runs.
- Retry with the same key → you get the original result back. The operation never happens twice.
Rules of thumb
- Generate one new key per distinct operation — each new transfer, payment, or pay-in gets its own.
- Reuse the same key only when retrying that exact operation.
- A key is required on: transfers, payment requests, pay-in sessions, and virtual bank accounts.
Save the key alongside your operation before you send it. That way, if your process crashes mid-request, the retry can reuse the same key.

