💡 Inspiration:

The $50 Billion Exporter Dilemma

Over 15 million vernacular micro-exporters, artisans, handloom weavers, and independent tutors across India create world-class crafts demanded by global buyers in the United States and Europe. However, they remain excluded from direct international trade due to a compounding double-friction:

  1. Language Exclusion: Exporters speak and negotiate naturally in Indic languages (Telugu, Hindi, and Indian English), while global payment dashboards are intimidating, English-only interfaces.
  2. Cross-Border Conversion Friction: Translating spoken Indian Rupee (INR) amounts into USD, locking transparent foreign exchange rates, sharing scannable checkout links, and reconciling incoming international settlements is fraught with currency loss and delayed payouts.

We asked: What if a handloom weaver in Hyderabad could simply speak in Telugu, have a deterministic AI agent lock an illustrative USD quote, generate a real PayPal Sandbox QR code instantly, and settle the payment directly into an interactive AG Grid ledger?

That vision is VernacPay-Global.


⚡ What It Does

VernacPay-Global unites Sarvam AI Indic Speech (saaras:v3 STT & bulbul:v3 TTS), high-throughput Groq LLM Function Calling (openai/gpt-oss-120b), and the PayPal Developer Platform (Orders v2 API with instant scannable QR codes).

A merchant speaks naturally in Telugu:

"న్యూయార్క్ లో ఉన్న సారా కి పోచంపల్లి పట్టు చీర కోసం 12,000 రూపాయల పేపాల్ ఆర్డర్ పంపండి"
(Send a PayPal order to Sarah in New York for 12,000 rupees for a Pochampally silk saree)

  1. Deterministic FX Engine: The system deterministically computes the foreign exchange quote without permitting the LLM to do arithmetic: $$\text{Settlement}{\text{USD}} = \frac{\text{Spoken}{\text{INR}}}{\text{Locked FX Rate}} = \frac{₹12,000}{₹84.00/\text{USD}} = \$142.86 \text{ USD}$$
  2. Merchant Authorization Card: A bilingual card displays the details with a 10-minute quote lock countdown.
  3. Real PayPal Orders v2 QR Code: Upon explicit merchant confirmation ("Avunu" / 1-tap Approve), the system calls PayPal's Orders v2 API (intent: 'CAPTURE'), returning a live checkout token and generating an instant scannable PayPal QR Code.
  4. Instant Settlement on AG Grid: When the buyer pays on PayPal, the return handler synchronously executes capture, and PayPal webhooks verify cryptographic signatures (verify-webhook-signature), flipping the AG Grid row to VERIFIED_PAID with spoken vernacular audio feedback!

🛡️ The 5-Stage Deterministic Trust Boundary

In fintech, AI agents cannot be allowed to hallucinate financial transactions or mutate ledgers arbitrarily. VernacPay-Global enforces an unbreakable 5-stage architectural pipeline:

[1. AI Proposes] ──> [2. Server Validates] ──> [3. Merchant Authorizes] ──> [4. PayPal Processes] ──> [5. Ledger Verifies]
  • Zero Secret Exposure: PAYPAL_CLIENT_SECRET, SARVAM_API_KEY, and GROQ_API_KEY reside exclusively in the backend runtime.
  • Fail-Closed Capture Security: The ledger strictly refuses to transition to VERIFIED_PAID without an authentic PayPal capture ID. Unapproved captures fail closed with real PayPal HTTP 422 errors.
  • Cryptographic Webhook Verification: Incoming webhooks are validated against PayPal's /v1/notifications/verify-webhook-signature API. Unsigned or tampered requests return HTTP 400 Bad Request.
  • Zero Simulation Backdoors: Backdoor simulation routes return HTTP 404 in production, ensuring 100% authentic payment settlement.

🛠️ How We Built It

  • PayPal Developer Platform (Orders v2 Rail): Live sandbox OAuth authentication, dynamic order generation with HATEOAS approval links, synchronous return-url capture, and cryptographic webhook verification.
  • Sarvam AI Indic Speech Suite: Real Indic neural speech synthesis via bulbul:v3 (Telugu kavitha, Hindi aditya, English simran) and automated speech recognition via saaras:v3.
  • Groq LLM Agent: High-speed openai/gpt-oss-120b function calling converting unstructured vernacular speech into strictly typed Zod schemas.
  • AG Grid Community v32: Full Financial Command Center featuring live Server-Sent Events (SSE), voice-controlled grid filtering (setFilterModel), pinned summary aggregate footers, dynamic cell flashing, and client-side CSV tax export.
  • Production Cloud & Database: Node.js 20 backend with Knex connection pooling running against Managed PostgreSQL on Render declared via render.yaml.

🧗 Challenges We Faced

  1. Deterministic Fintech Math vs. LLM Hallucinations: Large language models are notorious for rounding errors and calculation drift. We decoupled natural language parsing from currency conversion: the LLM extracts the spoken rupee integer, while our server-side engine calculates and locks the reference USD quote with KaTeX precision.
  2. Idempotent Webhook Replay Protection: If network latency causes PayPal to retry PAYMENT.CAPTURE.COMPLETED, naive ledgers risk double-crediting. We engineered strict idempotency checking the transaction state and capture ID before writing to PostgreSQL, guaranteeing zero duplicate entries.
  3. Eliminating All Simulation Backdoors: We replaced legacy mock capture routines with strict fail-closed guards so that only real PayPal captures can mark orders as paid in production.

🏆 Accomplishments We're Proud Of

  • 100% Test Coverage: 28 passing unit and security tests plus 9 live integration tests running directly against PayPal Sandbox, Sarvam AI, and Groq LLM.
  • Real Commercial Export Market Fit: Built specifically around authentic PayPal cross-border export regulations (USD billing, inward remittance reconciliation) rather than domestic wallets.
  • Clean AG Grid Implementation: 100% pure AG Grid Community with zero unlicensed Enterprise trial watermarks.

📚 What We Learned

We learned that the most reliable AI fintech applications treat the LLM as an untrusted interface layer. By wrapping the agent in deterministic server validation and explicit merchant confirmation cards, we can bring the magical convenience of voice commerce to non-English speaking artisans while maintaining institutional banking safety.


🚀 What's Next for VernacPay-Global

  • WhatsApp Voice Exporter Bot: Allowing artisans to forward audio voice notes directly on WhatsApp to generate instant PayPal payment links.
  • PayPal Payouts Integration: Splitting bulk export earnings automatically among weaver cooperative members.
  • India Post / DHL Courier Webhook Sync: Automated shipment tracking synchronization to accelerate PayPal Seller Protection reserve releases.

Built With

Share this project:

Updates

Submission history