In this illustrative example, a payment operator refunds SGD 40 on a payment of SGD 120. At 14:16 the duty supervisor approves the request and the payment service sends the instruction to the partner; after 30 seconds without a response, the request times out. At the daily cutoff, the internal ledger still shows the refund as pending, while the partner’s settlement report already lists a completed refund for the same amount. The difference is logged as an exception, and a merchant is waiting for an answer.
Both of the usual reflexes are wrong here. Resending the instruction can refund the customer twice. Closing the exception to make the cutoff leaves the ledger out of line with the partner, and whatever stopped the result from coming back is still in place, waiting for the next refund.
The duty supervisor closes the exception only when the ledger matches the partner’s record without another instruction being sent, and the cause has an owner. Partner behavior is quoted from public Stripe and Adyen documentation; your partner may differ.
Who approved
A Payment Operations analyst requests a refund on the original payment P-17. The duty supervisor, a different person, approves the amount and currency. Only then may the payment service send the instruction. The approval record holds the original payment, the refund ID (R-17), the amount, the currency, the requester, the approver and the time of approval.
The Threat Model puts one question to Security and Engineering: can the person who requested a refund make the money move on their own? Hiding the approve button in the back office only covers the screen. The two-person rule, usually called maker-checker, has to live in the payment service, the only component that can send an instruction to the partner:
- The approver is taken from the authenticated session and must differ from the requester.
- An approval is bound to exactly one original payment, one amount and one currency; changing any of them voids it.
- The total of refunds on P-17, pending ones included, cannot exceed the amount captured.
- Internal APIs, bulk file uploads and admin tools all pass through the same check.
The security owner asks for a staging exercise made of attempts that must be rejected: the requester approves their own request in the UI, calls the approval API directly, and changes the amount after approval. The evidence for each attempt is a rejection with a recorded reason, plus a request log showing that no instruction left the system. A refund that goes through with two people involved only shows that the right path works, not that the wrong paths are blocked.
Read the three records together
| Record | What it shows | What it establishes |
|---|---|---|
| Approval record | The duty supervisor approved refund R-17 on payment P-17, SGD 40, at 14:16. | Which payment and amount the operator authorized for refund. |
| Internal ledger | R-17 is pending. No entry records a completed SGD 40 refund. | Payment Operations has an open item for this reconciliation period. |
| Partner settlement report | Exactly one completed refund in this period, R-17, on payment P-17, SGD 40. | The partner has recorded the refund. Hold every resend. |
Payment Operations matches on identifiers first, then checks amount and currency. An amount does not identify a refund: one day can hold many SGD 40 refunds, and one payment can carry several valid partial refunds. That is why the operator creates R-17 itself, stores it before sending and sends it with the instruction. When the response is lost, it is the only key for finding the refund on the partner’s side. If the settlement report carries only a partner-generated ID, a status query maps that ID back to R-17.
Each record also has its limits:
- The approval record does not say whether the instruction left the system.
- Pending in the ledger means the system does not know the outcome, not that the money has not moved.
- The settlement report does not say that the cardholder received the money, and does not rule out the refund being returned later.
Why the ledger is still pending
A request to another party’s system has three outcomes, not two: success, failure and unknown. A timeout is the third kind. The partner may never have received the instruction, or it may have processed it and lost the response on the way back. Keeping the refund pending is correct. Moving it to failed is the dangerous step, because a failed state reads as an invitation to raise a new request.
With many partners the final outcome does not arrive in the response but later, by webhook. Adyen’s documentation states that “The refund process is asynchronous” and tells you to wait for the REFUND webhook. That path has its own properties. Stripe’s documentation says that “Webhook endpoints might occasionally receive the same event more than once”, that event order is not guaranteed, and that in live mode Stripe retries delivery for up to three days. The receiver therefore has to process callbacks idempotently, not rely on their order, and have a way to ask again for events that never arrive.
Engineering has five hypotheses for R-17, each with its own evidence.
| What may have happened | Evidence that tells it apart | What to fix |
|---|---|---|
| The response was lost | The request log shows the send time and the timeout, with no response. A status query finds R-17 at the partner. | After a timeout, the service queries the status by refund ID on its own. |
| The callback never arrived | The ingress log has no request, or has one rejected for a bad signature or because the endpoint was mid-deploy. | Alert on the callback rejection rate; run a job that queries refunds pending past their threshold. |
| The callback arrived but was not applied | The application log shows the callback was dropped: the ID did not map, it arrived before R-17 was committed, or it was treated as a duplicate. | Send callbacks that cannot be processed yet to a retry queue instead of discarding them. |
| The result was stored but no ledger entry was created | The status table says completed; the ledger has no entry. | Write the state change and the request for a ledger entry in the same transaction (outbox pattern). |
| Only the timing differs | The result arrived after the internal cutoff but before the partner’s cutoff. No log records an error. | Nothing to fix. The item matches in the next period. |
In the example, the request log shows the R-17 instruction leaving the system at 14:16:07 and timing out 30 seconds later; the ingress log has no callback for R-17 all day. Together with the R-17 line on the settlement report, that confirms the first two hypotheses. Why the callback never arrived is still Unknown, and becomes a separate finding with an owner in Engineering.
Query the status before you resend
The settlement report has already recorded R-17, so the first step is to stop every resend, automatic retries included. The second is to ask the partner through its status API: look up R-17, then list every refund on P-17. Reading a status moves no money, so it can be repeated as often as needed. In the example, P-17 has exactly one refund at the partner: R-17, SGD 40, completed. If a status query returns “not found” right after a timeout, that does not prove the partner never received the instruction; it may still be processing.
Resending is safe only when all three conditions hold: the partner supports idempotency keys, the resend uses the same key and the same parameters as the first attempt, and the key is still valid. Airbnb puts the caller’s obligation in one sentence: “Pass in a unique idempotency key for every new request; reuse the same idempotency key for retries.”
The third condition is the one most often missed. Stripe’s API reference says that for API v1, keys can be removed once they are at least 24 hours old, and a request that reuses a key after that is treated as a new request. A refund sent at 14:16 today and “resent to be safe” late tomorrow afternoon can fall outside that window. The partner receives a new and perfectly valid instruction, because two SGD 40 refunds on a SGD 120 payment are ordinary partial refunds. A duplicate is rejected only if the partner requires refund references to be unique, and that should be tested, not assumed.
Check the manual paths first: a resend button in a back-office tool or a script run by hand can easily generate a new key. A retry must reuse the stored key for R-17. A new refund carries a new refund ID and goes through approval from the start.
Completed is not the end
A completed line on the settlement report is evidence of what the partner has recorded. The refund still has a leg to travel through the card scheme and the card issuer, and that leg can fail after the partner has reported success. Stripe writes that “A refund can fail if the customer’s bank or card issuer can’t process it”; the funds then return to Stripe, a process that can take up to 30 days, and Stripe sends a refund.failed event. Adyen has two webhooks for this leg: REFUND_FAILED when the card scheme rejects the refund, and REFUNDED_REVERSED when the money has been returned to Adyen.
The refund’s state machine therefore has to allow a move from completed to failed or reversed, and reconciliation in later periods has to match the returned line to R-17. At that point the money is back but the customer has still not been refunded, so refunding them another way needs an owner.
The operator also confirms to the merchant only what the evidence supports: the date the partner recorded the refund, the timeframe the partner publishes (Stripe gives approximately 5 to 10 business days, depending on the bank), and a reference such as the ARN that the cardholder can use to trace the refund with their bank. Whether the money already shows in the cardholder’s account is outside that evidence.
When to close the exception
The duty supervisor owns the exception. While the two sides record different things, the supervisor keeps the exception open, stores the settlement report and the status query result, and tells the merchant that the refund is awaiting reconciliation.
A confirmed result has to reach the ledger. The preferred path is to feed the status query result through the same state transition the callback would have triggered, so the ledger entry is created like any other refund’s. In the example, the payment service has no such path yet, so Payment Operations raises an adjusting entry that records exactly one SGD 40 refund for R-17:
- It is a new entry that references R-17 and the matching settlement report line. Entries already posted are never edited or deleted.
- It has its own requester and approver, under the same maker-checker rule as the refund itself.
- It sends no payment instruction. The request log shows that after 14:16:07 no other refund instruction for P-17 left the system, under any refund ID.
After reconciliation is rerun for the period, the supervisor closes exception R-17 when all four conditions hold:
- The adjusting entry matches the settlement report line on original payment, refund ID, amount and currency.
- The approval record belongs to this exact refund.
- The rerun shows exactly one SGD 40 refund on P-17 on both sides, with no remaining difference.
- The cause of the pending entry has been identified, or has become a finding with an owner and a review date.
The fourth condition separates closing an exception from solving a problem. If the callback failed because of a fault that is still there, the next refund will repeat this exact situation.
Exception R-17 · SGD 40 refund on payment P-17
Illustrative example — not a customer result- Evidence
- One refund instruction for P-17, at 14:16:07. The status query and the settlement report both show exactly one refund: R-17, SGD 40, completed. The adjusting entry is approved; the reconciliation rerun shows no remaining difference.
- Limits
- The evidence stops at the partner’s record. If the partner reports the refund as returned, a new exception is opened that references this one.
- Decision
- The duty supervisor closes the exception. The merchant is given the date the partner recorded the refund and its reference.
- Next step
- Open finding: the R-17 callback never reached ingress. Owner: Engineering Lead; review with the partner before next week’s reconciliation period.
If a reference or the amount still differs, the supervisor keeps the exception open until the next review.
How would you know?
In the example, the difference surfaced only at the daily cutoff, and for all the hours before it anyone who saw R-17 pending could have resent the instruction. Detection has to come earlier than end-of-day reconciliation:
- The age of the oldest pending refund. Alert on age, not count, with a threshold taken from how long the partner normally takes to return a result.
- Differences in both directions: the partner has a refund the ledger has not recorded, and the ledger shows a refund the partner has no line for, which means the customer has not been refunded.
- The callback rejection rate at ingress, broken down by reason.
- Whether the reconciliation job ran, and how many exceptions have stayed open for more than one period.
Each mechanism in this note is also a claim to test on staging. Cut the response after the partner’s sandbox has accepted the instruction, then deliver the same callback twice: the pass criterion is exactly one refund at the partner and exactly one ledger entry, with the same refund ID and amount. Deliver a failed callback after a completed one: the refund must move to failed, the ledger must carry a reversing entry and a new exception must open. A partner sandbox does not necessarily behave like production, so record that limit with the results.
Questions to ask your team
- After a timeout on a refund instruction, what state is the refund in, and what takes it out of that state without a person?
- Which idempotency key does the resend button in your back-office tool use, and how long does the partner keep that key?
- What does the system do when it receives a failed result for a refund it has already recorded as completed?
- How many hours old is the oldest pending refund right now, and who is told when it crosses the threshold?
- Who can raise an adjusting entry, who approves it, and what evidence does it reference?
References
- Stripe. Refund and cancel payments. Stripe documentation, read 22 November 2026.
- Stripe. Idempotent requests. Stripe API reference, read 22 November 2026.
- Stripe. Receive Stripe events in your webhook endpoint. Stripe documentation, read 22 November 2026.
- Adyen. Refund and Webhook structure and types. Adyen Docs, read 22 November 2026.
- Jon Chew and Ninad Khisti, Airbnb. Avoiding Double Payments in a Distributed Payments System. 16 April 2019.
