UPI TPV Integration - PayU Hosted Checkout

For UPI integration, you need to post transaction details to PayU with beneficiary details for validation, similar to Net-Banking integration.

The request parameters for UPI integration are the same as Net-Banking integration. The beneficiarydetail parameter should include the UPI beneficiary details.

Environment

The following environments are available for TPV integration:

Step 1: Create transaction with beneficiary details

Create a transaction by including a JSON object with beneficiary details (account numbers and IFSC codes). You can include up to 4 accounts for validation.

Step 2: Post the parameters to PayU

Request parameters

Parameter Description Example
key
mandatory
String Merchant key provided by PayU during onboarding JPg***r
txnid
mandatory
String The transaction ID is a unique reference for each order. Duplicate transaction IDs are not allowed. ypl938459435
amount
mandatory
String Transaction amount 100
productinfo
mandatory
String Product description Test Product
firstname
mandatory
String Customer's first name John
email
mandatory
String Customer's email address [email protected]
phone
mandatory
String Customer's phone number 9999999999
beneficiarydetail
mandatory
String JSON object that contains account numbers and corresponding IFSC codes (max 4 accounts) in the same order beneficiarydetail JSON Object Fields
surl
mandatory
String Success URL - PayU will make a POST request with transaction response to this URL if the transaction is successful https://www.yoursurl.com
furl
mandatory
String Failure URL - PayU will make a POST request with transaction response to this URL if the transaction fails https://www.yourfurl.com
api_version
mandatory
String Version of the API 6
hash
mandatory
String SHA512 hash calculated using the formula:
sha512(key|txnid|amount|productinfo|
firstname|email|udf1|udf2|udf3|udf4|udf5||||||
beneficiarydetail|SALT)
📘

Hash calculation

The hash is calculated using the following formula:

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

Replace SALT with the salt value provided during onboarding.

beneficiarydetail JSON object fields

The beneficiarydetail parameter should be a JSON object with the following structure:

Field

Description

Example

beneficiaryAccountNumber

String List of account numbers separated by pipe symbol (|). Maximum 4 accounts.

"002001600674| 00000031957292212| 00000035955239352| 00000035955239352"

ifscCode

String List of corresponding IFSC codes separated by pipe symbol (|). Maximum 4 IFSC codes in the same order as account numbers.

"KTKB0000046| KTKB0000023| KTKB0000035| KTKB0000035"

Example JSON:

{
  "beneficiaryAccountNumber": "002001600674|00000031957292212|00000035955239352|00000035955239352",
  "ifscCode": "KTKB0000046|KTKB0000023|KTKB0000035|KTKB0000035"
}
📘

beneficiarydetail parameter in hashing:

  • The beneficiarydetail parameter must be included in the hash calculation.
  • The format should be exactly as shown in the hash formula above.
  • Replace SALT with the salt value provided to you during onboarding.

Step 3: Check the response from PayU

After posting the parameters, PayU will return a response with transaction details.

Hash Validation Logic for payment response (Reverse Hashing)

To validate the authenticity of the response, you can calculate the reverse hash using:

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

beneficiarydetail parameter not required in reverse hashing:

The beneficiarydetail parameter is not required when calculating the reverse hash.

Response parameters

Param NameDescription
mihpayidIt is a unique reference number created for each transaction at PayU's end.
merchantidIt is the unique ID of the merchant.
txnidTransaction ID provided by the merchant during the transaction request.
transaction_feeTransaction fee for this transaction (e.g., fixed fee of INR 10 for Net Banking).
discountThe discount/cashback amount provided by the bank, if applicable.
amountThe amount after discount (if any).
paymentgatewayidIdentifier for the payment gateway/bank sending the response.
pgThe payment gateway used for the transaction (e.g., "NB" for Net Banking).
statusStatus of the transaction. Possible values: success, failure, pending. A pending status is considered as a failed transaction.
keyMerchant key.
addedonTimestamp of the transaction (e.g., 2023-02-01 12:01:22).
bankcodeBank code used in the transaction.
errorError code (e.g., "E000" indicates no error).
error_MessageDescription of any errors encountered.
📘

Store the mihpayid and txnid parameter values in response:

Make sure to store the mihpayid and txnid parameter values from the response for future reference and reconciliation.

Sample response

Array
(
    [mihpayid] => 99995401486671
    [status] => success
    [txnid] => 4245248agh5519827ec
    [amount] => 100.00
    [addedon] => 2025-01-28 18:36:35
    [productinfo] => Product Info
    [hash] => e9272f99eace0c7803834e94dd88f0b9d05f1e95cd86c84c7ef8e5670a39bf1ccde2222ed7e73c2a0e60eb8cd8d5457e0ebdef0d01c1c04c7d5bc20b8a2d4901
    [bankcode] => SBITPV
    [error_Message] => No Error
)