This section provides the request parameters, sample request and response for a UPI Recurring Payment <<glossary:Consent transaction>>.
Note:
- During integration with PayU, first integrate with the Test Server environment. PayU will provide you the necessary Merchant Key for the test serve. After testing is done, you are ready to move to the Production server.
- Unlike Cards
HTTP Method: POST
Request parameters
In the merchant-initiated POST REQUEST, Hash is a mandatory parameter. It is critical to calculate the hash correctly and post it to PayU in the request.
Parameter | Description | Value |
---|---|---|
key |
|
Your Test Key |
api_version |
|
7 |
txnid |
|
s7hhDQVWvbhBdN |
amount |
|
10.00 |
productinfo |
|
iPhone |
firstname |
|
Ashish |
email |
|
|
phone |
|
9876543210 |
lastname |
|
Verma |
address1 |
|
H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai |
address2 |
|
34 Saikripa-Estate, Tilak Nagar |
city |
|
Mumbai |
state |
|
Maharashtra |
country |
|
India |
zipcode |
|
400004 |
surl |
|
|
furl |
|
|
hash |
|
|
pg |
|
UPI |
bankcode |
varchar This parameter contains UPI or INTENT for UPI. |
UPI |
si |
This parameter signifies a successful consent taken from the user by the merchant. This parameter must contain 1 for a successful consent. Without this parameter sent as 1, subscription cannot be set up. |
|
si_details |
This parameter represents mandatory details which need to be passed to during registration transaction from merchant system to PayU. Note: It is mandatory as per the latest RBI guidelines to pass this information to the payment processor so that same can be forwarded to acquirers and issuers ( for more details refer – https://www.rbi.org.in/Scripts/NotificationUser.aspx?Id=11668&Mode=0 ) This is a JSON object and it includes a set of fields. For more information, refer to SI Parameter JSON Details |
|
vpa |
The merchant is advised to check the validity of the VPA through using the VPA Validation API. PayU extends support for the same if required. For more information on using VPA Validation API, refer to Validate VPA Handle API. |
abc@upi |
txn_s2s_flow |
|
4 |
Notes
The bankcode parameter value can be any of the following:
- UPI: Pass this value for UPI transactions.
- INTENT: Pass this value for Intent.
For more information on bank codes used for recurring payments registration, refer to Bank Codes - Recurring Payments
Characters allowed for parameters
For parameters address1, address2, city, state, country, product info, email, and phone following characters are allowed:
- Characters: A to Z, a to z, 0 to 9
- – (Minus)
- _ (Underscore)
- @ ()
- / (Slash)
- (Space)
- . (Dot)
Sample request
The sample code block for UPI Seamless integration (Merchant-Hosted Checkout) is similar to the following code block:
Note:
Before you make payment request to PayU, it is recommended to validate the UPI handle provided by your customer is eligible for recurring payment using the validateVPA API to avoid transaction failure. For more information, refer to Validate VPA API.
UPI Consent Transaction
curl -X \
POST "https://test.payu.in/_payment-H "accept: application/json" -H \
"Content-Type: application/x-www-form-urlencoded" -d”key=Q*****U&txnid=4eZz2lMbUYQ4c0&amount=10.00&firstname=Payu-Admin&[email protected]&phone=1234567890&productinfo=iPhone&api_version=7&si=1&pg=UPI&bankcode=UPI&vpa=anything@payu&surl=https://test.payu.in/admin/test_response
/&furl=https://test.payu.in/admin/test_response&si_details={“billingAmount”: “10.00”,”billingCurrency”: “INR”,”billingCycle”: “MONTHLY”,”billingInterval”: 1,”paymentStartDate”: “2019-09-01″,”paymentEndDate”: “2019-12-01”}
&hash=e36568b2dfc460eab0eb3387fb7d90543ed861154f273b9593d6fcc152ed93a91e529c2f4be0965eeb57104e82d58889fa5efb52811ec78cbd1ad646e39c29a0”
UPI Intent
curl -X \
POST "https://test.payu.in/_payment-H "accept: application/json" -H \
"Content-Type: application/x-www-form-urlencoded" -d”key=Q*****U&txnid=4eZz2lMbUYQ4c0&amount=10.00&firstname=Payu-Admin&[email protected]&phone=1234567890&productinfo=iPhone&api_version=7&si=1&pg=UPI&bankcode=INTENT&txn_s2s_flow=4&surl=https://test.payu.in/admin/test_response
/&furl=https://test.payu.in/admin/test_response&si_details={“billingAmount”: “10.00”,”billingCurrency”: “INR”,”billingCycle”: “MONTHLY”,”billingInterval”: 1,”paymentStartDate”: “2019-09-01″,”paymentEndDate”: “2019-12-01”}
&hash=e36568b2dfc460eab0eb3387fb7d90543ed861154f273b9593d6fcc152ed93a91e529c2f4be0965eeb57104e82d58889fa5efb52811ec78cbd1ad646e39c29a0”
Understanding Response
For also UPI registration transaction, you must ensure that the payment response from PayU has the expected values as described in the following table so that the UPI registration is successful or initiated successfully with the customer’s bank or UPI provider.
Response Parameter | Expected Value | Description |
---|---|---|
status | success | Indicates that the transaction is successful with the UPI provider |
payment_source | SIST | Indicates that UPI details have been marked correctly for Standing Instruction |
mihpayid | <mihpayid number> sent. by PayU | Indicates PayU’s transaction acknowledgment for a Consent transaction |
The response URL returned from PayU is in the form URL format (application/x-www-form-urlencoded).
Sample response
- The formatted response for UPI Consent Transaction is similar to the following:
Array
(
[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
)
- The formatted response for UPI Intent:
{
"metaData":{
"message":null,
"referenceId":"5ae6e6d94b4b5f9dee282b95f6020c98",
"statusCode":null,
"txnId":"40d553e62525a03e5c54",
"txnStatus":"pending",
"unmappedStatus":"pending"
},
"result":{
"paymentId":"15257049438",
"merchantName":"smsplus",
"merchantVpa":"growfitter.payu@hdfcbank",
"amount":"1.90",
"intentURIData":"upi:\/\/mandate?pa=growfitter.payu@hdfcbank&pn=IBIBO GROUP PRIVATE LIMITED&mn=&tid=40d553e62525a03e5c54&validitystart=30052022&validityend=01092022&am=10.00&amrule=MAX&recur=MONTHLY&recurvalue=30&recurtype=&tr=15257049438&cu=INR&mc=5411&tn=UPI Transaction for 40d553e62525a03e5c54&mode=13&purpose=14&orgid=159240&rev=Y&block=N&txnType=CREATE",
"postToBank":{
"token":"C6ABAA6A-F0CE-432A-61C1-CFA48EDE847B",
"amount":"1.90",
"mihpayid":"5ae6e6d94b4b5f9dee282b95f6020c98",
"disableIntentSeamlessFailure":"0",
"payeeVpa":"growfitter.payu@hdfcbank",
"payeeName":"smsplus",
"additionalCharges":0,
"transactionFee":"1.90"
},
"issuerUrl":"https:\/\/secure.payu.in\/591d096c5495eff4234e95eb64a1e1b8\/intentSeamlessHandler.php"
}
}
Webhook for Getting Transaction Details
You can expose a webhook by requesting the PayU Integration team to configure the same against the ws_online_response parameter. If this webhook is configured, you will receive the above response object over HTTP form post method similar to the following:
unmappedstatus=success&phone=9999999999&txnid=FCDA1R100870163781&hash=84e335094bbcb2ddaa0f9a488eb338e143b273765d89c9dfa502402562d0b6f3c7935e28194ca92f380be7c84c3695415b106dcf52cb016a15fcf6adc98d724&status=success&curl=https://www.abc.in/payment/handlepayuresposne&firstname=NA&card_no=519619XXXXXX5049&furl=https://www.abc.in/payment/handlepayuresposne&productinfo=2&mode=DC&amount=800.00&field4=6807112311042810&field3=6807112311042810&field2=838264&field9=SUCCESS&email=NA&mihpayid=175477248&surl=https://www.ABC.in/payment/handlepayuresposne&card_hash=9e88cb0573d4a826b61d808c0a870ed4a990682459b0ec9e95ea421e8e47be8c&field1=42812&payment_source=sist
If the mandate is not confirmed by the customer or the mandate is confirmed by the customer, but the mandate registration is rejected from the banks, the status is communicated as a “failure” over webhook. For more information, refer to Set up WebHook to Receive Cancellation or Modification Update from the Issuer Bank