Available in🇮🇳 India
With UPI QR, you show a QR code on your checkout and the customer scans it with any UPI app to pay. Use it on desktop and web checkouts, where you cannot open a UPI app on the same device.
UPI QR uses the same payment API as UPI Intent. You create an intent payment, take the intent link from the response and convert it into a QR code yourself. There is no separate QR payment flow.
Handy TipsRazorpay also has a QR Codes API that creates a separate QR code entity. For an S2S checkout, we recommend converting the intent link into a QR code as described on this page. You work with a single payment and reconciliation is simpler.
Prerequisites
- Generate the API keys from the Dashboard.
- Set up webhooks to know the result of the payment.
- If you are an international business looking to collect payments from Indian customers, refer to our import payment flow documentation.
Integration Steps
- Create an order for the amount you want to collect.
- Initiate the payment with
upi.flowset tointentand take thelinkfrom the response. - Convert the link into a QR code and show it on your checkout.
- Verify the payment status after the customer scans the QR code and approves the payment.
Step 1: Create an Order
Create an order the same way as for UPI Intent. Refer to Create an Order for the request and its parameters.Step 2: Initiate a Payment
Initiate a payment with theintent flow. This is the same call as UPI Intent.
POST /payments/create/upi
The time, in minutes, for which the intent link and the QR code are valid. The minimum value is
5 and the maximum is 5760 (96 hours). The default value is 10.Step 3: Convert the Link into a QR Code
Pass thelink to a QR code generator and show the image on your checkout. You can use any QR code library. The sample below uses the qrcode npm package.
Generate QR code
expiry_time you set. The customer opens any UPI app, scans the QR code, checks the amount and approves the payment with their UPI PIN.
Step 4: Verify the Payment Status
The customer is not redirected to your page after the payment. Verify the status of the payment using the following methods:- Subscribe to the Webhook events. Wait for
payment.capturedon success orpayment.failedon failure. - As a fallback, poll Razorpay servers for the payments made for the order using our Fetch Payment APIs.
payment.failed webhook event. Initiate a new payment and show a new QR code.