YouPI PG is a self-hosted open-source payment gateway for Indian UPI payments with zero transaction fees. Payments go directly from your customer's bank account to yours. Setup runs in under 20 minutes.
Razorpay charges 2% per transaction. Stripe charges 2.9% plus 30 cents. At 50,000 rupees a month in revenue, that is 1,000 rupees leaving your account every single month, going to a processor that does nothing except sit in the middle.
YouPI PG routes around the middleman entirely. When a customer pays, the money goes from their bank account to yours over UPI, India's national payment rail. The gateway detects that payment by watching your own bank's notifications. No aggregator, no percentage, no per-transaction fee.
One constraint before you read further: this works on UPI only. If your business is in India and takes payments from Indian customers, keep reading. If you use Stripe, Square, or PayPal for a non-Indian customer base, this specific tool does not apply today.
The architecture is still worth understanding. This is what zero-fee payment detection actually looks like.
What Is UPI?
UPI (Unified Payments Interface) is India's national bank-to-bank payment system, run by the NPCI. When a customer pays via UPI, their bank transfers money directly to the merchant's bank account. There is no card network, no holding period, no aggregator in the default path. Settlement happens in seconds.
Razorpay, Cashfree, and similar gateways sit on top of UPI as aggregators. They simplify the integration and take a percentage for it.
YouPI PG removes the aggregator. You get the full amount.
The Tool: What YouPI PG Does
YouPI PG is a Node.js application you run on your own server. When a customer pays, they pay directly to your UPI VPA (your virtual payment address, such as yourbusiness@hdfc). The gateway detects the payment by watching your bank's own notification channels:
| Detection Channel | What It Watches | Setup Difficulty |
|---|---|---|
| Android SMS Observer | Bank credit SMS on a secondary Android phone | Low |
| Gmail Observer | Bank credit emails via Google OAuth2 | Medium |
| Google Messages Web | SMS forwarded to Google Messages Web (headless Chrome) | Medium |
Any one channel confirming the payment is enough to mark the transaction complete. The redundancy means a slow SMS alert does not delay your order confirmation.
The codebase has 2,500 GitHub stars and 869 forks. It is free and open-source. You pay for the server you run it on. Nothing else.
Read This Before You Go Further
The YouPI PG README calls this a "Research Project. Experimental Use Only." That label is there for a reason.
The gateway is not bank-approved, NPCI-approved, or independently audited for security or compliance. It works by observing bank notifications, not by connecting to an official API. If your bank updates their alert format, payment detection stops working until someone patches the parser.
The project maintainers recommend keeping transactions under 20 per day, per receiving account. This is a conservative project guideline, not a limit imposed by NPCI. Actual limits depend on your bank, your account type, and how NPCI's risk controls assess your activity.
Use this for a small service business taking 5 to 15 payments a day, internal tools where you control both sides, or learning how payment detection actually works.
Do not use it for regulated financial products, high-volume commerce, or anything requiring a compliant payment processor without legal and compliance review first.
Setup: Four Steps
What you need before you start: Node.js 22.13.0 or later, a Linux or macOS server (Windows works too), and an Android phone with your receiving bank's SIM card.
Step 1. Clone and install
Copy this.
git clone https://github.com/youpi-pg/YouPI-PG.git youpi-pg cd youpi-pg npm install
No PostgreSQL, no Redis, no Docker. A SQLite database is created automatically on first launch.
Step 2. Configure your environment
Copy this.
cp .env.example .env
Open the .env file. Set your UPI VPA (your name@bank address) and your business name. The defaults handle everything else for a test run on localhost.
Step 3. Start the gateway
Copy this.
npm run dev
First launch creates the database, runs migrations, and seeds baseline data. No manual setup. Open localhost:3000 to see your Merchant Admin panel.
Done. The checkout UI is live on your machine.
Step 4. Connect a payment observer
Install the Android APK (youpi-sms-gateway.apk, SHA-256 verified, available in the repo's apps/ directory) on a secondary Android phone with your bank's SIM. In the Merchant Admin panel, scan the pairing QR code.
The app runs as a background service. It sends HMAC-signed payment confirmations to your gateway with a timestamp check to prevent replay attacks.
This is the step most people underestimate. The phone needs to stay on and connected. A phone you charge once a week is not a payment observer. Plan for a dedicated device.
Adding It to Your Site
Three integration options:
Declarative (zero JavaScript). Add one script tag to your page header. Add data-youpi-pay attributes to your buy buttons. The gateway intercepts clicks and opens the checkout modal automatically.
Programmatic (React, Vue, Next.js, Nuxt). Call window.Youpi.pay() with an order ID, amount in rupees, and callback functions:
Copy this.
window.Youpi.pay({
order_id: "ORDER_001",
amount: 999,
currency: "INR",
handler: (response) => console.log("Paid. UTR:", response.utr),
onClose: () => console.log("Customer closed checkout")
});
Webhook (server to server). YouPI posts to your endpoint with an HMAC-SHA256 signature in the header. Verify it, then mark the order paid. Verification snippets are included for Node.js, Python, PHP, and Go in the documentation.
The webhook payload includes the UTR, a 12-digit unique transaction reference that your bank also records. Use the UTR to reconcile against your bank statement. Deduplicate on deliveryId, not on timestamp.
What the Customer Sees
- They click Pay on your site
- A WhatsApp OTP confirms their phone number
- A dynamic UPI QR appears with a 5-minute payment timer
- On mobile, one-tap links open GPay, PhonePe, Paytm, or CRED directly
- They pay inside their bank app
- Your site updates when the observer confirms the transfer
One queue detail worth knowing: only one customer can occupy a payment slot at a time. If two customers send the same rupee amount at the same moment, the second waits. This prevents the gateway from attributing the wrong payment to the wrong order. At the transaction volume this tool is built for, it is not a practical issue.
Use This Prompt to Check If It Fits Your Business
Before committing to a self-hosted payment gateway, run this through your AI tool of choice:
Copy this.
I'm evaluating YouPI PG, a self-hosted open-source UPI payment gateway for India. My context: - Business type: [e.g., digital agency, course creator, service business] - Monthly transaction volume: [number of transactions] - Average transaction value: [amount in rupees] - Current payment processor: [e.g., Razorpay, manual bank transfer] - Technical setup: [e.g., I have a developer, I can run Node.js] YouPI PG constraints: India/UPI only, 20 transactions/day conservative guideline, needs an Android phone with the receiving bank's SIM, labeled Experimental Use Only. Give me a direct assessment of whether this tool fits my situation. Include the three most relevant risks for my specific context.
The Mistake That Makes It Fail
Running orders without reconciliation.
A confirmed webhook does not prove that funds settled in your bank account. The gateway watches bank notifications, and notifications can be delayed, formatted differently after a bank update, or in rare cases missing entirely.
Every business using YouPI PG should reconcile daily: compare confirmed transaction UTRs against the bank's official statement. A UTR in your gateway but absent from your statement means the order stays on hold until it resolves.
This is not optional. It is the same discipline any payment processor requires.
Honest: The Limits
1. India and UPI only. This does not replace Stripe, PayPal, or any card-based processor. If your customers are outside India or pay by card, this tool does not apply.
2. You need a phone running permanently. The Android SMS observer is a secondary device with your bank's SIM that must stay on. If it loses its network connection, detection falls back entirely to the Gmail observer. If both fail, payments go undetected until they are resolved manually.
3. Bank alert formats can change. Banks update their SMS and email templates. When they do, the observer parsers may stop matching until someone updates the pattern in the codebase. Watch the GitHub issues page.
4. 20 transactions per day, conservatively. This is a project guideline, not a hard limit from NPCI or any bank. Real limits depend on your specific bank, account type, and risk controls. Exceeding it is your judgment call.
5. Not for regulated or high-value transactions. YouPI PG is not bank-approved or audited. Until you have a compliance review and an audit trail, do not use it for anything that needs a certified payment processor.
When NOT to use this: high-volume merchants, regulated industries, businesses where payments must survive an external audit, or any context where payment failure has legal or contractual consequences.
The 10-Minute Homework
Clone the repo. Run npm install, then npm run dev. Open localhost:3000.
The checkout UI runs on your machine in under 10 minutes. No account, no API key, no credit card required. You will see the full admin panel and the customer checkout flow before you decide anything.
If you run a service business in India taking 10 to 50 payments a month, that 10-minute test tells you whether eliminating a 2% fee changes your unit economics.