DisputeDesk
AI dispute triage for PayPal merchants. Built for the PayPal AI Hackathon ("Build What's Next with PayPal and AI"). The project was created during the submission period.
The problem
Merchants lose money and time on PayPal disputes. Each case means reading the buyer's claim, digging through transaction and shipping data, deciding whether to fight or refund, and writing a reply, all before a response deadline. Many small disputes are refunded without review, and many winnable ones are lost for lack of evidence.
What it does
DisputeDesk is a review-and-approve console. An OpenAI agent investigates each dispute through the PayPal APIs and recommends what to do. The merchant approves, and the app executes the action through PayPal.
- Lists the merchant's disputes (
GET /v1/customer/disputes). - On Run AI triage, the agent decides which tools to call, in a loop:
get_dispute_details: the dispute record, messages and deadline (GET /v1/customer/disputes/{id})get_transaction: payer, shipping and tracking data (GET /v1/reporting/transactions)get_account_dispute_stats: patterns across the account's disputes
- It returns validated, structured output: summary, priority, win probability, fraud signals, recommended action, reasoning, evidence checklist, and drafted evidence notes and buyer message.
- The merchant reviews and edits, then executes one of:
- Contest with evidence:
POST /v1/customer/disputes/{id}/provide-evidence - Message the buyer:
POST /v1/customer/disputes/{id}/send-message - Accept claim (refund):
POST /v1/customer/disputes/{id}/accept-claim
- Contest with evidence:
flowchart LR
UI[React UI] --> API[Express API]
API --> Agent[OpenAI agent<br/>tool calling]
Agent -->|tools| PP[PayPal Disputes +<br/>Transaction Search APIs]
API -->|approved actions| PP
Guardrails
- A human approves every PayPal write; the AI never executes actions itself.
- Server-side cap on accepted claims (
MAX_ACCEPT_AMOUNT) and confirmation prompts for irreversible actions. - Dispute and buyer messages are treated as untrusted data. The sample dispute
PP-D-1004contains a prompt-injection attempt the agent must ignore. - AI output is validated against a schema (Zod) before it reaches the UI.
- Every executed action is logged (in-app and as an
auditJSON log line).


Log in or sign up for Devpost to join the conversation.