Net Banking TPV Integration
For Net Banking integration, you need to post transaction details to PayU with bank account details for validation.
Experience the end-to-end Net Banking TPV flow and instantly generate the complete code for seamless, zero-coding integration into your website
Steps to integrate
Create transaction with beneficiary account details for validation
Post the required parameters to PayU payment endpoint
Check the transaction response from PayU
Verify the payment using verify_payment API
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 four accounts for validation.
Step 2: Post the parameters to PayU
Request parameters
Environment The following environments are available for TPV integration:
| Test Environment | https://test.payu.in/_payment |
| Production Environment | https://secure.payu.in/_payment |
| Parameter | Description | Example |
|---|---|---|
keymandatory |
String Merchant key provided by PayU during onboarding |
JPg***r |
txnidmandatory |
String The transaction ID is a unique reference for each order. Duplicate transaction IDs are not allowed. |
ypl938459435 |
amountmandatory |
String Transaction amount |
100 |
productinfomandatory |
String Product description |
Test Product |
firstnamemandatory |
String Customer's first name |
John |
emailmandatory |
String Customer's email address |
[email protected] |
phonemandatory |
String Customer's phone number |
9999999999 |
beneficiarydetailmandatory |
String JSON object that contains account numbers and corresponding IFSC codes (max 4 accounts) in the same order |
Refer to beneficiarydetail JSON Object Fields |
surlmandatory |
String Success URL - PayU will make a POST request with transaction response to this URL if the transaction is successful |
https://www.yoursurl.com |
furlmandatory |
String Failure URL - PayU will make a POST request with transaction response to this URL if the transaction fails |
https://www.yourfurl.com |
api_versionmandatory |
String Version of the API |
6 |
hashmandatory |
String SHA512 hash calculated using the formula:sha512(key|txnid|amount|productinfo|firstname| email|udf1|udf2|udf3|udf4|udf5|||||| beneficiarydetail|SALT) |
Hash calculationThe hash is calculated using the following formula:
sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||beneficiarydetail|SALT)Replace
SALTwith 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 |
| "002001600674| 00000031957292212| 00000035955239352| 00000035955239352" |
ifscCode |
| "KTKB0000046| KTKB0000023| KTKB0000035| KTKB0000035" |
Example JSON:
{
"beneficiaryAccountNumber": "002001600674|00000031957292212|00000035955239352|00000035955239352",
"ifscCode": "KTKB0000046|KTKB0000023|KTKB0000035|KTKB0000035"
}
beneficiarydetail parameter in hashing:
- The
beneficiarydetailparameter 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
beneficiarydetailparameter is not required when calculating the reverse hash.
Response parameters
| Param Name | Description |
|---|---|
| mihpayid | It is a unique reference number created for each transaction at PayU's end. |
| merchantid | It is the unique ID of the merchant. |
| txnid | Transaction ID provided by the merchant during the transaction request. |
| transaction_fee | Transaction fee for this transaction (e.g., fixed fee of INR 10 for Net Banking). |
| discount | The discount/cashback amount provided by the bank, if applicable. |
| amount | The amount after discount (if any). |
| paymentgatewayid | Identifier for the payment gateway/bank sending the response. |
| pg | The payment gateway used for the transaction (e.g., "NB" for Net Banking). |
| status | Status of the transaction. Possible values: success, failure, pending. A pending status is considered as a failed transaction. |
| key | Merchant key. |
| addedon | Timestamp of the transaction (e.g., 2023-02-01 12:01:22). |
| bankcode | Bank code used in the transaction. |
| error | Error code (e.g., "E000" indicates no error). |
| error_Message | Description of any errors encountered. |
Store the mihpayid and txnid parameter values in response: Make sure to store the
mihpayidandtxnidparameter 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
)Step 4: Verify the payment
Upon receiving the response, PayU recommends you 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.
Know how to manage Webhooks for Payments.
Environment
| Test Environment | https://test.payu.in/merchant/postservice.php?form=2 |
| Production Environment | https://info.payu.in/merchant/postservice.php?form=2 |
Note: The hash logic for Verify Payment API is:
sha512(key|command|var1|salt) sha512
Sample request
curl --request POST
--url 'https://test.payu.in/merchant/postservice?form=2'
--header 'Content-Type: application/x-www-form-urlencoded'
--data key=JPM7Fg
--data command=verify_payment
--data var1=IhfgcZnXR4o4nB
--data hash=a0ae79fdd66c875af6e9b21c4a67f1822deb00f2df5e9f0b1948f3222f536a9bf741b24efbb1874ca0f84f76b036e6c0d641581d0100f7abe4aeed2f3264f5c9
Sample response
If credit card payment is made, the response is similar to the following:
{
"status":0,
"msg":"0 out of 1 Transactions Fetched Successfully",
"transaction_details":
{
"IhfgcZnXR4o4nB":
{
"mihpayid":"Not Found",
"status":"Not Found"
}
}
}If txnID is not found, the response is similar to the following:
{
"status":0,
"msg":"0 out of 1 Transactions Fetched Successfully",
"transaction_details":
{
"IhfgcZnXR4o4nB":
{
"mihpayid":"Not Found",
"status":"Not Found"
}
}
}Response parameters
Parameter | Description | Example |
|---|---|---|
status | This parameter returns the status of web service call. The status can be any of the following:
| 0 |
msg | This parameter returns the reason string. | For example, any of the following messages are displayed:
|
transaction_details | This parameter contains the response in a JSON format. For more information refer to JSON fields description for transaction_details parameter . | |
request_id | PayU Request ID for a request in a Transaction. For example, a transaction can have a refund request. | 7800456 |
bank_ref_num | This parameter returns the bank reference number. If the bank provides after a successful action. | 204519474956 |
To learn more about the possible error codes and their description, refer to Error Codes.
Updated about 2 months ago
