Guide #15 Architecture & Engineering

How FamGateway Works: 0% Fee Automated UPI Settlement Engine (2026 Guide)

By Aryan Gupta September 1, 2026 5 min read

FamGateway was engineered to solve a critical barrier in the Indian FinTech ecosystem: enabling developers, students, and indie creators to accept automated UPI payments without requiring enterprise banking aggregators, GST registrations, or expensive commercial setups.

Architecture Blueprint At A Glance
  • Settlement Model: 100% Non-Custodial Peer-to-Peer (P2P). Funds transfer directly to merchant's personal UPI ID with zero intermediate escrow.
  • Verification Engine: Pure PHP 8.x IMAP SSL listener parsing DKIM-authenticated bank receipts from [email protected] in RAM.
  • Concurrency Protection: Row-level ACID database locks on 12-digit Bank UTRs and embedded order reference notes.
  • Webhook Dispatch: Sub-150ms asynchronous non-blocking cURL queues delivering HMAC-SHA256 signed JSON payloads.

The Non-Custodial Architecture

Traditional payment gateways act as custodians: they collect customer money into nodal accounts, hold it for 2 to 3 days (T+2 settlement), deduct 2% to 3% processing fees, and enforce strict corporate verification.

FamGateway takes a completely decentralized, non-custodial software approach:

Feature Parameter FamGateway (Non-Custodial) Traditional Gateways (Custodial)
Fund Flow & Escrow Direct to Merchant UPI (0 Escrow) Pooled in Nodal Escrow A/C
Settlement Timing Instant (0 Seconds) T+2 or T+3 Business Days
Transaction Cuts 0% (Free Forever) 2% – 3% + 18% GST
GST / Business KYC Zero Required (Personal UPI) Mandatory GST & Current A/C
Zero Escrow Guarantee: When a customer scans your QR code or pays via FamPay, 100% of the funds transfer directly into your personal UPI ID. FamGateway never touches, holds, or delays your money.

Step-by-Step Payment Lifecycle

1. Order Session Creation

When a customer initiates a payment on your website or application, your backend calls POST /api/create-order with your X-Api-Key header and order amount in JSON format. FamGateway provisions an atomic order session with a unique Order ID and an exact 5-minute TTL (300 seconds) validity window.

2. Payment via Dynamic QR or Hosted Checkout

The customer scans the generated dynamic UPI QR code or pays via our mobile-optimized Hosted Checkout. The payment settles immediately inside the merchant's personal FamPay account.

3. Real-Time Stateless Receipt Inspection

FamPay dispatches an instant payment confirmation receipt to the merchant's linked Gmail address from [email protected]. FamGateway's backend daemon performs real-time IMAP inspection:

  • The daemon inspects only the transactional receipt headers (udate) and message body in temporary RAM.
  • It extracts the 12-digit Bank UTR, internal FamPay Transaction ID, Sender Name, and Timestamp.

4. Bank UTR Idempotency & Database Locking

Using ACID row-level locking (SELECT ... FOR UPDATE), the engine verifies that the extracted Bank UTR has never been used to claim any prior order. Once validated, the UTR is permanently bound to the current Order ID, preventing replay attacks and race conditions.

5. HMAC-SHA256 Signed Webhook Dispatch

Within seconds of confirmation, FamGateway dispatches an authenticated JSON webhook to the merchant's server endpoint:

{
  "event": "payment.success",
  "order_id": "fg_A1B2C3D4",
  "amount": "499.00",
  "utr": "420987654321",
  "sender_name": "Rahul Sharma",
  "timestamp": 1756473072
}

The merchant server validates the signature in header HTTP_X_FAMGATEWAY_SIGNATURE and automatically delivers the digital goods or activates the user's subscription.

Key Advantages for Developers

  • 0% Platform Fees: No setup fees, no monthly maintenance, and no per-transaction cuts.
  • Exact Clean Amounts: No awkward decimal increments (₹499.04) required for collision prevention.
  • Plug-and-Play Integration: Ready SDKs for PHP, Python, and Node.js with built-in webhook handlers.

Related Technical Guides & Resources

Deep Dive

How FamGateway Webhooks Work

HMAC-SHA256 signatures, asynchronous queues, and official PHP SDK.

Pillar Guide

What is FamPay? Full 2026 Guide

FamApp by Trio, numberless cards, UPI limits, and safety.

Video Guides

YouTube Video Tutorials

Step-by-step video setup and Kuro Panel integration guides.

Explore the Full API Documentation & Quickstart →

Topic Cluster & Series

Related Developer Guides & Resources

View All 70+ Guides →
SMM Panels

How to Integrate FamPay UPI Payment Gateway in SMM Panels (Rental, Perfect Panel & SmartPanel)

Step-by-step developer guide to integrating FamPay UPI payment gateway in SMM panels (Rental, Perfect Panel...

Read Guide →
WooCommerce

How to Accept UPI Payments on WooCommerce Without GST or Current Account (2026 Guide)

Complete tutorial on accepting automated UPI payments on WooCommerce without GST or a commercial current ac...

Read Guide →
Telegram Bot

How to Accept Automated UPI Payments in Telegram Bots (Python & Node.js Guide)

Step-by-step tutorial on accepting automated UPI payments in Telegram shop bots using Python (FastAPI) and ...

Read Guide →

Back to Homepage →

About the Platform

FamGateway is an official unit of ARYANISPE, founded by Aryan Gupta (Aryanispe) and officially registered under the Ministry of Micro, Small and Medium Enterprises (MSME), Government of India (Reg: UDYAM-BR-28-0050000).

All Systems Operational