Razorpay · Opend practice case · Updated
How do you recover a payout when the bank’s response is missing?
Imagine a vendor dashboard paying invoice V-42 for ₹12,500. The vendor clicks once. Your worker sends the request, waits five seconds and loses the connection. Support sees an unpaid invoice. What would let them retry safely?
Short answerPersist one payout instruction and its idempotency key before dispatch. A timeout leaves that instruction unresolved. Recover its outcome before approving another transfer.
- Record the instruction
V-42 → payout P7. Store the amount, beneficiary and key K7 together.
- Lose the response
The bank may have received P7. Record the timeout and keep K7.
- Resolve P7
Retry the same request with K7 or reconcile its provider record. Attach the outcome to V-42.
Decide what makes two payouts the same
Use a business identifier for one approved payment. Two instalments of the same amount to the same vendor can both be legitimate. A unique constraint on the approved instruction lets two workers converge on one record. Commit the provider key and request fields together. If the beneficiary changes, stop for a new approval. Razorpay documents the key and same-request requirement for retries.
Razorpay payout idempotency ↗Keep the accounting trail through a reversal
Treat provider status and your accounting entries as separate records. In this design, a confirmed payout posts the settlement entry once. A subsequent reversal produces a linked compensating entry. Overwriting the first entry would make yesterday’s statement impossible to explain. Deduplicate incoming notifications, and reconcile outstanding instructions against provider records when notifications are delayed.
RazorpayX payout webhook events ↗Test the moment money could move twice
Put the fault immediately after provider acceptance. Kill the worker before its local write, start two replacement workers and replay the same notification. Assert that each worker uses K7, that only one settlement entry exists, and that the unresolved amount remains visible to operations until confirmed. Track the age and amount of unresolved payouts. An HTTP success rate alone cannot tell finance what remains outstanding.
| Observation | Known outcome | Next action |
|---|---|---|
| Request timed out | Delivery unknown | Recover P7 with K7 |
| Processing | Provider has P7 | Monitor the same payout |
| Reversed | Funds returned | Record reversal and review the invoice |
Try the follow-upSupport wants a “pay again” button after 30 seconds. What would you ship?
Offer “Check payout status” for an unresolved instruction. A clock cannot prove that funds stayed put. Allow a new payment only through an explicit decision after reconciliation, with the earlier instruction and its final outcome visible to the approver.