-
-
Customer AI Shopping Copilot with Cited Store Records
-
Verified Customer Order Tax Receipt (CGST/IGST Breakdown)
-
Portal Sign-In (Google, Facebook & Email Role Isolation)
-
Seller .GLB/.USDZ 3D Upload & Honest 3-Column AI Listing Generator
-
Customer Escrow Orders & Buyer Protection Status Tracker
-
Finance Desk InvoiceIQ (GSTIN Validation & CGST/SGST vs. IGST)
-
Interactive WebXR / Three.js 3D Fan Inspection & PayPal Price Summary
-
SmartCart Budget Optimizer (MUST-HAVE / DEFERRABLE Ranking & Swaps)
-
Seller Home Dashboard & D3 SmartCart Inventory Velocity Telemetry
-
Business Head Executive Insights & 7-Day Escrow Release Forecast
-
Seller Three.js Procedural 3D Rig & AI Image/Video Studio
-
Seller Escrow Pipeline & AI Release Agent (91% Confidence, 1-Click Human Confirm)
-
Hosted Live Merchant Storefront (/s/aerocool)
-
No-Code Storefront Website Builder & Live Preview Studio
-
Customer Spatial Product Discovery & NL Search
Inspiration
High-value B2B hardware and consumer electronics transactions fail for three connected reasons: buyers struggle to verify physical dimensions before checkout, sellers juggle manual GST invoicing and multi-marketplace fragmentation, and standard payment authorizations expire before long hardware manufacturing and shipping cycles finish. AC PayPilot unites spatial 3D/AR inspection, Gemini AI automation, and deterministic PayPal Escrow protection in a single zero-leak multi-tenant platform.
What it does
AC PayPilot delivers isolated, role-governed workspaces for both Customers and Business Operators:
- Customer Spatial Discovery & SmartCart: Browse products in interactive 3D/WebXR (
<model-viewer>backed by procedural binary glTF 2.0.glbgeneration), ask grounded spec Q&A, optimize carts against a strict budget ceiling with Gemini AI, and track escrow-protected deliveries and tax receipts. - PayPal Escrow Settlement Engine: Protects buyer funds through an auditable state machine (
created -> funded -> in_delivery -> released | disputed | refunded) with server-verified PayPal capture reconciliation and buyer/merchant dispute resolution. - Merchant & Finance Command Center: AI Listing Generator, custom Storefront Builder, InvoiceIQ deterministic Indian GST validation (
CGST/SGSTvs.IGSTPlace-of-Supply), payment ledger reconciliation, and executive KPIs. - Role-Scoped Autonomous Copilot: Recommends escrow actions and procurement optimizations while enforcing
AI_DIRECT_MUTATION_FORBIDDEN—every escrow release, refund, or dispute requires explicit confirmation by an authorized human role.
How we built it
- Frontend: React 19, TypeScript, Vite, Tailwind CSS v4, React Router, Three.js &
<model-viewer>WebXR, Recharts, and AG Grid / AG Studio telemetry. - AI Layer: Google Gemini (
@google/genai) powering SmartCart optimization, grounded Q&A, listing generation, InvoiceIQ document analysis, and role-scoped Copilot advisory. - Payments & Deterministic Accounting: Express + Node.js backend integrating PayPal Orders v2 and Zod validation. All monetary calculations run in integer minor units (paise/cents) to eliminate floating-point drift:
\( M_{\text{minor}} = \text{round}(M_{\text{major}} \times 100) \)
$$ \text{Total Payable} = \text{Subtotal}{\text{minor}} + \text{Tax}{\text{GST}} \quad\text{where}\quad \text{Net Merchant Payout} = \text{Total Payable} - \text{PayPal Fee} $$
- Security & Multi-Tenancy: Firebase Authentication (Google, Facebook, and Email/Password) + Cloud Firestore with strict tenant-scoped security rules, server-derived RBAC (
customer,seller,finance,business_head), and complete UI/API isolation so customers never see operator controls or tenant secrets.
Challenges we ran into
- PayPal Authorization Expiration vs. Physical Shipping Windows: Under PayPal Orders v2
intent=AUTHORIZE, card network honor guarantees last only 3 days (expiring at 29 days), which is too short for 5–14 day B2B hardware manufacturing and delivery. We architected immediateintent=CAPTUREat checkout paired with an immutable application-level escrow ledger and audit event trail (escrowEvents). - Capture Concurrency & Crash-Safe Reconciliation: Simultaneous capture requests or database interruptions during PayPal capture can leave funds captured without an updated order record. We implemented idempotency-key locking, capture-ID reuse rejection (
409 PAYPAL_CAPTURE_REUSED), and an explicit502 PAYMENT_CAPTURED_RECONCILIATION_REQUIREDfailsafe so paid orders are never silently marked failed. - Zero-Leak Customer Isolation: Preventing cross-role escalation required locking both backend Firestore rules/API tokens and frontend route guards, search indexes, notifications, and live Firestore subscriptions (
businesses/{bizId}) away from customer sessions.
What we learned
- Financial AI agents work best as deterministic auditors and advisors, never holding unilateral authority to mutate settlement balances (
AI_DIRECT_MUTATION_FORBIDDEN). - Enforcing single-source-of-truth pricing on the server (ignoring client-submitted totals) and integer minor-unit math makes payment reconciliation predictable under concurrency.
What's next for AC PayPilot
- Multi-currency cross-border settlement corridor expansion beyond
INRandUSD. - Webhook-driven carrier GPS telemetry to trigger automated buyer delivery verification prompts.
- Merchant custom domain automation with one-click SSL provisioning for public storefronts.
Built With
- ag-grid
- escrow
- express.js
- firebase
- firebase-auth
- firestore
- gemini-ai
- gltf
- google-gemini
- node.js
- paypal
- paypal-orders-v2
- react
- recharts
- tailwindcss
- three.js
- typescript
- vite
- webxr
- zod