[Internal Review]Post an UPI Consent Transaction
The following parameters must be posted using the _payment API for cross-border payment for UPI:
Step 1: Post the consent transaction to PayU
The following are the additional request parameter required for cross-border payments with all of the above integrations.
Environment
| Test Environment | https://test.payu.in/_payment |
| Production Environment | https://secure.payu.in/_payment |
Request parameters
<th style={{ textAlign: "left" }}>
**Description**
</th>
<th style={{ textAlign: "left" }}>
**Example**
</th>
</tr>
</thead>
<tbody>
<tr>
<td style={{ textAlign: "left" }}>
key
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` Merchant key provided by PayU during onboarding.
</td>
<td style={{ textAlign: "left" }}>
JPg\*\*\*\*f
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
txnid
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The transaction ID is a reference number for a specific order that is generated by the merchant.
</td>
<td style={{ textAlign: "left" }}>
ypl938459435
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
amount `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The payment amount for the transaction.
</td>
<td style={{ textAlign: "left" }}>
10.00
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
productinfo `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` A brief description of the product.
</td>
<td style={{ textAlign: "left" }}>
iPhone
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
firstname `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The first name of the customer.
</td>
<td style={{ textAlign: "left" }}>
Ashish
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
lastname `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The last name of the customer.
</td>
<td style={{ textAlign: "left" }}>
Kumar
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
email
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The email address of the customer.
</td>
<td style={{ textAlign: "left" }}>
[[email protected]](mailto:[email protected])
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
phone
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The phone number of the customer.
</td>
<td style={{ textAlign: "left" }}></td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
address1 `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The first line of the billing address. H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai **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.
</td>
<td style={{ textAlign: "left" }}>
34 Saikripa-Estate, Tilak Nagar
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
address2 `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The second line of the billing address.
</td>
<td style={{ textAlign: "left" }}></td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
city
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The city where your customer resides as part of the billing address.
</td>
<td style={{ textAlign: "left" }}>
Mumbai
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
state
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The state where your customer resides as part of the billing address.
</td>
<td style={{ textAlign: "left" }}>
Maharashtra
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
country `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The country where your customer resides.
</td>
<td style={{ textAlign: "left" }}>
India
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
zipcode `mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` Billing address zip code is mandatory for the cardless EMI option. Character Limit-20
</td>
<td style={{ textAlign: "left" }}>
400004
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
pg
`mandatory for seamless/s2s flow`
</td>
<td style={{ textAlign: "left" }}>
`String` It defines the payment category and post **UPI**.
</td>
<td style={{ textAlign: "left" }}>
UPI
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
bankcode `mandatory for seamless/s2s flow`
</td>
<td style={{ textAlign: "left" }}>
`String` Each payment option is identified with a unique bank code at PayU. For UPI Autopay, post **UPI**.
</td>
<td style={{ textAlign: "left" }}>
UPI
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
surl
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The success URL, which is the page PayU will redirect to if the transaction is successful.
</td>
<td style={{ textAlign: "left" }}></td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
furl
`mandatory`
</td>
<td style={{ textAlign: "left" }}>
`String` The Failure URL, which is the page PayU will redirect to if the transaction is failed.
</td>
<td style={{ textAlign: "left" }}></td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
udf1
`mandatory if AD bank request this detail`
</td>
<td style={{ textAlign: "left" }}>
`String` This parameter must contain the Buyer's PAN and date of birth in the following format (separated by two pipe characters): Buyer's PAN||Buyer'sDOB
</td>
<td style={{ textAlign: "left" }}>
AAAPZ1234C||22/08/1972
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
udf3
`mandatory if AD bank request this detail`
</td>
<td style={{ textAlign: "left" }}>
`String` This parameter must contain the invoice ID of the transaction (generated by the merchant) and merchant name in the following format (separated by two pipe characters): Invoice ID||MerchantName
</td>
<td style={{ textAlign: "left" }}>
INV-123\_1231||MerchantName
</td>
</tr>
</tbody>
Notes:For UDF parameters, the following are applicable:
- udf1: This parameter must contain the buyer’s PAN (Permanent Account Number). If the transaction is of UPI mandate or UPI recurring then udf1 should contain the “Buyer's PAN and date of birth in the following format (separated by two pipe characters): Buyer's PAN||Buyer's DOB
- udf3: This parameter must contain the buyer’s DOB. If the transaction is of UPI mandate or UPI recurring then udf1 should contain the “invoice ID of the transaction (generated by the merchant) and merchant name in the following format (separated by two pipe characters): InvoiceID||MerchantName” (where, MerchantName is required for PA2PA integrations only)
- udf4 This parameter must contain the “MerchantName” passed in udf3 in case of PA2PA integration, for UPI mandate consent and recurring transaction, this parameter value should not be passed.
udf5: This parameter must contain the “invoiceId” for every merchant, this field is mandatory during or after the transaction(using the udf_update API post successful transaction.
Sample request
curl --location 'https://test.payu.in/_payment' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'key=PRiQvJ' --data-urlencode 'txnid=my_order_64240' --data-urlencode 'amount=5' --data-urlencode 'productinfo=asfas' --data-urlencode '[email protected]' --data-urlencode 'phone=8688359250' --data-urlencode 'txn_s2s_flow=4' --data-urlencode 'hash={{hash}}' --data-urlencode 'pg=UPI' --data-urlencode 'bankcode=UPI' --data-urlencode 'surl=https://test.payu.in/admin/test_response' --data-urlencode 'furl=https://test.payu.in/admin/test_response' --data-urlencode 'udf1=' --data-urlencode 'udf2=' --data-urlencode 'udf3=' --data-urlencode 'udf4=' --data-urlencode 'udf5=' --data-urlencode 'si_details={"billingAmount":"10.00","billingCurrency":"INR","billingCycle":"ADHOC","billingInterval": 1,"paymentStartDate":"2024-11-19","paymentEndDate":"2025-12-01"}' --data-urlencode 'api_version=7' --data-urlencode 'si=1' --data-urlencode 'vpa=9999999999@upi' \
--data-urlencode 'firstname=sudhanshu' --data-urlencode 'lastname=kr' --data-urlencode 'address1=308,third floor' --data-urlencode 'address2=testing' --data-urlencode 'city=ggn' --data-urlencode 'state=UP' --data-urlencode 'country=IND' --data-urlencode 'zipcode=122018'Step 2: Check the response from PayU
Step 2: Sample response
-
The formatted response for UPI Consent Transaction is similar to the following:
[mihpayid] => 403993715525317379 [mode] => UPI [status] => success [unmappedstatus] => captured [key] => JPM7Fg [txnid] => 4eZz2lMbUYQ4c0 [amount] => 10.00 [discount] => 0.00 [net_amount_debit] => 10 [addedon] => 2022-02-02 16:00:53 [productinfo] => iPhone [firstname] => PayU User [lastname] => [address1] => [address2] => [city] => [state] => [country] => [zipcode] => [email] => [email protected] [phone] => 9876543210 [udf1] => [udf2] => [udf3] => [udf4] => [udf5] => [udf6] => [udf7] => [udf8] => [udf9] => [udf10] => [hash] => 1b1df6deb730c4826341e35b9b010497f524c88e3cee05287f0148dd302f81ab45503a27f43d492d127134cf5983eab1042930f10a04f27a094e19c500644104 [field1] => anything@payu [field2] => 4eZz2lMbUYQ4c0 [field3] => [field4] => PayU User [field5] => AXIDI0zH6YxpU1eCukPM4fBdnxkf54cEKbt [field6] => [field7] => Transaction completed successfully [field8] => [field9] => Transaction completed successfully [payment_source] => sist [PG_TYPE] => UPI-PG [bank_ref_num] => 4eZz2lMbUYQ4c0 [bankcode] => UPI [error] => E000 [error_Message] => No Error
Step 3: Verify Payment
Upon receiving the response, PayU recommends you performing a reconciliation step to validate all transaction details.
You can verify your payments using either of the following methods:
Configure the webhooks to monitor the status of payments.
Webhooks enable a server to communicate with another server by sending an HTTP callback or message.
These callbacks are triggered by specific events or instances and operate at the server-to-server (S2S) level.
Know how to manage Webhooks for Payments.
