Generate QR Code
A simple guide on how to generate QR code.
This guide outlines the steps for generating a UPI QR code, facilitating a streamlined payment gateway for Onramp users. By leveraging UPI deep linking, we provide a frictionless payment experience, crucial for businesses and developers who require an efficient transaction process.
Generating UPI QR Codes
To offer a seamless UPI-based payment flow, Onramp utilizes UPI deep linking to generate a QR code. The UPI (Unified Payments Interface) deep linking allows the integration of payment details directly into the QR code, simplifying the payment procedure for users.
Here is a sample response when an order is created using create transaction.
{
"status": 1,
"code": 200,
"data": {
"transactionId": "636",
"createdAt": "2023-12-08 00:55:24",
"fiatAmount": "123.06",
"fiatPaymentInstructions": {
"type": "UPI",
"upi": {
"vpa": "onramp@hdfcbank",
"name": "Onramp money"
},
"upiNotes": [
{
"type": 1,
"msg": "Try Bank transfer from UPI apps if UPI deposit fails."
}
],
"otp": "1313"
}
}
}status -> 0 is for unsuccessful request, 1 is for a successful one
transactionId -> unique identifier of the transaction
createdAt -> time at which the transaction was created.
fiatAmount -> The amount of fiat that the user would deposit to their bank account.
fiatPaymentInstructions -> This contains the payment instructions.
type -> payment method type
upi -> UPI details to which the deposit needs to be made.
upiNotes -> additional information regrading bank account and current status.
otp -> reference number (or aka confirmation code)
Here are a few examples of UPI deep links for different UPI-enabled apps:
Paytm:
paytmmp://pay?pn=merchantName&pa=merchantname@hdfcbank&am=1.00&tn=1234PhonePe:
phonepe://pay?pn=merchantName&pa=merchantname@hdfcbank&am=1.00&tn=1234Google Pay:
gpay://upi/pay?pn=merchantName&pa=scrol@hdfcbank&am=1.00&tn=1234BHIM:
bhim://mandate?pn=merchantName&pa=merchantname@hdfcbank&am=1.00&tn=1234UPI:
upi://pay?pn=merchantname&pa=merchantname@hdfcbank&am=123.06&tn=1234
Explanation of the deep link components:
pay: UPI transaction type (payment request).pn: Payee name (e.g. merchantName -> Onramp money).pa: Payee UPI ID (e.g. merchantname@hdfcbank -> onramp@hdfcbank).am: Amount to be paid in INR(₹)(e.g. ₹100.00 or ₹123.06).tn: Transaction note (e.g. otp -> 1313) .
UPI deep link QR code example
To view and test the code to generate deep link UPI QR codes, please explore the codePen block below.
Last updated