Inspiration
Small online shops need to understand a buyer's dispute, payment, order and tracking before deciding how to respond. Dispute Desk turns that scattered context into a reviewable case file and a practical next step, while keeping the merchant in control.
What it does
A deadline-sorted queue helps merchants find cases needing a reply. Search and filters make it easy to focus on a particular order or status. Each case presents numbered PayPal facts and buyer messages next to an AI suggestion.
The merchant can inspect citations and exact source excerpts, edit the reply or refund amount, and approve a supported response: reply to the buyer, offer a partial refund, submit tracking evidence, or accept and refund. Every approved request is recorded in the action history.
How I built it
The application uses Next.js, React, TypeScript and Tailwind, with AG Grid for the dispute queue and Prisma/PostgreSQL for persistence. PayPal's OAuth, Disputes, Payments, Orders and webhook-signature APIs are central to the workflow.
Google Gemini generates structured suggestions through the Vercel AI SDK. Zod and additional code check citation IDs, exact source excerpts, allowed actions, tracking and refund amounts. Each recommendation retains an immutable evidence snapshot. Before sending, the app checks current PayPal evidence again.
Database locks serialize approvals per dispute. If a dispatched request's result cannot be confirmed, the app blocks resending pending investigation. Webhooks use atomic insertion and processing leases to handle overlapping deliveries.
Challenges I ran into
A valid citation does not automatically make an AI inference correct. Source excerpts and direct navigation help the merchant examine the reasoning, but human review remains necessary.
Another challenge was handling a lost API response without repeating a potentially completed action. The app distinguishes confirmed failures from unconfirmed outcomes. Database integration tests also uncovered concurrency behavior that unit tests alone did not catch.
Accomplishments
The app is deployed with an open-source repository and automated checks. The verification suite covers exact refund amounts, stale evidence, concurrent approvals, uncertain outcomes and duplicate webhook deliveries. A separate, clearly labeled sample preview works without service credentials.
What I learned
This project provided significant learning in connecting AI suggestions to verifiable data, integrating PayPal's dispute lifecycle, and testing failure paths. ChatGPT, Claude and Codex assisted development. The practical lesson was to pair useful AI output with inspectable evidence, explicit approval and reliable records.
What's next
The demonstration video and gallery use synthetic cases and authored sample suggestions for privacy. They show the review interface, not live AI generation or API dispatch. Gemini was separately checked using fabricated evidence, and a neutral merchant-authored message was separately verified through the deployed PayPal sandbox approval flow.
The current project is a single-merchant PayPal sandbox demonstration. Next steps include separate merchant accounts, stronger identity management, broader evidence types and guided reconciliation of uncertain requests. No production-readiness or measured dispute-win-rate claim is made.
Built With
- ag-grid
- gemini
- neon
- next.js
- paypal
- postgresql
- prisma
- react
- tailwindcss
- typescript
- vercel
- zod