The dynamic QR generation API returns a UPI QR which can be used for offline payment collections.
Environment
Environment | URL |
---|---|
Production | https://secure.payu.in/\_payment |
Request parameters
Parameter | Description |
---|---|
keymandatory | String Merchant key provided by PayU during onboarding. For more information, refer to Access Production Key and Salt. |
txnidmandatory | String The transaction ID is a reference number for a specific order that is generated by the merchant. |
amountmandatory | String The payment amount for the transaction. |
productinfo mandatory | String A brief description of the product. |
firstnamemandatory | String The first name of the customer. |
emailmandatory | String The email address of the customer. |
phonemandatory | String The phone number of the customer. |
pgmandatory | String It defines the payment category that the merchant wants the customer to see by default on the PayU’s payment page. This field must contain the value as "DBQR" for Dynamic BQR transactions. |
bankcode mandatory | String Each payment option is identified with a unique bank code at PayU. It must include "UPIDBQR" for Dynamic BQR transaction |
hashmandatory | String It is the hash calculated by the merchant. The hash calculation logic is:sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT) |
s2s_client_ipmandatory | String This parameter must have the source IP of the user's device.Note: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. |
s2s_device_infomandatory | String This parameter must have the user agent of deviceNote: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. |
txn_s2s_flowmandatory | String This parameter must be posted with the values a 4 for transaction flow. |
expiry_timeoptional | String If you want the QR to expire after a particular time, you can pass the value in seconds in this key, if nothing is sent the default expiry time is 30 minutes |
address1optional | String The first line of the billing address.For Fraud Detection: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. |
address2optional | String The second line of the billing address. |
cityoptional | String The city where your customer resides as part of the billing address. |
stateoptional | String The state where your customer resides as part of the billing address, |
countryoptional | String The country where your customer resides. |
zipcodeoptional | String Billing address zip code is mandatory for the cardless EMI option.Character Limit -20 |
udf1optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5. |
udf2optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5. |
udf3optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. |
udf4optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. |
udf5optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. |
Hashing
You must hash the request parameters using the following hash logic:
sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)
For more information, refer to Generate Hash.
Sample request
curl --request POST \
--url https://test.payu.in/_payment \
--header 'accept: text/plain' \
--header 'content-type: application/x-www-form-urlencoded' \
--data key=JPM7Fg \
--data txnid=aso6787 \
--data amount=100.00 \
--data productinfo=Test \
--data firstname=Ashish \
--data email=Kumar \
--data phone=934123456 \
--data pg=DBQR \
--data bankcode=UPIDBQR \
--data hash=8b58ae0706c955d870f2ce7d9ee25bae5c6711436b64074ad35e07a6a3f669d2d2b32259607109ea59fd07e9df60af544221b3edddc955b2e97dd177e6536321 \
--data s2s_client_ip=192.1.1.1 \
--data s2s_device_info=Mozilla Firefox \
--data txn_s2s_flow=4 \
--data expiry_time=30
Sample response
{
"metaData": {
"message": null,
"referenceId": "81d99ec11b341fdcb7bc1a7be39eac61",
"statusCode": null,
"txnId": "202501081516542581",
"txnStatus": "pending",
"unmappedStatus": "pending"
},
"result": {
"paymentId": "22095839016",
"merchantName": "bajajfinserv",
"merchantVpa": "bajajfinserv.QR2.payu@indus",
"amount": "3223.00",
"qrString": "upi://pay?pa=bajajfinserv.QR2.payu@indus&pn=Bajaj Finance limited&tr=22095839016&tid=PPPL22095839016080125151654677e498e&am=3223.00&cu=INR&tn=UPI Transaction",
"otpPostUrl": "https://secure.payu.in/ResponseHandler.php"
}
}
Next steps:
After your perform the above, you need to perform the following:
- Check UPI transaction status: Check the transaction status using the Verify Payment API (verify_payment) API. For more information, refer to Verify Payment API.
- Check the S2S callback response: The response to this call would be a base64 encoded JSON containing transaction ID and other transaction details. This is similar to Step4 of UPI Collection - S2S.