Cardless EMI - Merchant Hosted Checkout Integration

When your customer wants to opt for the Cardless EMI option, you can use the EMI APIs to check the customer’s eligibility and get the EMI amount, interest, processing fee, or No-Cost EMI and tenure. If the customer is eligible, you can post the Cardless EMI transaction.

Step 1: Check the cardless EMI eligibility

After collecting the customer’s mobile number and the amount to be paid, check the Cardless EMI eligibility based on the customer’s mobile using the Get Checkout Details API (get_checkout_details) API. For more information, refer to Get Checkout Details API

Step 2: Initiate the payment

Post the following additional parameters for using the Cardless EMI. Check the response when you try enter the values in API Reference. For complete list of parameters, refer to Collect Payment API - EMI for the complete list parameters with Try It experience.

panNumber
mandatory for ICICI and HDFC Bank Cardless EMI. Not mandatory for other banks
String <PAN number of the customer.ABCTY1234D
pg
mandatory
String It defines the payment category that the merchant wants the customer to see by default on the PayU’s payment page. In this example, "EMI" must be specified.EMI
bankcode
mandatory
String Post this parameter to identify payment options with unique bank codes for cardless EMI. For the list of EMI codes, refer to EMI Codes.HDFCCL06
ccnum
mandatory only for Bajaj Finserv
String This parameter must contain the Bajaj Finserv EMI Card Number entered by the customer for the transaction.2030405098735641

📘

Notes for panNumber:

  • Only 4-digit number of the PAN**: Pass the 4-digit numeral in a sequential order as in the PAN.
  • This parameter is mandatory for ICICI Bank and HDFC Bank Cardless EMI. Not mandatory for other banks
  • The data validation performed is either the whole PAN card number or 4-dig-t number of the PAN.
    • Whole PAN card Number: For validating the whole PAN Card number:
      • It should be ten characters long.
      • The first five characters should be any upper case alphabets.
      • The next four-characters should be any number from 0 to 9.
      • The last(tenth) character should be any upper case alphabet. It should not contain any white spaces.

Hashing

You must hash the request parameters using the following hash logic:

sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)

For more information, refer to Generate Hash.

Sample request

curl -X POST "https://test.payu.in/_payment-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d"key=JP***g&txnid=EaE4ZO3vU4iPsp&amount=10.00&firstname=Ashish&[email protected]&phone=9876543210&productinfo=iPhone&pg=EMI&bankcode=EMI03&surl=https://apiplayground-response.herokuapp.com/&furl=https://apiplayground-response.herokuapp.com/&ccnum=1234&ccexpmon=05&ccexpyr=2022&ccvv=123&ccname=undefined&store_card_token=1234 4567 2456 3566&storecard_token_type=1&additional_info={“last4Digits”: “1234”, “tavv”: “ABCDEFGH”,”trid”:”1234567890”, “tokenRefNo”:”abcde123456”}&hash=fc3206829a6b4f8e300aeefb8f91add568b83dc90d01383a8e16553cc9600a3aefd4be2e370d32f0315ef1b9f28740515a9556b55abfefa7b54b434f894c9304"

Step 3: Check the response from PayU

Hash validation logic for payment response (Reverse Hashing)

While sending the response, PayU takes the exact same parameters that were sent in the request (in reverse order) to calculate the hash and returns it to you. You must verify the hash and then mark a transaction as a success or failure. This is to make sure the transaction has not tampered within the response.

The order of the parameters is similar to the following code block:

sha512(SALT|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|txnid|key)

Sample response

Array
(
    [mihpayid] => 403993715523602563
    [status] => success
    [unmappedstatus] => captured
    [key] => smsplus
    [txnid] => v2tWbbdUOuacK9
    [amount] => 20000.00
    [discount] => 0.00
    [net_amount_debit] => 20000.00
    [addedon] => 2021-07-27 11:14:44
    [productinfo] => iPhone
    [firstname] => Ashish
    [lastname] => 
    [address1] => 
    [address2] => 
    [city] => 
    [state] => 
    [country] => 
    [zipcode] => 
    [email] => [email protected]
    [phone] => 1234567890
    [udf1] => 
    [udf2] => 
    [udf3] => 
    [udf4] => 
    [udf5] => 
    [udf6] => 
    [udf7] => 
    [udf8] => 
    [udf9] => 
    [udf10] => 
    [hash] => 10f8ead10cdf5f9b7bf9046987de046d63d62d6679dded9d5da8145f459066943570eec4aa184494ae77f99a8bcd55452af3c4eff0d7a7d3ba809c97b7c73045
[field1] => 0608273386032718000015
    [field2] => 986987
    [field3] => 10.00
    [field4] => 403993715524069222
    [field5] => 100
    [field6] => 02
    [field7] => AUTHPOSITIVE
    [field8] => 
    [field9] => Transaction is Successful    [payment_source] => payu
    [PG_TYPE] => EMI-PG
    [bank_ref_num] => 3d7cc4a4-00c8-4705-a0e7-5708d2c2bb75
    [bankcode]=> EMIA3
    [error] => E000
    [error_Message] => No Error
    [name_on_card] => payu
    [cardnum] =>XXXXXXXXXXXX1234
)