-
-
Dispute Command Center featuring AG Grid SSRM with real-time dispute ingestion, status filtering, and financial risk KPIs.
-
End-to-end architecture: PayPal Webhook Ingestion, MCP Agent Reasoning, Elasticsearch Vector RAG, and AG Grid Command Center.
-
DisputeShield AI: Autonomous multi-agent defense system protecting merchants against fraudulent PayPal disputes in real time.
-
Interactive review drawer for human oversight with inline rebuttal editing and 1-Click PayPal API dispute dispatch.
-
AG Grid Master-Detail view with 3-column verification matrix displaying carrier telematics and matched order documentation.
-
Predictive dispute risk telemetry with radial limitation gauge tracking portfolio rates against PayPal's 1.5% threshold.
-
Real-time agent reasoning stream executing MCP tools, evaluating PayPal seller policies, and computing win confidence.
Inspiration
Online merchants face a systemic, multi-billion-dollar crisis: 43% of PayPal disputes are lost not because the seller was wrong, but simply because they ran out of time before PayPal's strict 10-day evidence deadline expired.
When a customer files an unauthorized transaction claim or "Item Not Received" (INR) dispute, a merchant has to manually locate:
- Proof of delivery and final-mile carrier tracking from FedEx, UPS, or USPS.
- Invoices, order metadata, and customer support correspondence.
- PayPal transaction authorization tokens, device hashes, and checkout logs.
For high-volume merchants, human risk teams spend 35 to 45 minutes per dispute manually stitching spreadsheets and PDFs. By the time they verify tracking, the statutory window closes—triggering automatic chargeback losses, forfeit inventory, dispute fees, and rolling reserve holds.
We asked: What if an autonomous AI agent could intercept dispute webhooks in milliseconds, query carrier APIs via the Model Context Protocol (MCP), verify PayPal Seller Protection policies in real-time, compute a deterministic win-confidence score, and submit an airtight rebuttal before the merchant even finishes their morning coffee?
That is DisputeShield AI.
What it does
DisputeShield AI turns dispute defense from a panicked, manual scramble into an automated, real-time revenue protection shield:
- Sub-200ms Webhook Ingestion & Signature Verification:
- Ingests PayPal
CUSTOMER.DISPUTE.CREATEDwebhooks with asymmetric cryptographic verification (X-PAYPAL-SIGNATUREwith CRC32/SHA256 and certificate validation).
- Ingests PayPal
- Autonomous Multi-Agent Investigation via MCP:
- The LangChain dispute agent coordinates specialized sub-tools via the Model Context Protocol (
@paypal/mcp) to gather cross-platform evidence:- Carrier telematics with GPS geofence delivery proof (e.g. zip code 90210 match).
- Order invoices and customer messaging history.
- Prior refund records and PayPal dispute history.
- The LangChain dispute agent coordinates specialized sub-tools via the Model Context Protocol (
- Deterministic & Calibrated Confidence Scoring:
- Evaluates evidence completeness across 5 key dimensions:
- Confidence ≥ 80% (Auto-Submit Mode): Automatically formats the structured legal rebuttal, signs the cryptographic checksum, and submits evidence directly to the PayPal Dispute Resolution API (
POST /v1/customer/disputes/{id}/provide-evidence) in under 12 seconds. - Confidence 60–79% (Human-in-the-Loop Mode): Stages an interactive defense draft in the merchant master-detail drawer, allowing the seller to edit the statement and submit with 1-Click approval.
- Confidence < 60% (Escalate Mode): Flags critical gaps (missing tracking, signature threshold) for human review.
- Confidence ≥ 80% (Auto-Submit Mode): Automatically formats the structured legal rebuttal, signs the cryptographic checksum, and submits evidence directly to the PayPal Dispute Resolution API (
- Evaluates evidence completeness across 5 key dimensions:
- 1536-Dimensional Vector RAG Precedent Engine:
- Queries dense embeddings in Elasticsearch across 32 historical winning cases to cite applicable clauses of PayPal Seller Protection Policy Section 11.3.
- AG Grid Enterprise Command Center:
- High-performance Server-Side Row Model (SSRM) managing thousands of dispute claims with sub-millisecond filtering, multi-column sorting, and master-detail hierarchical drawers.
- Real-time WebSocket streaming highlights new disputes and logs live agent reasoning traces.
- Predictive Risk & Account Limitation Forensics:
- Real-time radial health gauge tracking portfolio dispute rates against PayPal's critical 1.5% limitation ceiling.
- Interactive guardrail toggles to enforce delivery proofs before shipping delays turn into chargebacks.
How we built it
DisputeShield AI is built as a production-grade distributed system:
- Frontend: React 18, Vite, Tailwind CSS, AG Grid Enterprise v36.2 (
ag-grid-reactServer-Side Row Model & Master-Detail), Recharts, Lucide Icons, and native HTML5 WebSocket client. - Backend: Python 3.12, FastAPI (REST & WebSockets), Pydantic v2 schemas, SQLAlchemy 2.0 ORM (PostgreSQL & SQLite compatibility), and background task pipelines.
- AI Agent & Reasoning: LangChain Core, Google Gemini 2.0 Flash / OpenAI GPT-4o, few-shot prompt engineering with RAG similarity retrieval.
- Tool Protocols: Anthropic Model Context Protocol (
@paypal/mcpstdio server) connecting logistics, order DBs, and PayPal dispute lifecycle tools. - Search & Precedents: Elasticsearch 8.15 for 1536-dim dense vector search and historical case citation.
- DevOps: Render Cloud Web Services & Managed PostgreSQL 16 database, Docker Compose, and automated health monitoring.
Challenges we ran into
- PayPal Webhook Security & Idempotency: Webhooks require strict signature validation while guarding against replay attacks. We built an in-memory cached certificate validator with CRC32/RSA verification.
- Eliminating Agent Hallucinations in Legal Filings: In financial rebuttals, hallucinations lose money. We enforced a strict two-stage pipeline: deterministic evidence validation must verify carrier receipts before the LLM writes the rebuttal.
- AG Grid Enterprise SSRM with Live WebSockets: Connecting AG Grid's Server-Side Row Model with real-time WebSocket push required implementing cache invalidation without triggering full page re-renders.
Accomplishments that we're proud of
- Sub-12-Second Defense Cycle: Cut dispute resolution time from 45 minutes to under 12 seconds.
- 83.3% Win Rate: Delivers a +30.5% alpha over the standard 52% e-commerce industry baseline.
- 39/39 Automated Tests: Full test suite running in 14 seconds across all API routers, confidence scorers, and MCP bridges.
- Full Cloud Deployment: Live frontend, backend API, PostgreSQL, and PayPal Sandbox integration deployed on Render.
What we learned
- How to harness the Model Context Protocol (MCP) to standardize tool execution across merchant backends, shipping APIs, and PayPal.
- The mechanics of PayPal Seller Protection policy rules and dispute lifecycle transitions (
UNDER_REVIEW,WAITING_FOR_SELLER_RESPONSE,RESOLVED). - How to build high-performance data grids using AG Grid Enterprise SSRM for financial telemetry.
What's next for DisputeShield AI — Autonomous PayPal Defense
- Shopify & WooCommerce Native Apps: 1-Click app store integrations to pull fulfillment tracking automatically.
- PayPal Marketplace Platform Edition: Expanding from single merchants to multi-seller platforms.
- Proactive In-Transit Intervention: Automatically contacting buyers when carrier delays occur to resolve issues before disputes are filed.
Built With
- ag-grid-enterprise
- docker
- elasticsearch
- fastapi
- gemini-api
- langchain
- model-context-protocol
- paypal
- postgresql
- python
- react
- recharts
- render
- tailwind-css
- vite
- websockets