The Print Invoice QR API is used to generate Dynamic UPI QR which can be printed on merchant Invoice. Each QR can be associated to respective Amount and Order no which can be used to accept unique payments. GST details can also be captured and linked during QR code generation.
Example
The Print Invoice QR API can be used by large distributors who accept payments from their buyers by raising periodic Invoice and payment is made by the buyers post receipt of the Invoice. Here these distributors can generate Print Invoice QR and print it in the Invoice which basically gives the buyers an option to scan and make UPI based payments against the invoice. Since the QR will have invoice details embedded during generation transactions are automatically reconciled.
This API generate UPI or BQR QR. This API returns either Base64, string or image format of the QR based on the request type.
Environment | URI |
---|---|
Production | https://info.payu.in/merchant/postservice.php |
Request parameters
Parameter | Description | Sample Value |
---|---|---|
key
| string This parameter must include the merchant key that was provided by PayU.
| Your Test Key |
command |
| generate_invoice_qr |
hash |
sha512(key|command|var1|salt) sha512 is the encryption method used here. | ajh84babvav |
var1 |
| Refer the VAR SAMPLE section. |
Fields in var1 Parameter Description
Field | Description | Example |
---|---|---|
transactionId
|
| 1234_abcdedf |
transactionAmount |
| 1005, 1042.23, 95494.4, 10000.00 |
merchantVpa |
| yellowqr. payu@hdfc |
expiryTime |
| 3600 |
qrName |
| PayU |
qrCity |
| Gurgaon |
qrPinCode |
| 122001 |
customerName |
| Ravi |
customerCity |
| 122001 |
customerPhone |
| 9833207164 |
customerEmail |
| |
customerAddress |
| Payu, Bestech Business Tower, Gurgaon |
udf3 - udf5 |
| |
qrType |
bqr | upi or bqr |
outputType |
base64 | base64, string, image |
gst |
| 100.25 |
cgst |
| 25.45 |
sgst |
| 25.45 |
igst |
| 50.9 |
cess |
| 10.2 |
gstIncentive |
| 10.2 |
gstPercentage |
| 18 |
gstIn |
| 24AAACC1206D1ZM |
invoiceName |
| Bill |
invoiceNo |
| 78457637 |
invoiceDate |
| 2021-05-21T13:21:50+05:30 |
purpose |
| 3 |
refUrl | string This field can be used to share invoice copy or any other transaction related information/documents to customer for their reference. | |
category | string This field is mandatory when refUrl is passed. Use any of the following based on the purpose: 01 for advertisement | 01 or 02 |
txnNote |
| Loan Repayment |
var1 sample
The var1 parameter is similar to the following JSON format and description of fields in the JSON is described in the following table:
{
"transactionId": "delhivery_1",
"transactionAmount": "1",
"merchantVpa": "yellowqr.payutestdynamicqr@hdfcbank",
"expiryTime": "3600",
"qrName": "ronaldo",
"qrCity": "gurugram",
"qrPinCode": "122001",
"customerName": "Messi",
"customerCity": "hyderabad",
"customerPinCode": "500072",
"customerPhoneNumber": "7060334501",
"customerEmail": "[email protected]",
"customerAddress": "bestech business tower, sohna road, sector 48, gurgaon,122001",
"gst": "110",
"cgst": "25",
"sgst": "25",
"igst": "50",
"cess": "10",
"gstIncentive": "10",
"gstPercentage": "18",
"gstIn": "24AAACC1206D1ZM",
"invoiceName": "Javed H",
"invoiceNo": "78457637",
"invoiceDate": "2021-05 21T13:21:50+05:30",
"purpose": "03",
"refUrl": "https://payu.in/",
"category": "02",
"txnNote": "Loan Payment"
}
Sample request
curl --location --request POST 'https://info.payu.in/merchant/postservice.php?form=2' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'command=generate_invoice_qr' \
--data-urlencode 'key =J****g' \
--data-urlencode 'hash =c0110b439987304598edc8871e4b134262dbbd6b3b64532fa2731d50aadf03c5dec0958de560a2011b35f01a719ab8ca246bfd6dcfa6ecf4b4100b07e0635322' \
--data-urlencode 'var1 ={"transactionId":"DBQR000479","transactionAmount":"1","outputType":"string","qrType":"upi"}'
Response parameters
OutputType | Description |
---|---|
image | Image of the QR code will be returned, either BQR or UPI QR |
string | Qr String is plain text will be returned in response along with QR ID & VPA associated to the QR, the QR string can be converted into image and used for accepting transactions |
base64 | Base 64 encoded string will be returned in response along with QR ID & VPA associated to the QR, the encoded string provides a layer of security which can be eventually converted into image and used for accepting transactions |
Sample response
- UPI
{
"qrString": "upi://pay?pa=gauravdua1.payu@indus&pn=J****g&mc=7399&tr=P-424951&ver=01&mode=15&orgid=000000&qrMedium=06&cu=INR&purpose=02&pinCode=122002&am=1.00&QRexpire=2021-08-25T21:58:08+05:30",
"msg": null
}
- BQR
{
"qrString": "000201010211021644038470007469080415522024070007469061661000307000746960825HDFC00006225020001855322626470010A0000005240129yellowqr.payutest.94@hdfcbank27370010A0000005240119STQ9y45z1cv3z5450925204569153033565802IN5910vendorName6010vendorCity610650017262350519STQ9y45z1cv3z545092070870007469630417EF",
"msg": null
}