How to Generate Dynamic UPI Payment Links & QR Codes in Google Sheets (Free Automation Guide & Interactive Tool)
Eliminate 2% payment gateway commissions and invoice typos. Learn how to generate dynamic, NPCI-compliant UPI payment deep links and scannable QR codes directly inside Google Sheets, automate billing with Google Apps Script, and send instant WhatsApp payment requests.
Sumit Singh
Founder & Lead Automation Architect
The Zero-Fee Advantage: Why Direct UPI Beats 2% Payment Gateways for Business Billing
For Indian businesses, agencies, consulting practices, and wholesalers, collecting client dues has traditionally meant choosing between two extremes: tedious manual bank transfers (NEFT/RTGS/IMPS) that take hours to confirm, or third-party payment gateways (such as Razorpay, Cashfree, or Instamojo) that deduct 1.8% to 2.5% plus 18% GST on every settlement.
On an annual revenue of ₹50,00,000, paying 2% in payment gateway processing fees costs your business over ₹1,18,000 in lost margins. Furthermore, payment gateways withhold settlement for T+1 or T+2 days, creating avoidable working capital bottlenecks for fast-growing companies.
Under National Payments Corporation of India (NPCI) guidelines, direct UPI payments settled between customer accounts and merchant accounts carry zero Merchant Discount Rate (MDR) for standard bank-to-bank UPI transfers. By leveraging dynamic UPI deep links and scannable QR codes generated directly from your Google Sheets invoices, you can collect instant payments straight into your primary current account with zero merchant fee deductions.
Bottom-Line Impact: Generating your own dynamic UPI QR codes keeps 100% of your invoice value in your bank account, eliminates settlement delays, and guarantees that clients pay the exact amount without accidental rounding errors.
Interactive UPI Link & QR Code Generator: Test in Browser & Copy Formulas
Use the interactive live tool below to generate your customized UPI payment deep link and scannable QR code right inside your browser. No data leaves your machine—everything is computed 100% client-side for maximum financial privacy.
Enter your Virtual Payment Address (VPA / UPI ID), registered legal name, invoice number, and payable amount. You can instantly test the mobile deep link, download the high-resolution QR code, or copy ready-to-use Google Sheets formulas directly to your clipboard.
Live NPCI UPI Payment Link & QR Code Generator
Zero server storage. 100% computed client-side for confidential financial workflows.
Locks ₹1499.00 INR in customer UPI app.
Synbus Solutions
billing@icici
Ref: INV-2026-101
Scan and pay with any BHIM UPI app
Zero Convenience Fees • Verified by Synbus Solutions
The Anatomy of a Compliant NPCI UPI Link: Parameter Reference & Syntax Rules
Every mobile UPI app—including Google Pay, PhonePe, Paytm, BHIM, CRED, and Amazon Pay—listens for the standard upi:// URL scheme defined by NPCI. Understanding each query parameter ensures that your links open reliably across both Android and iOS devices without syntax rejections.
| Parameter | Key Name | Required | Format / Character Rules | Purpose & Business Example |
|---|---|---|---|---|
| pa | Payee Address | Yes | Alphanumeric VPA string | The receiving UPI handle, e.g. billing@icici or trade@okaxis. |
| pn | Payee Name | Yes | URL-encoded string (max 99 chars) | Legal business or trade name displayed in the banking app. |
| am | Amount | Conditional | Decimal formatted (0.00) | Exact payable amount in INR. Locks amount so user cannot tamper. |
| cu | Currency | Yes | Fixed value: INR | National currency code. Must always be strictly INR. |
| tn | Transaction Note | Recommended | URL-encoded string (max 80 chars) | Invoice reference or memo displayed on customer bank passbook. |
| tr | Transaction Ref | Optional | Alphanumeric (max 35 chars) | Merchant internal order ID or unique tracking token. |
| mc | Merchant Code | Optional | 4-digit MCC | Optional Merchant Category Code for verified business accounts. |
Step-by-Step Google Sheets Formulas: Single-Cell & Scalable ArrayFormulas
To generate dynamic UPI links and QR codes at scale across hundreds of client rows in Google Sheets, you can combine spreadsheet string concatenation with Google's native IMAGE formula and a reliable QR generation API endpoint.
Assume your billing spreadsheet is structured as follows: Cell B1 contains your receiving UPI ID (e.g. billing@icici), Cell B2 contains your Business Name (e.g. Synbus Solutions), Column A contains the Invoice Number (e.g. INV-2026-101), Column B contains the Client Name, and Column C contains the Amount Payable in INR.
- Format Amount Strictly: Always wrap your amount cell in TEXT(C2, '0.00') to guarantee two decimal places and avoid locale comma separators (e.g., 1,500.00) that corrupt URL parameters.
- URL-Encode Strings: Always wrap human-readable text like business names and invoice memos in ENCODEURL() so spaces and symbols become valid %20 encoding.
- Adjust Row Heights: Google Sheets cells default to 21px height. Select your QR code column and set row height to 120px to 160px for clean, crisp scanning from phone cameras.
// 1. Column D (Raw UPI Deep Link string)
="upi://pay?pa=" & $B$1 & "&pn=" & ENCODEURL($B$2) & "&am=" & TEXT(C2, "0.00") & "&cu=INR&tn=" & ENCODEURL("Inv " & A2)
// 2. Column E (In-Cell Scannable Dynamic QR Code Image)
=IMAGE("https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=" & ENCODEURL("upi://pay?pa=" & $B$1 & "&pn=" & ENCODEURL($B$2) & "&am=" & TEXT(C2, "0.00") & "&cu=INR&tn=" & ENCODEURL("Inv " & A2)))Google Apps Script: Automatically Embed Dynamic UPI QR Codes in PDF Invoices
If you generate client invoices using Google Docs templates or Google Sheets export scripts, you can programmatically fetch the dynamic QR code as an image blob and insert it into your invoice footer before converting the document to PDF.
/**
* Generates an NPCI-compliant UPI QR Code Blob for Google Docs / Sheets Invoices.
* @param {string} vpa Receiving UPI ID (e.g., billing@icici)
* @param {string} payeeName Legal Business Name
* @param {number} amount Total payable amount
* @param {string} invoiceNumber Unique invoice reference
* @return {Blob} Image blob ready to insert into Doc or attach to Email
*/
function generateUpiQrBlob(vpa, payeeName, amount, invoiceNumber) {
var formattedAmount = Number(amount).toFixed(2);
var rawUri = "upi://pay?pa=" + vpa +
"&pn=" + encodeURIComponent(payeeName) +
"&am=" + formattedAmount +
"&cu=INR" +
"&tn=" + encodeURIComponent("Invoice " + invoiceNumber);
var qrApiUrl = "https://api.qrserver.com/v1/create-qr-code/?size=300x300&margin=10&data=" + encodeURIComponent(rawUri);
var response = UrlFetchApp.fetch(qrApiUrl);
return response.getBlob().setName("upi-qr-" + invoiceNumber + ".png");
}
function attachQrToClientInvoice(docId, invoiceData) {
var doc = DocumentApp.openById(docId);
var body = doc.getBody();
var qrBlob = generateUpiQrBlob("billing@icici", "Synbus Solutions", invoiceData.amount, invoiceData.invNumber);
// Find placeholder {{UPI_QR_CODE}} in Google Doc and replace with Image
var searchResult = body.findText("{{UPI_QR_CODE}}");
if (searchResult) {
var element = searchResult.getElement();
var parent = element.getParent();
parent.asParagraph().appendInlineImage(qrBlob);
element.removeFromParent();
}
doc.saveAndClose();
}WhatsApp Invoice Dispatch: Delivering One-Tap UPI Links via Chatofy & Cloud API
More than 85% of Indian retail and business transactions are initiated over mobile. While scannable QR codes work seamlessly on desktop invoices, asking a mobile user looking at a WhatsApp PDF invoice to scan a QR code displayed on their own phone screen creates severe UX friction.
To solve this, modern businesses send both a PDF attachment and a clickable one-tap UPI deep link in their WhatsApp payment notification message using the WhatsApp Business Cloud API or Chatofy.
When a customer taps a upi://pay deep link directly from WhatsApp on Android or iOS, their operating system launches the native app switcher, allowing them to authenticate with fingerprint or UPI PIN in Google Pay or PhonePe in under 5 seconds.
Mobile Deep Linking Nuance: On desktop computers, clicking upi:// will result in an unhandled protocol alert because macOS and Windows do not have native UPI apps. Always pair mobile deep links with a high-resolution QR code image for desktop recipients.
Truth-in-Engineering: Payment Reconciliation Realities & Protecting Against Fraud
A dangerous myth perpetuated across marketing blogs claims that 'using a Google Sheets formula automatically updates your spreadsheet when the customer pays'. This claim is completely false and operationally dangerous.
NPCI peer-to-peer (P2P) and basic peer-to-merchant (P2M) UPI deep links operate over closed interbank settlement rails. They do NOT fire webhooks to your Google Sheet, website server, or CRM without a formal banking aggregator API connection. When money hits your bank account via a direct UPI QR code, Google Sheets has no native knowledge of the incoming credit.
To reconcile payments safely without falling victim to payment fraud or fake screenshot generation apps, implement one of the following verified workflows:
- Require 12-Digit UTR Submission: Never mark an invoice as paid based solely on a customer screenshot. Mandate that clients submit their 12-digit Unique Transaction Reference (UTR) number or UPI Reference ID via a Google Form or WhatsApp bot.
- Automated Bank SMS / Statement Sync: Configure automated email or SMS parsers connected to your bank's transaction alerts to extract incoming credits and automatically match UTRs against open Google Sheets invoice rows.
- Merchant Virtual VPA Accounts: If your organization requires programmatic, real-time webhooks, register for a Merchant Virtual Account (such as ICICI Eazypay, Razorpay Smart Collect, or Cashfree Virtual UPI). These assign unique VPAs per client and fire verified JSON webhooks upon receipt.
- Daily NPCI Limits: Be aware of standard transaction ceilings. Normal P2P UPI transfers have a default daily limit of ₹1,00,000 per bank account, while verified merchant accounts (P2M) support up to ₹5,00,000 for approved categories.
Related Insights & Guides
The Complete Guide to WhatsApp Business-Scoped User IDs (BSUID): Webhook Migration & Why Chatofy is Already BSUID-Ready
Meta is rolling out WhatsApp Usernames and Business-Scoped User IDs (BSUID), stripping unconsented phone numbers from webhooks. Discover how BSUID works, why legacy CRMs and webhook parsers will break, how to migrate your database schemas, and why Chatofy is already 100% BSUID-ready.
How to Shorten Google Forms Links in Google Sheets
Shorten the long Google Forms links in your spreadsheet, and the URLs people submit through a form, with a no-code add-on or a simple Apps Script.
How to Automate Tally Prime Receivables & Debtor Aging Reports in Google Sheets
Stop wasting hours manually calculating debtor aging buckets in Excel. Discover how to automatically extract bill-wise receivables from Tally Prime into Google Sheets, automate 0-30, 31-60, 61-90, and 90+ day buckets, and empower sales reps in the field with live credit visibility.
Ready to Eliminate Repetitive Manual Work?
Schedule a 30-minute operational discovery call. We'll audit your spreadsheets, CRM, and communication channels to build an automated architecture.

