Inspiration

Online merchants lose billions each year to payment disputes, and the burden falls hardest on small sellers with no legal or compliance team. When a buyer files an "Item Not Received" claim, the merchant has about 7-10 days to dig through their store backend, carrier portal, and PayPal dashboard, guess what PayPal needs, and write a rebuttal. Miss one tracking scan and the seller loses the funds plus a dispute fee.

We wanted to turn that scramble into a structured, evidence-driven workflow, without handing financial decisions to an AI.

What it does

ResolveAI is a dispute investigation and evidence platform for PayPal merchants:

  • Real-time ingestion: PayPal webhooks (CUSTOMER.DISPUTE.CREATED, UPDATED, RESOLVED, PAYMENT.CAPTURE.COMPLETED) are signature-verified through PayPal's verification API and deduplicated by event ID.
  • Evidence marshaling: the dispute is linked to the original capture, shipping address, and carrier tracking data.
  • AI investigation: Gemini 2.5 Flash, with function-calling tools for transaction, shipping, and order-history lookups, classifies the claim and extracts facts. Output is validated against strict Zod schemas.
  • Evidence Completeness Score (0-100): a deterministic rubric (valid tracking, delivery scan, address match, timely dispatch, signature confirmation over $750) shows merchants what's missing before they submit.
  • Citation-backed drafts: every section of the rebuttal must cite a real record (e.g. a USPS tracking number or PayPal capture ID). Sections without citations fail validation.
  • Human-in-the-loop gate: the AI never submits anything. The backend rejects /submit with HTTP 400 unless an authenticated Merchant/Admin has explicitly approved the draft.
  • Immutable audit trail: every action is logged with user, IP, timestamp, and state snapshot.

How we built it

  • Frontend: Next.js 15, React 19, Tailwind, AG Grid for the disputes console, Three.js for the landing-page hero
  • Backend: Express 5, TypeScript, Node 22, Prisma 7 on PostgreSQL 16, JWT auth with RBAC, Helmet and rate limiting
  • AI: Google Gemini 2.5 Flash via @google/genai, with a deterministic rule-based fallback engine so the app keeps working if the AI is unavailable
  • PayPal: OAuth 2.0, Orders v2, Disputes v1 (list, details, provide-evidence, accept-claim), and webhook signature verification, all against the Sandbox
  • Deployment: API and database on Render, frontend on Vercel, Docker Compose for local development
  • Testing: Vitest and Supertest covering AI schema validation, webhook dedup, the approval gate, and an end-to-end pipeline

Challenges

  • Keeping AI honest. Free-form LLM drafts can invent carrier scans or timestamps. We solved this with structured outputs, mandatory citations, and schema validation instead of relying on prompt instructions alone.
  • Making the approval gate real. A UI button isn't a safeguard. We enforced approval state in the backend so no code path can submit without a recorded human sign-off.
  • Webhook reliability. PayPal retries webhooks, so we needed idempotency via a unique constraint on event IDs plus signature verification before any processing.
  • Graceful degradation. The rule-based fallback guarantees scoring and drafts still work when the AI service is missing or rate-limited.
  • Scope. We kept the project focused on one dispute type done well rather than many done shallowly.

What we learned

Responsible AI in finance is mostly about constraints: grounding, validation, auditability, and clear limits on what the model may do. We also learned a lot about PayPal's dispute lifecycle and Seller Protection requirements.

What's next

Multi-gateway support (Stripe, Adyen, Shopify Payments), live carrier webhooks (FedEx, UPS, USPS), vision-based OCR for delivery photos and signed slips, predictive dispute prevention, and team collaboration workflows.

ResolveAI does not guarantee dispute outcomes. It helps merchants organize evidence and respond accurately and on time.

Built With

Share this project:

Updates

Submission history