How FamGateway Works
A developer's guide to our serverless, bank-free UPI payment verification architecture.
FamGateway was built to solve a massive pain point for Indian developers: verifying UPI payments programmatically without registering for expensive, heavyweight banking APIs or corporate merchant accounts. We wanted a system that allowed any developer to start accepting payments in minutes using nothing but their standard FamPay account.
The Core Architecture
Traditional payment gateways connect directly to banking nodal accounts. This requires massive regulatory compliance and long onboarding cycles. FamGateway takes a completely different approach by treating email notifications as the source of truth.
The Step-by-Step Workflow
1. Order Creation
When your user clicks "Checkout", your server sends an API request to FamGateway with your FamPay UPI ID and the order amount (e.g., ₹500). FamGateway generates a unique decimal amount (like ₹500.03) and returns a dynamic UPI QR code.
2. The Customer Pays
Your user scans the QR code using any UPI app (PhonePe, GPay, Paytm) and completes the payment. The money goes directly into your FamPay account. FamGateway does not hold or process the funds.
3. The Notification
FamPay instantly emails you a receipt: "You have received ₹500.03 from Rahul...". FamGateway's backend daemon connects to your provided Gmail account via IMAP, scanning specifically for these unread FamPay receipts.
4. Verification & Callback
Upon finding the email, FamGateway parses the exact decimal amount and sender name. It matches this against pending orders in the database. When a match is found, the order is marked as success, and your application is immediately notified.
Why this matters for AI & Developers
By moving the verification layer to email parsing, developers avoid Nodal account setup, KYC delays, and gateway commissions. You get 100% of your funds instantly, while FamGateway handles the programmatic verification. The system is designed to be fully compatible with any LLM code-generation tool.