Design notes for a payout system that never loses a rupee
Payouts are the highest-stakes part of any payments stack: money leaves your account, and everything that can go wrong — duplicate requests, timeouts, beneficiary typos — shows up here first.
Idempotency is not optional
Every payout request needs a client-generated idempotency key. If the network drops after a debit, a retry must return the original result, not create a second debit. This is the single most important design decision in a payout API.
Handle the return leg
Some payouts will bounce — closed accounts, name mismatches, frozen accounts. A mature payout system treats a returned transaction as a first-class event: credit restored, ledger updated, merchant notified, and the original reference preserved so nothing is double-counted.
Penny-drop verification before the first payment to a new beneficiary catches most bad account details, and name-match checks catch the rest. Neither is foolproof, but together they cut returns dramatically.
Balances you can trust
Ledger-first design means every payout is recorded before it is sent, and every reversal is recorded before it is credited. The dashboard balance should never be a question about what the bank will say.

