NPCI Unified Payments Interface Standard
API Reference
Zero-intermediary HTTP endpoints for constructing RFC-compliant upi://pay barcodes and rendering Base64 image payloads or direct PNG byte streams.
Standard Payload Parameters
All endpoints consume the following query parameters or JSON body fields:
| Key | Type | Required | Description | Example |
|---|---|---|---|---|
pa |
String | Yes | Payee VPA (UPI ID). Must match identifier@bank. |
store@okhdfcbank |
pn |
String | No | Payee or merchant trading name. | Studio Acme |
am |
Number | No | Transaction amount. Formats automatically to 2 decimal places. | 299.00 |
tn |
String | No | Transaction note/memo shown in payer's banking app. | Invoice 401 |
tr |
String | No | Transaction reference code for settlement reconciliation. | INV-0912 |
mc |
String | No | 4-digit ISO/NPCI Merchant Category Code. | 5411 |
cu |
String | Auto | Currency code. Locked permanently to INR. |
INR |
Endpoints
JSON response with Base64 QR code and full URI
Constructs the formatted NPCI URI and returns a JSON payload containing the encoded string alongside a raster Data URL ready for direct rendering in an HTML <img> element.
Example Request
curl -X GET "https://platenupi.onrender.com/api/qr/generate?pa=store@okhdfcbank&pn=Corner+Coffee&am=150.00"
Example 200 OK Response
{
"success": true,
"upiUri": "upi://pay?pa=store%40okhdfcbank&pn=Corner+Coffee&am=150.00&cu=INR",
"qrImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAYAAADk..."
}
Direct PNG byte stream (image/png)
Returns the binary barcode as an image/png response stream. Embed this directly into websites, emails, or PDF invoices without client-side scripts.
Direct Image Tag Usage
<img src="https://platenupi.onrender.com/api/qr/image?pa=billing@icici&pn=Studio+Acme&am=500" alt="UPI Barcode" />
Live Endpoint Tester
200 OK — image/png