Skip to main content
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

Integration Steps

  1. Create an order for the amount you want to collect.
  2. Initiate the payment with upi.flow set to intent and take the link from the response.
  3. Convert the link into a QR code and show it on your checkout.
  4. 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 the intent flow. This is the same call as UPI Intent. POST /payments/create/upi
Refer to Initiate a Payment for all the request parameters. The parameter below controls how long the QR code stays valid.
integer
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.
Pass the link 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
The QR code carries the same intent link, so it is valid for the 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.
Watch Out!
  • Encode the link exactly as you receive it. Do not trim it, HTML-escape it or change any parameter in it.
  • Generate a new QR code for every payment. Do not reuse a QR code across payments, as the reference and the amount in it will be wrong.
  • Show the QR code large enough to scan. Intent links are long, so a small or low-resolution QR code may not scan.
  • Use byte or UTF-8 encoding mode in your QR code library, as the link has characters such as &, = and @.

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: If the customer does not scan the QR code before it expires, the payment fails and you receive the payment.failed webhook event. Initiate a new payment and show a new QR code.

Test the Integration

Once you have completed the integration, test it using our test cases for UPI QR.
Last modified on December 1, 2026