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
Parameter | Description | Example |
|---|---|---|
key
|
| JPg****f |
txnid
|
| ypl938459435 |
amount |
| 10.00 |
productinfo |
| iPhone |
firstname |
| Ashish |
lastname |
| Kumar |
email
|
| |
phone
|
| |
address1 |
| 34 Saikripa-Estate, Tilak Nagar |
address2 |
| |
city
|
| Mumbai |
state
|
| Maharashtra |
country |
| India |
zipcode |
| 400004 |
pg
|
| UPI |
bankcode |
| UPI |
surl
|
| |
furl
|
| |
udf1
|
| AAAPZ1234C||22/08/1972 |
udf3
|
| INV-123_1231||MerchantName |
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 ErrorStep 3: Verify Payment
Upon receiving the response, we recommend 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.
👉 For more details, refer to Webhooks for Payments.
Updated about 4 hours ago
