Transaction API
When customers select the UPI QR Code payment option, merchants have to call the below transaction API. From the transaction API response, merchants will use the sdk_params for constructing the URI, which will be utilized for generating the QR code. The customer scans the QR code using the UPI app installed on their device and completes the payment.
Basic Parameters
order_id pertaining to the order for which the payment is started.
ID of the merchant_account that you hold with us.
Must be UPI
Must be UPI
Must be UPI_QR
This is a boolean variable and accepts true/false. We recommend that you set this to true. If set to true, then the user is redirected to the return\_url configured for the order. If set to false, then the user will be stopped at the response page from the gateway. Your client should be able to read the page/title to infer that the user has completed the transaction.
If it is set to json, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 302 with the Location attribute having the destination URL.
Must be true
Construction of UPI Pay String code through the string mentioned
The sdk_params obtained in the response of the UPI transaction call should be used for constructing the Intent URI.
Sample URI:
upi://paytr=202101345671229366&tid=121313202101345671229366&pa=juspay@axisbank&mc=1234&pn=Merchant%20Inc&am=1.00&cu=INR&tn=Pay%20for%20merchant
Format:
upi://pay?tr=...(enter the tr).......&tid=...(enter the tid).......&pa=.....(enter merchant_vpa)...&mc=....(enter the mcc)...&pn=....(enter
the Merchant name)...&am=.....(enter the amount).....&cu=INR&tn=....(description for the transaction)..
In the URI spaces are replaced by "%20". The URI is encoded. Kindly generate the intent URI dynamically ie, based on the params received in the sdk_params response. Do not hardcode any keys or values as it can differ with different PG’s.
For example, if you do not receive the "tid" value in the transaction API response, you would need to exclude the "tid" parameter in the URI.
URI Format without tid:
upi://pay?tr=...(enter the tr).......&pa=.....(enter merchant_vpa)...&mc=....(enter the mcc)...&pn=....(enter
the Merchant name)...&am=.....(enter the amount).....&cu=INR&tn=....(description for the transaction)..
UPI QR Code image generation has to be completely handled by the merchant. Once the URI is generated, merchants have to create the UPI QR Code image with the generated URI.
There are several Js libraries that help in generating QR code.
Sample library : https://www.npmjs.com/package/qrcode
- Have questions?
- Need help? Contact support
- LLM? Read llms.txt

