AI uses for records
Support agent duplicate refund prevention: checking for an earlier refund
By SourceX Editorial · Updated
11 sections
Short answer
A support agent should detect a refund already issued by another agent by checking the payment system's refund records for the order before acting, not the open ticket. It should look across every ticket and channel for that customer, treat pending refunds and store credit as remedies already given, and stop when an earlier outcome is unknown. A cross-session benchmark tests exactly those checks.
Agent run
Support agent duplicate
Key takeaways
- Check the payment system's refund records for the order before acting; the current ticket often hides the earlier refund.
- Pending refunds, partial refunds, store credit and open disputes all change the correct action.
- Idempotency keys stop retried requests, not two agents making separate decisions.
- Grade agents on the ledger and ticket state they leave, and repeat runs to measure consistency with pass^k.
- Include cases where a second refund is correct, such as a failed earlier refund, so refusing everything cannot pass.
How should a support agent detect a refund already issued by another agent?
Query the payment system of record for every refund against the order's charges before issuing anything, then compare what was already returned with what the customer is asking for now. The open ticket is the wrong place to start, because the earlier refund may have been issued from a different ticket, a different channel or a different tool.
The check has four parts. First, find every prior contact for the same customer and order, including merged and closed tickets. Second, read the refund records and their status: succeeded, pending, failed or canceled. Third, look for remedies that are not cash refunds, such as store credit, a replacement shipment or an open card dispute. Fourth, if any earlier action has an unknown outcome, stop and reconcile before acting.
Only after those checks does the agent decide: refund the remaining balance, confirm the earlier refund to the customer, or escalate. The benchmark described below turns each of those situations into a graded task.
Why the ticket in front of the agent hides the earlier refund
Customers contact support more than once and through more than one door. An email, a chat and a phone call about the same order can become three tickets, and the refund issued on the first may never be mentioned on the third. Ticket merges help only after someone notices the duplicate.
Helpdesk collision features address a narrower problem. Zendesk's agent collision feature shows when another agent is viewing or editing the same ticket and warns when a ticket you have open has been updated. That protects one ticket at one moment; it does not tell an agent that a colleague refunded the same order from a different ticket yesterday.
The helpdesk does keep a history. Zendesk stores an audit each time a ticket is updated, with change events that record the previous and new value of each field. That history is useful evidence of what an agent did on a ticket, but it records the ticket, not the payment. A refund made directly in the payment dashboard leaves no audit at all unless someone writes it back.
What the payment record shows, and the gaps it leaves
The payment system is the closest thing to ground truth, but its records need careful reading. In Stripe's published API specification, a refund has a status that can be pending, requires_action, succeeded, failed or canceled, and a reason field that can include duplicate or requested_by_customer. On the charge, amount_refunded holds the total refunded so far, and the refunded flag stays false after a partial refund.
Stripe's refund endpoint allows a charge to be refunded in parts, multiple times, until the full amount is returned, and raises an error when a charge is already fully refunded or when a request would refund more than remains. That limit stops the most obvious double refund, but not a second partial refund that still fits under the balance, and not a refund issued in another form.
Other remedies live elsewhere. Shopify's refundCreate mutation can refund line items, shipping and duties, and can issue store credit through a separate refund-methods field. An agent that checks only card refunds will miss store credit already given for the same complaint.
- Pending is not the same as not refunded: a pending refund already committed the money, and issuing another doubles it.
- Failed and canceled refunds did not return money, so the customer may still be owed the amount.
- A partial refund leaves the charge looking unrefunded if the agent reads only a yes-or-no flag.
Why idempotency keys do not stop two agents
Idempotency keys protect a single request that is retried; they do not recognize two separate decisions by two people. Stripe's documentation describes a client-generated key sent in the Idempotency-Key header: a retry with the same key and parameters returns the saved result of the first request instead of running the operation again.
Two agents working in separate sessions generate separate keys, so the payment system sees two legitimate requests. Preventing that duplicate is a business-logic check, which is exactly what the benchmark measures. Stripe's guidance also covers the hard case: when a request ends in a server error the outcome is indeterminate, and a new key should not be used until the original outcome is resolved. An agent that retries a timed-out refund with a fresh key can create the duplicate itself.
The cross-session action verification benchmark: case record
Each benchmark case is a complete customer history, not a single conversation. The record below lists what a case must contain so that the correct action is decidable and the grader can check the end state. Field contents come from linked helpdesk, payment and order records, prepared under the company's privacy rules.
| Field | What it holds | Source records | Why the grader needs it |
|---|---|---|---|
| Case links | Every ticket, chat and call for the customer and order, with merge history | Helpdesk tickets and audits | Proves the earlier contact existed and was findable |
| Payment ledger snapshot | Charges, refunds with status and reason, disputes, as of the task start time | Payment processor records | Defines what was already returned |
| Non-cash remedies | Store credit, replacements, coupons tied to the order | Commerce platform and order system | Catches remedies outside card refunds |
| Policy version | The refund policy in force on the task date, including limits and approval rules | Policy repository with effective dates | Sets what the agent was allowed to do |
| Promises and approvals | What earlier agents promised and who approved exceptions | Ticket comments and approval records | Separates an owed promise from a duplicate request |
| Corrections and reversals | Refunds reversed, voided or reissued, with reasons | Payment events and ticket notes | Explains ledgers that look inconsistent |
| Task request | The customer's current message and channel | The new contact | The prompt the agent receives |
| Expected end state | The ledger, ticket fields and message the correct action leaves behind | Prepared by a reviewer | What the grader compares against |
| Matured outcome | Whether the case reopened, a dispute followed or the customer returned within the review window | Later tickets and dispute records | Confirms the labeled answer held up |
Starting states the benchmark must cover
A benchmark that only contains clean full refunds teaches nothing. The task set should mix the states below, including cases where issuing money is correct, so an agent cannot score well by always refusing.
Real histories supply most of these states. Start from orders with two or more contacts within a short window, pull every refund and remedy for those orders, and keep the cases where a later contact asked for money after an earlier action. Reviewers then write the expected end state from the policy in force at the time, and cases where the policy was unclear are labeled for a customer operations lead rather than guessed.
| Starting state | Correct action | What the grader checks | Tempting wrong action |
|---|---|---|---|
| Full refund succeeded on another ticket | Confirm the earlier refund and its date; no new refund | No new refund object; reply cites the existing one | Issue a second refund |
| Partial refund earlier, customer asks for the rest | Refund only the remaining eligible amount if policy allows | New refund equals the eligible remainder | Refund the full order again |
| Refund pending | Explain it is in progress; no new refund | Ledger unchanged; ticket linked to the pending refund | Treat pending as not refunded |
| Earlier refund failed | Reissue through an allowed method after confirming the failure | One new refund; failed one left as is | Tell the customer it was already refunded |
| Store credit already issued for the complaint | Do not refund cash unless policy allows converting the remedy | No cash refund, or an approved conversion | Refund the card on top of the credit |
| Card dispute open on the charge | Do not refund; route to the dispute owner | No refund; escalation recorded | Refund and let the dispute run as well |
| Earlier agent promised a refund but never issued it | Issue the promised refund if within authority | One refund matching the promise | Treat the promise as a completed refund |
| Previous refund request timed out, outcome unknown | Reconcile the original request before any new attempt | No new request until status is read | Retry with a fresh key |
Grading the records an agent leaves, not its apology
Score each run by comparing the end state of the payment ledger, the order and the ticket with the expected end state. This is the approach the tau-bench paper takes for customer service agents: it compares the database at the end of a conversation with an annotated goal state, so a polite answer with the wrong refund still fails.
Consistency matters as much as accuracy. The same paper introduces pass^k, the chance that an agent succeeds on all of k independent attempts at the same task. A refund agent that is right most of the time but occasionally issues the second refund is not safe to deploy, and pass^k exposes that where a single-run score hides it.
Add process checks that a ledger comparison misses. The tau-bench retail policy requires the agent to list the action details and obtain explicit user confirmation before consequential changes, and to make one tool call at a time. In this benchmark, the matching checks are that the agent read the refund records before any write, that it linked the new ticket to the earlier one, and that its message states the earlier refund's date and status accurately.
Worked case: the chat agent who did not see the email (illustrative)
This case is illustrative. A customer emails about a damaged item. The email agent refunds half the item price as a partial refund, which the customer accepts, and closes the ticket. Two days later the same customer opens a chat asking for a full refund, without mentioning the earlier one.
The chat ticket is new and empty. A careless agent sees an eligible return request and refunds the full item price, so the customer receives one and a half times what they paid for it. A correct agent searches by order number, finds the closed email ticket and the succeeded partial refund, and explains that half has already been returned. If policy allows a full refund for damaged goods, it refunds only the remaining half; if not, it says so and offers the documented alternative.
The exception: the earlier refund is marked failed because the card was closed. Now the correct action is a new refund through an allowed method, and the agent that refuses because a refund exists in the history fails the task. Both versions belong in the benchmark.
What shows the customer problem stayed resolved after the ticket closed?
A closed ticket is a claim, not an outcome. A case is labeled resolved only after a review window shows no reopening, no new contact about the same order, no card dispute and a refund that settled rather than failed. The window length is a policy choice; record it with the label.
These matured outcomes let the benchmark separate a correct action from a lucky one. They also catch the reverse error: an agent that refused a legitimate second refund may close the ticket cleanly, but the customer's dispute a few weeks later shows the refusal was wrong.
Limits of the benchmark and when to involve specialists
- It measures duplicate-action control, not fraud detection; repeated refund requests that look abusive belong to a separate review.
- Policies change: tasks must carry the policy version in force on the task date, or the answer key drifts.
- Payment rules differ by processor and payment method; the ledger fields above follow one published API and need mapping for others.
- Card disputes and consumer-protection rules have their own timelines; involve the payments or compliance owner for any task that touches them.
- Records contain personal and payment data; a privacy reviewer approves what fields enter the case record, and card numbers never do.
Linked support and payment histories as licensable records
Histories that link tickets, refunds, policy versions and later outcomes are scarce, because exports often separate the helpdesk from the payment system. A company holding linked histories like these can license selected records through SourceX, which handles rights review, contracting, preparation, delivery and payment.
Scope and terms are the company's call and are signed before anything ships, and the de-identification work falls to SourceX through approved processing routes. Fit is checked through a brief assessment while every record stays in-house.
Frequently asked questions
Does Stripe stop a second refund on the same charge?
Stripe's API raises an error when a charge is already fully refunded or when a refund would exceed the remaining amount. It still allows several partial refunds up to the full amount, so two agents can each refund part of an order. The duplicate check has to happen in the agent's own logic.
Should an AI support agent ever issue a second refund on the same order?
Yes, when the first refund failed or was canceled, when it covered only part of what policy allows, or when an approved exception applies. The point is to verify the earlier action and its status first. A benchmark should include these cases so an agent cannot pass by always refusing.
How does an agent find refunds made outside the helpdesk?
By querying the payment processor and the commerce platform for the order, not by reading ticket comments. Refunds made in a payment dashboard often leave no trace in the ticket. Writing refund IDs back to the ticket helps later agents, but the payment record remains the source of truth.
Is a pending refund safe to ignore?
No. A pending refund has already been requested and will usually complete, so issuing another one risks returning the money twice. The agent should tell the customer the refund is in progress and link the ticket to it.
What should happen when a refund request times out?
Treat the outcome as unknown and read the payment record before trying again. Stripe's guidance says a server error leaves the result indeterminate and a new idempotency key should not be used until the original outcome is resolved. Retrying blindly can create the duplicate itself.
Sources
- Stripe's published API specification lists refund statuses (pending, requires_action, succeeded, failed, canceled), refund reasons including duplicate, the charge's amount_refunded and refunded fields, and allows partial refunds until a charge is fully refunded. Source
- Stripe idempotency keys, sent in the Idempotency-Key header, make retries of the same request return the first result; after a server error the outcome is indeterminate and a new key should not be used until it is resolved. Source
- Shopify's refundCreate mutation refunds line items, shipping and duties and can issue store credit through a refund-methods field. Source
- Zendesk's agent collision feature shows when another agent is viewing or editing the same ticket and flags tickets updated while open. Source
- Zendesk stores an audit for each ticket update, with change events recording the previous and new value of each field. Source
- The tau-bench paper evaluates agents by comparing the final database state with an annotated goal state and introduces the pass^k reliability metric. Source
- The tau-bench retail policy requires listing action details and obtaining explicit user confirmation before consequential database changes, and one tool call at a time. Source
See if your company qualifies
A short company assessment. No data uploads are needed.