Judging criteria at a glance

In short. Dispute Desk is for small PayPal sellers who receive a dispute. The seller must gather the payment, the order and the shipping record and answer before a deadline. The desk reads those records through PayPal's APIs, decides whether to fight, accept or offer, and drafts a reply in which every sentence names its record. Nothing is filed until the seller approves. Granite 4.0 H Micro on Cloudflare Workers AI picks the facts. Code decides the verdict.

Technological Implementation. PayPal Disputes, Orders, Payments, Shipment Tracking and verified Webhooks. The desk files evidence, accepts a claim with a refund, or makes an offer, when PayPal offers that action on the case. AI: Granite 4.0 H Micro on Cloudflare Workers AI suggests records to read and picks facts by id. Code decides the verdict and writes every sentence from known records. Check it: src/paypal.ts, src/file.ts, src/webhooks.ts, src/rules.ts, src/sentence-facts.ts.

Design. Each case shows the facts used, the records not found, any disagreements and what would change the verdict. Nothing is filed until the seller approves. AG Grid, AG Charts and AG Studio show open amounts, deadlines and evidence readiness. Check it: web/src/components/CasePanel.tsx, web/src/components/DisputeGrid.tsx.

Potential Impact. For small PayPal sellers who must gather the payment, the order and the shipping record before a dispute deadline. On 55 live sandbox analyses the desk read a median of 4 records in a median of 1.7 seconds.

Innovation/Idea. Every sentence in the reply names its source record, and the evidence pack PDF links each sentence to a lettered exhibit. "One changed fact" lets you change one fact on a case and watch the verdict and the draft move. Without the desk, a seller copies order and tracking details into the reply by hand, and nothing links a sentence to its record. Check it: src/pack.ts, web/src/proof/DecisionExplorer.tsx.

Presentation. The video runs 2 minutes 17 seconds. Judges get their own live sandbox dispute cases at https://dispute-desk.midknight-labs.workers.dev. The proof page matches the desk's own rules on all 41 labelled cases. Video guide: 0:12 a delivered order, so the desk fights; 0:21 tap any line to see its record; 0:41 one tap files it with PayPal; 0:51 a download with no delivery record is accepted and refunded; 1:39 a sentence the record does not back is struck; 1:46 tracking goes on PayPal before any dispute; 1:58 AG Studio builds a chart from words.

Inspiration

A small seller answering a PayPal dispute has to gather the payment, the order and the shipping record before a deadline, then write a reply that matches them. We wanted those records beside the reply, so the seller can see what supports each sentence before anything is filed.

What it does

Dispute Desk receives PayPal dispute webhooks and shows each case with its amount and response deadline. Everything runs against the PayPal sandbox.

When the seller taps Analyse, the desk reads the dispute and the payment. The model suggests which other records to fetch, and code adds the reads the buyer's reason needs.

Code decides the verdict: fight, accept and refund, offer half back, or review. For supported USD cases, delivery before an item not received claim supports fighting. A case under $10 with no delivery record is accepted. Other supported cases offer half back. A failed PayPal read, a payment smaller than the dispute or in another currency, a payment already refunded or reversed, a currency other than USD, or an unsupported reason stops at review, and nothing can be filed. Other disagreements, such as PayPal tracking that says shipped while the seller's record says delivered, are shown on the case but do not stop it. The $10 line and the half back offer are this desk's own settings, not PayPal rules, and the case panel and the evidence pack say so.

Each newly analysed case shows the facts used, the records that were not found, any disagreements, and what would change the verdict.

The model picks which recorded facts to use. Code writes every sentence from those facts. Each sentence names its source: a PayPal record or the seller's own shipping record. The desk does not ask the carrier, so a delivery time from the seller's record is shown as the seller's record. The evidence pack PDF numbers each sentence and links it to a lettered exhibit.

The seller reads the draft and approves. Before filing, the desk checks the draft version and the current PayPal dispute facts. At the claim stage the evidence pack goes with the evidence, and if the pack cannot be built the dispute response is not filed. A filing PayPal has not confirmed stays pending until it is.

On the proof page, One changed fact lets you change one fact on a sample case, such as moving delivery after the claim or making the tracking read fail, and see the verdict, the reason and the draft change beside the original. Nothing is filed and no model is called.

The Studio view also helps before a dispute. A shipped sale without tracking on PayPal two days after payment is marked late, and Add tracking puts the seller's tracking on the PayPal order.

How we built it

Cloudflare Workers serves the app and API. D1 stores disputes, events, shipping records, the judge pool and usage limits. React draws the interface.

PayPal Orders, Payments, Shipment Tracking, Disputes and Webhooks connect the sale to the response. The desk files evidence, accepts a claim with a refund, or makes an offer, when PayPal offers that action on the case.

Granite 4.0 H Micro runs on Cloudflare Workers AI. It suggests records to read and picks facts by id. Code decides the verdict and writes the response. Model prose and unknown fact ids are dropped. An unreadable pick gets one retry, then code picks the facts. When the free model budget is used up, fixed wording is written from the records.

AG Grid and AG Charts draw the case table and charts. AG Studio brings together the open dispute amount, tracking, evidence readiness, deadlines and the checked draft. Its AI Assistant takes questions such as "open dispute amount by stage"; the app checks the chart request and works out the values from stored records.

Webhooks are verified before storage, and each event id is stored once.

Judges get their own live sandbox cases. Before handing one out, the desk asks PayPal whether it is still open, whether its response deadline is more than a day away, and whether it offers the filing action the case needs; stale cases are retired.

Challenges we ran into

PayPal's available actions change as a dispute moves through its stages, so the desk reads the current actions before filing and before handing a case to a judge.

The sandbox rejected an evidence PDF at the inquiry stage while it took the same evidence without the file. The desk keeps the pack to download and attaches it at the claim stage.

Model replies were the other challenge. We moved to fact picking, with code writing the response from known records. That also gives the desk a fallback when a pick cannot be read or the model budget is used up.

Accomplishments that we're proud of

The app connects real PayPal sandbox disputes to analysis, seller approval and filing.

The proof page matches this desk's rules on all 41 labelled cases and strikes all 21 altered sentences, with no model call. These are checks of the rules we wrote, not real merchant outcomes.

One changed fact makes the reasoning visible: change one fact, see what moves.

On 55 live sandbox analyses the desk read a median of 4 records in a median of 1.7 seconds of PayPal reads. We have not timed sellers doing the same task by hand yet; the tool and five sample cases for that study are in the repo.

What we learned

A response needs both supporting records and a clear account of how those records change the decision. The interface also has to show missing evidence and disagreements; a review verdict gives the seller a clear place to stop.

What's next

A timed study with sellers, using the tool in the repo. Broader sandbox testing of state changes and interrupted filings. More currencies and dispute reasons.

Built With

  • ag-charts
  • ag-grid
  • ag-studio
  • cloudflare-d1
  • cloudflare-workers
  • cloudflare-workers-ai
  • granite-4.0-h-micro
  • paypal
  • paypal-disputes-api
  • paypal-orders-api
  • paypal-payments-api
  • paypal-shipment-tracking
  • paypal-webhooks
  • react
  • typescript
Share this project:

Updates

Submission history