Inspiration: Small PayPal sellers have no dispute team. DisputeDesk is one

Most AI-commerce ideas stop at checkout: an agent that finds something and buys it. We looked at what happens after the sale, where small sellers struggle most: disputes.

Who it's for: small online stores that ship physical goods and get paid through PayPal. One to five people. Nobody whose job is disputes.

Take Kevin, the kind of seller we built this for. He runs a two-person used camera shop online, and his buyers pay with PayPal. One morning a buyer opens a PayPal dispute on a $640 lens: "never arrived."

Kevin shipped it, and he can prove it. But the strongest proof, the carrier's signature record, takes about four hours to request, and his response is due at noon. If he misses it, the case closes in the buyer's favor, even though he did nothing wrong.

PayPal already gives sellers what they need to defend a sale: a clear dispute process, Seller Protection and a Disputes API. What a small shop doesn't have is the time and people to use them:

  • Disputes arrive several at a time, each with its own deadline.
  • The proof is in four places: carrier tracking, signature requests, buyer chats and listing photos. Some of it takes hours to get.
  • The same people who pack orders have to build the cases, so they work on the wrong case first, refund cases they would have won, or miss a deadline.

Big merchants have dispute teams. Kevin has Maya, who also packs every order.

DisputeDesk gives every small PayPal seller an AI dispute team: an agent that works PayPal disputes on the seller's behalf, within limits the seller sets.

What it does

  1. A PayPal dispute arrives. A verified PayPal webhook wakes the agent automatically, with no button to press.
  2. The agent decides: fight, refund or concede, with a win chance and the one fact behind it ("carrier shows delivered yesterday, driver photo available").
  3. It plans the work: get proof → write the evidence → submit to PayPal, with each step given to a person and a time before the deadline.
  4. If the plan would miss the deadline, it fixes it. It switches to faster proof (the driver's delivery photo instead of a four-hour signature request), splits the writing and gives half to Maya. In the demo, a $640 case goes from 3h 45m late to on track to finish 45 minutes early, in about 9 seconds.
  5. It acts through PayPal for the seller. It sends refund offers or accepts claims on small cases by itself, up to a limit the seller sets ($50 in the demo). Evidence and anything above the limit wait for the seller's Approve & send.
  6. The seller sees and steers everything: every dispute on one timeline with its deadline marked, dollars at risk versus on track, and a log explaining every step. They can type "Maya is away 13:00 to 15:30" and the plan moves around her, or drag any step and the agent re-plans the rest.

This is agentic commerce after checkout: an AI agent that makes money decisions through PayPal's APIs for a seller, with limits enforced in code.

How we built it

Part Its job How
PayPal Where the agent acts OAuth; the Disputes API (GET /v1/customer/disputes loads sandbox disputes at startup; make-offer, accept-claim and provide-evidence are the agent's write tools); webhook signature verification (CUSTOMER.DISPUTE.CREATED / UPDATED start the agent, unverified deliveries are ignored); the Orders v2 API through the PayPal Server SDK for a sandbox checkout page.
Gemini (gemini-3.8-flash) Decides what to do and why Function calling. Every action is a tool call (setDecision, swapEvidenceSource, splitBlock, assignDispute, moveBlock, setAvailability, flagForHuman, makeRefundOffer, acceptClaim, provideEvidence), streamed live to the screen.
Bryntum Gantt engine Checks that the plan is possible Runs on the server with working hours, step dependencies, each person's time away and each PayPal deadline. If a move would miss a deadline, it refuses, and its message goes back to Gemini to fix. In the browser, a Bryntum Gantt (one row per dispute) and a Scheduler Pro (one row per person) share one project.

Before scheduling, a simple rule decides which case each person works on first:

$$\text{priority} = \text{amount} \times \text{chance of winning} \times \frac{1}{\max(1,\ \text{hours left})}$$

Guardrails: the dollar limit, a never-concede limit and the evidence approval gate are enforced in code, not in the prompt. Gemini can never place work after a deadline, and an agent run that would leave an on-time case late is undone.

What's real: Gemini calls, PayPal OAuth, loading sandbox disputes, webhook verification and every engine calculation. What's simulated: the demo disputes and the "Simulate a dispute" button. Both are labeled in the app, and actions on them say "no PayPal call was made".

Stack: Next.js 16, TypeScript, deployed on Render. Built in one day: 11 commits, 28 unit tests, and a browser test of the full demo that passed 3 of 3 runs with live Gemini.

Challenges we ran into

  • The AI saved one case by breaking another. Rescuing the $640 case could push a $289 case 15 minutes past its deadline. Now the engine warns the agent ("this pushes D-4821 15m past its deadline; repair that"), and a run that still ends with a new late case is undone.
  • My first version used Bryntum only as a display. I'd written my own planner, so the chart just drew results. I replaced it with the Bryntum engine itself, so a missed deadline became a real error the AI has to deal with.
  • Waiting is not working. I first treated "waiting four hours for the carrier" as four hours of someone's work. Modeling it as waiting time freed people up and made the plans realistic.
  • The Bryntum engine is built for browsers. Importing it on the server failed. I load it inside a temporary fake browser environment, then remove it. It now calculates a plan in about 14 ms.
  • The PayPal sandbox had no disputes, and card payments were blocked (PAYEE_NOT_ENABLED_FOR_CARD_PROCESSING). I built a checkout page where a sandbox buyer pays by logging in and can then open a real dispute.
  • Build and UI problems: the production build ran out of memory on an 8 GB laptop (fixed by switching bundlers), and the chart reset itself on every render (fixed by keeping its settings constant).

Accomplishments that we're proud of

  • An agent that acts on money, safely. Gemini decides, the engine checks the timing, and code enforces the money limits. That's the split I'd want before letting any AI act through PayPal for a seller.
  • You can watch the rescue happen. Red to green, $640 at risk to $0, in about 9 seconds, with a reason for every step.
  • It's honest. Every case shows where it came from, and the app never claims a PayPal action happened when it didn't.
  • Plain English changes the plan. "Maya is out from 11 to 3" becomes a real change to the schedule, not just a chat reply.

What we learned

  • AI is good at deciding what and why. It's unreliable at when. Give time and deadlines to a scheduling engine, send its errors back to the AI, and the AI corrects itself.
  • Agentic commerce needs limits in code. Prompts are suggestions; a dollar limit in the tool layer is a rule.
  • Small sellers don't need more dashboards. They need someone to do the next step.
  • Test the real APIs before building. Small check scripts for Gemini and PayPal saved me from coding against APIs I only half remembered.

What's next for DisputeDesk

  • The full live loop: a sandbox buyer files a dispute, and the agent sends a real PayPal refund offer within the limits.
  • Photo checks: for "not as described" cases, Gemini compares the buyer's photo, the listing photo and the delivery photo.
  • Before a dispute is filed: flag orders with stuck tracking or an unhappy message, and reach out to the buyer first.
  • Built for platforms: every record already carries a merchant ID, so a marketplace could give all of its PayPal sellers a dispute team.

Built With

  • bryntum-gantt
  • bryntum-scheduler-pro
  • gemini
  • next.js
  • paypal-disputes-api
  • paypal-orders-api
  • paypal-server-sdk
  • paypal-webhooks
  • render
  • typescript
Share this project:

Updates

Submission history