Inspiration

A dispute costs a small seller twice: the money, and the evening spent finding the order, the invoice and the tracking number before a deadline nobody announced. Most of that work is reading and writing, and the decision belongs to the seller.

What it does

Take a dispute filed as "item not received" for USD 84.50. Dispute Desk pulls the dispute, the captured payment, the order, the invoice, the tracking and any refund. The buyer writes that nothing ever arrived. Claude reads that story and compares it with the records; where tracking says delivered, it flags the conflict and quotes both sides. The rules then score the file check by check (85% estimated chance of winning in the demo; demo: stub), and the screen prints the arithmetic: 84.50 x 85% - 10.00 (20 min at 30/h) - 0.00 fee = 61.83, against -2.50 for accepting (5 min). Contesting is worth +64.33 more. Minutes per reason, hourly rate and fee are seller settings. Claude then drafts the response for the Resolution Center, citing only records that exist, with the list of documents to attach.

In the offline demo this contradiction is found by the deterministic stub (demo: stub). With Claude connected (claude-sonnet-5-5), the same reading ran on three real sandbox disputes opened from a test buyer account. On the camera case ("not as described", EUR 310), Claude matched the buyer's complaint about marks on the casing with the invoice line "grade B, visible wear", and the draft cites that line. The last shot of the video shows this draft on the sandbox.

On screen, every block of text names its author (the model or the stub), a badge at the top says which PayPal is connected (sandbox or local stand-in), and the arithmetic line sits under the checklist.

For every dispute awaiting a response the desk also shows a deadline calendar, most pressing first. An unreadable record is shown as a gap, never skipped.

What the AI does, and what it does not

This split is deliberate and visible in the interface.

Claude (Anthropic Messages API) does the language work, with no tools:

  • reads the buyer's free-text story: classifies it, summarises it, lists contradictions with the PayPal records;
  • drafts the response text.

Deterministic rules do the numbers: the evidence checklist per dispute reason, the chance of winning and the contest-or-accept recommendation are pure functions of the case file. The model cannot change them, and it cannot call PayPal. We chose this so a hostile buyer message cannot move the money, and so every figure can be explained. The model's reading appears beside the score and feeds the draft only. The chances of winning are heuristics we wrote, not PayPal statistics, and are not calibrated on real outcomes.

If the API fails, a deterministic stub (keyword rules and templates, not a language model) answers instead, and every text names its source. A contract test checks the format of the model's reply.

Real model runs on 3 November 2026: claude-sonnet-5-5, two demo disputes, then three sandbox disputes. Each time it classified the story, listed the contradiction with the records and wrote a draft that quotes amounts and record IDs. In the two demo runs the reply was valid JSON and the stub fallback was not used.

How we built it

TypeScript on Node 22, no runtime dependency; plain HTML, CSS and ES modules.

PayPal. One gateway interface, three implementations: direct REST calls to the sandbox (disputes, captures, refunds, Orders v2, Invoicing v2, shipment tracking); the PayPal MCP server (@paypal/mcp, the PayPal Agent Toolkit tools); and a local fake PayPal for the offline demo and tests. The agent is typed against a read-only interface; the two write calls, accept claim and refund, exist only behind the confirmation step.

Accepting a claim or refunding needs a name and the dispute ID typed by hand, valid once for ten minutes, and is written to a hash-chained journal. The amount owed is read again from PayPal when the action runs, and a refund cannot exceed it.

Sandbox run, 3 November 2026: four test orders paid by a sandbox buyer, three disputes opened by that buyer in the Resolution Center (not received with tracking, not received without, not as described). All three were read in REST and MCP mode (@paypal/mcp 1.8.1). One claim was accepted through the confirmation step and PayPal marked it RESOLVED; partial refunds went through by REST (EUR 10) and by the MCP create_refund tool (EUR 15).

Challenges we ran into

  • The gateways were written from PayPal's documentation before any sandbox access; each assumption is marked UNVERIFIED-SANDBOX in the code. The first sandbox run found four real defects: PayPal lists the dispute hold as a PENDING refund on the order, and we counted it as money already returned; the invoice search returns a summary without line items; MCP failures arrive as {"ok":false} in a normal result and were read as empty lists; npx did not start on Windows without a shell. All four are fixed and tested.
  • The Agent Toolkit has no tool to submit evidence, so contesting means pasting the draft by hand.
  • The confirmation step is an explicit, journaled confirmation for a single-user local tool. It is not proof of human presence: a local script could send the same requests.

Accomplishments

96 automated tests, including one that runs the agent over every demo dispute and asserts the fake PayPal received no state-changing request. The README lists what was verified and what was not. Still unverified on the sandbox: paging past the first page, refunding a capture under dispute, accepting after a partial refund (the desk refuses it until checked), accepting through the MCP tool, zero-decimal currencies, the dispute fee.

What we learned

Numbers from rules, words from the model: the split keeps the recommendation explainable and limits what a buyer's text can change. It also means the AI's contribution is reading and writing, not judgment, and we say so.

What's next

Calibrating the weights on real outcomes from consenting sellers; evidence submission if an API allows it; a login (today the server binds to localhost); currency conversion.

AI disclosure

This project was conceived and written by Claude, an AI model made by Anthropic, for a private individual in France who is the sole entrant. The code, tests, demo data, README, this text and the video were produced by Claude; none is hand-written, and no human reviewed the code line by line. The entrant set up the accounts and was present for the sandbox run. At run time, texts in the interface come from Claude or from the deterministic stub, each labelled. Demo buyers, disputes and amounts are invented. The video is silent, with English subtitles written by Claude; no voice, synthetic or human.

Links

Built With

Share this project:

Updates

Submission history