Documentation & Specs

Developer & Architecture Resources

Everything you need to evaluate, integrate, and deploy ResolveAI with PayPal Sandbox and PostgreSQL.

REST API Specification

Explore the complete OpenAPI 3.0 contract powering our Next.js frontend and Express 5 backend.

View Endpoints

PayPal Sandbox Setup

Step-by-step instructions for webhook URL registration, sandbox OAuth credentials, and order captures.

Read Sandbox Guide

Open Source Repository

Built under the permissive MIT License for the PayPal AI Hackathon 2026.

Inspect Source on GitHub

Backend REST API Contract

Mounted on Express 5 at /api with Zod request validation.

OpenAPI 3.0
POST/api/auth/login
Authenticate merchant and retrieve JWT Bearer token
GET/api/merchants/dashboard
Retrieve merchant active disputes, revenue, and KPIs
GET/api/disputes
List disputes with pagination, reason, and status filtering
GET/api/disputes/:id
Fetch full dispute dossier with matched order and evidence
POST/api/disputes/:id/analyze
Run autonomous Gemini 2.5 Flash investigation pipeline
POST/api/disputes/:id/approve
Record explicit merchant approval (human-in-the-loop gate)
POST/api/disputes/:id/submit
Submit contestation package to PayPal Disputes REST API
POST/api/paypal/webhooks
HMAC signature verified webhook listener for dispute events
GET/api/audit
Retrieve paginated compliance ledger of all system actions

PayPal Sandbox Configuration

In your PayPal Developer Dashboard under your Sandbox REST App:

  1. Register your public webhook URL: https://your-domain/api/paypal/webhooks
  2. Subscribe to: CUSTOMER.DISPUTE.CREATED, CUSTOMER.DISPUTE.UPDATED, and CUSTOMER.DISPUTE.RESOLVED
  3. Copy the generated PAYPAL_WEBHOOK_ID into your .env file
  4. Set DEMO_MODE=false to execute real sandbox dispute submissions, or keep it true for verified offline rehearsals