Editorial

What a UPI QR Code Actually Contains

Every UPI QR is one upi://pay text line. What pa, pn, am, tn and tr mean, static vs dynamic codes, and the reused-QR underpay trap.

JJyoti Ranjan SwainUpdated
A UPI QR code decoded into its upi://pay text line with the pa, pn and am fields highlighted

Scan a UPI QR code with a plain QR reader instead of a payment app and you get one line of text back. Something like upi://pay?pa=sharmastores@okaxis&pn=Sharma%20Stores&cu=INR. That's the whole code. There's no hidden account number and no bank data in it. The payment app reads that line, fills in its pay screen, and waits for you to approve.

Once you can read that line, a few everyday UPI puzzles go away: why one QR asks you to type the amount and another doesn't, why a shop's old QR can make a client underpay an invoice, and why your app sometimes warns that it "could not verify the source". The field names below come from NPCI's UPI Linking Specification 1.6, which every UPI app is required to follow.

Table of contents

What a UPI QR code contains

NPCI's spec defines one URL format for every way a payment request can travel: QR, Android intent, NFC, Bluetooth. It looks like this:

text
upi://pay?param-name=param-value&param-name=param-value&...

The QR code is only the carrier. The same string could arrive as a tappable link in WhatsApp or be pushed over NFC, and the app would treat it identically. The spec says so directly: separating the data format from the transfer method is the point.

A UPI QR decoded into its upi://pay text, with pa, pn, am, tn, tr and cu fields labelled

These are the parameters you'll meet on shop counters, invoices and payment screenshots. The spec marks each as mandatory (M), optional (O) or conditional (C), separately for static and dynamic codes.

FieldWhat it holdsStatic QRDynamic QR
paPayee UPI ID, e.g. name@okhdfcbankMM
pnPayee name shown on your pay screenMM
amAmount in decimal, e.g. 5900.00OM
cuCurrency. Only INR is supportedOO
tnShort note, e.g. Invoice INV-104OO
trReference: order number, bill ID, booking IDOC
mcMerchant category codeOO
urlLink to the bill or order detailsOO

Two rules from the spec carry most of the weight. If am is missing, the amount field on your pay screen is editable and you type it yourself. And tr is mandatory for merchant transactions and dynamic codes, because the shop uses it to match your payment to a specific bill.

The spec also lists signing fields (mode, orgid, sign) and merchant IDs (mid, msid, mtid). A personal QR from GPay or PhonePe usually has none of the merchant ones. Google's developer guide for in-app UPI payments builds its example URI from pa, pn, mc, tr, tn, am, cu and url, which matches the table.

Static QR vs dynamic QR

The spec describes both with examples. A small shop "could simply print a static QR code containing the payee address and name", and the customer enters the amount after scanning. A billing counter generates a dynamic QR per bill, with the amount and a reference already inside.

Static UPI QR with only pa and pn versus dynamic QR carrying am and tr for one specific bill

The difference is who types the amount. With a static code you do, so a typo is your problem. With a dynamic code the shop does, and your app shows the amount locked. That's why the sticker on a chaiwala's cart asks you to enter ₹20 and the supermarket's screen doesn't.

Reusing a fixed-amount QR

A dynamic QR is meant for one bill. Trouble starts when it gets reused.

Say a freelancer once saved a QR from a ₹500 payment request, and later pastes that same image onto a ₹5,900 invoice. The code still says am=500.00. The client scans, sees ₹500 locked on the pay screen, approves, and believes the invoice is settled. Nobody typed a wrong number, so nobody notices, and the freelancer is short ₹5,400 until someone reconciles.

Read the am inside any QR before you attach it to a bill. The Invoice Generator now does this: it decodes an uploaded QR, prints the UPI ID under it, and flags a fixed amount that doesn't match the invoice total. If you type your UPI ID instead, it builds a fresh code with am set to the total and tn set to the invoice number, so the client only has to scan and confirm.

The "could not be verified" warning

Version 1.6 of the spec added signing. A merchant or PSP signs the whole upi://pay string with a private key (SHA256 with RSA, base64 encoded) and appends it as sign, which must be the last field. The payer's app checks it against a public key NPCI distributes.

The spec gives three outcomes:

  1. The signature verifies. The app may skip the passcode screen.
  2. The signature fails because the string was changed. The app must decline with "intent is tampered or corrupt".
  3. There is no signature. The app shows a warning that the source "could not be verified" and asks for your passcode as usual.

Most QR codes you see are the third kind, including any you generate yourself from a UPI ID. The warning doesn't mean the code is fake. It means nobody vouched for it, so read the name and amount before you enter your PIN.

Scanning a QR sends money

The link in the spec is upi://pay, and the money goes to the pa inside it. Nothing in the format puts money into the scanner's account. A code always carries somebody else's UPI ID, and scanning it opens a screen to pay that person.

A "scan this QR to receive your refund" message therefore has it backwards. You never scan a code or enter your UPI PIN to receive money. If a buyer on OLX sends you a QR to "get paid", the pa in that code is theirs, and the only thing that can move is your money to them.

Reading a QR before you pay

You can see the raw text without paying anything:

  1. Open your phone camera or any plain QR scanner app, not your UPI app.
  2. Point it at the code and look at the preview text. It should start with upi://pay?.
  3. Check that pa is the UPI ID you expect and pn is the right name.
  4. If there's an am, check that it matches the bill.

Shops need the reverse check. Google's integration guide tells merchants to confirm the paid amount with their PSP or payment aggregator even when the app reports success, "to prevent fraud". A customer's success screenshot is not that confirmation. The bank credit is.

If you take a lot of UPI payments at a counter, the fee side changes from 15 October 2026. Our breakdown of the ₹2,000 line that decides your UPI charge and the UPI MDR Calculator cover what gets deducted before settlement. If you bill clients, generate a fresh code per invoice with the Invoice Generator instead of recycling an old screenshot.

FAQ

What is inside a UPI QR code?

One line of text in the form upi://pay?pa=...&pn=.... It holds the payee's UPI ID and name, and optionally an amount, a note and a bill reference. It doesn't contain a bank account number. pa is the payee address, the UPI ID the money goes to, such as name@okaxis, and it's mandatory in every UPI QR.

Why does one QR let me type the amount and another doesn't?

If the code has no am field, the spec makes the amount editable. A dynamic QR from a billing counter includes am, so your app shows it locked.

Is a QR I generate from my UPI ID safe to put on an invoice?

Yes. It's a normal unsigned static or fixed-amount code. The client's app will show your name and the amount, and may say the source is unverified, which is standard for personal codes.

What is the tr field used for?

tr is a transaction reference such as an order or bill number. The spec makes it mandatory for merchant payments and dynamic QR codes, so the payee can match the payment to the right bill.

Sources

Tools In This Article

Browser-based, no sign-up. Try them while the topic is fresh.

More From ToolMintX

Other Blog Posts