UPI Recurring Payment Consent Transaction

This section provides the request parameters, sample request and response for a UPI Recurring Payment consent transaction

HTTP Method: POST

Environment

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.

ParameterDescriptionValue
key
mandatory
String The merchant key is a unique identifier for a merchant account in PayU's database.Your Test Key
api_version
optional
String The API version for this API.1
txnid
mandatory
String The transaction ID is a reference number for a specific order that is generated by the merchant. It is used to track the order and must be unique. PayU's system will not accept duplicate transaction IDs.s7hhDQVWvbhBdN
amount
mandatory
String This field should contain the payment amount for the transaction.10.00
productinfo
mandatory
String It should be a string containing a brief description of the product.Character Limit-100iPhone
firstname
mandatory
String The first name of the customer.Character Limit-60Ashish
email
mandatory
String The email of the customer.Character Limit-50[email protected]
phone
mandatory
String The phone number of the customer.9876543210
lastname
mandatory
String The last name of the customer.Character Limit-60Verma
address1
optional
String The first line of the billing address.Character Limit-100H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai
address2
optional
String The second line of the billing address.Character Limit-10034 Saikripa-Estate, Tilak Nagar
city
optional
String The city where your customer resides as part of the billing address.Mumbai
state
optional
String The state where your customer resides as part of the billing address,Maharashtra
country
optional
String The country where your customer resides.Character Limit-50India
zipcode
optional
String Billing address zip code is mandatory for the cardless EMI option.Character Limit-20400004
surl*
mandatory
String The "surl" field is the success URL, which is the page PayU will redirect to if the transaction is successful. The merchant can handle the response at this URL after the customer is redirected there.https://apiplayground-response.herokuapp.com/
furl
mandatory
String The "furl" field is the Failure URL, which is the page PayU will redirect to if the transaction is failed. The merchant can handle the response at this URL after the customer is redirected there.https://apiplayground-response.herokuapp.com/
hash
mandatory
String It is used to avoid the possibility of transaction tampering. For more information on hash generation process, refer to Generate Hasheabec285da28fd
0e3054d41a4d24fe
9f7599c9d0b6664
6f7a9984303fd612
4044b6206daf831
e9a8bda28a6200d
318293a13d6c193
109b60bd4b4f8b09
c90972
pg
mandatory
varchar The pg parameter for UPI must be UPI.UPI
bankcode
mandatory
varchar This parameter contains UPI or INTENT for UPI.UPI
vpa
mandatory for UPI Collect
varchar This parameter contains the customer’s VPA handle. For the list UPI handles supported, refer to UPI Handles

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
mandatory for UPI Intent
integer This parameter must be passed with the values as 4 for UPI Intent.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 UPI Handle.

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”

Sample Response

  • The formatted response for UPI Consent Transaction is similar to the following:

Sample Response for UPI Recurring Payment Registration

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] => payu
    [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"
   }
}