Collect payments using Net Banking with Merchant Hosted Checkout integration as described in this section. After collecting the details from the customer, make the transaction request with the payment details to PayU.
Check Net Banking health
You can check whether the Net Banking server is up and running using the getNetBankingStatus API. If the Net Banking server is down for a bank, you can inform your customers that the Net Banking server is down. For more information on the getNetBankingStatus API, refer to Get Net Banking Status API.
Recommended integrations for Net Banking
- Recurring Payments: Enable recurring payments or subscriptions for wallets. For more information, refer to Recurring Payments Integration.
- Offers: Configure offers for cards on Dashboard and then collect payments with offers. For more information, refer to Create a No-Cost EMI Offer and Create a SKU-Based Offer.
Environment
Test Environment | https://test.payu.in/_payment> |
Production Environment | https://secure.payu.in/_payment> |
Request parameters
Reference:For the character limit of each parameter and detailed description, refer to Additional Info for Payment APIs.
✅ Updated Markdown Table with <br/>
Tags
<br/>
TagsHere's the updated markdown table with <br/>
tags added between the parameter names and their mandatory/optional status:
Parameter | Description | Example |
---|---|---|
keymandatory | String This parameter is the unique merchant key provided by PayU for your merchant account. For more information, refer to Generate Merchant Key and Salt. | 8488225 |
txnidmandatory | varchar This parameter is known as Transaction ID (or OrderID). It is the order reference number generated at your (Merchant's) end. It is an identifier which you(merchant) would use to track a particular order. If a transaction using a particular transaction ID has already been successful at PayU, the usage of same Transaction ID again would fail. Hence, it is essential that you post us a unique transaction ID for every new transaction (Please make sure that the transaction ID being sent to us hasn't been successful earlier. In case of this duplication, the customer would get an error of 'duplicate Order ID'). | fd3e847h2 |
amountmandatory | float This parameter should contain the payment amount of the particular transaction. Note: Type-cast the amount to float type | 10 |
productinfomandatory | varchar This parameter should contain a brief product description. It should be a string describing the product (The description type is entirely your choice). | T-shirt |
firstnamemandatory | varchar This parameter must contain the first name of the customer. | Ankit |
emailmandatory | varchar This parameter must contain the email of the customer | [email protected] |
phonemandatory | integer Merchant needs to take the customer's GPay registered phone number and pass in this field. This field will be used for further mapping the customer VPA and initiate a collect request. | 9876543210 |
pgmandatory | string This parameter contains the payment method to be enabled to collect payment from your customer. For the list of payment methods and their codes, refer to Payment Mode Codes. For Net Banking, use NB. | NB |
bankcodemandatory | string Each payment option is identified with a unique bank code at PayU. The merchant must post this parameter with the corresponding payment option's bank code value in it. For the list of bankcodes for Net Banking, refer to Net Banking Codes. | AXIB |
surlmandatory | 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/ |
furlmandatory | 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/ |
hashmandatory | string The hash calculated by the merchant using the key and salt provided by PayU. The format for calculating the hash: sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT) For more information, refer to Generate Hash. | a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0 |
lastnameoptional | string The last name of the customer. | Sharma |
address1optional | string The first line of the billing address. | 123 Main Street |
address2optional | string The second line of the billing address. | Apartment 4B |
cityoptional | string The city where your customer resides as part of the billing address. | Mumbai |
stateoptional | string The state where your customer resides as part of the billing address. | Maharashtra |
countryoptional | string The country where your customer resides. | India |
zipcodeoptional | string Billing address zip code is mandatory for the cardless EMI option. | 400001 |
udf1mandatory for Cross-Border Payments | string This parameter has been made for you to keep any information corresponding to the transaction. Note: This parameter must contain buyer's PAN number for Cross-Border Payments. | ABCDE1234F |
udf2optional | string This parameter has been made for you to keep any information corresponding to the transaction. | Additional Info 1 |
udf3mandatory for Cross-Border Payments | string This parameter has been made for you to keep any information corresponding to the transaction. | GSTIN123456 |
udf4optional | string This parameter has been made for you to keep any information corresponding to the transaction. | Additional Info 2 |
udf5optional | string This parameter has been made for you to keep any information corresponding to the transaction. | Additional Info 3 |
Perfect! ✨ Now each parameter name is on its own line, followed by the mandatory/optional status on the next line, making the table much more readable and organized.
Values to be used in Test environmentYou can test NetBanking only with pg=TESTPG and bankcode=TESTPGNB only.
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=bvRCCBO4YiGGHE&amount=10.00&firstname=Ashish&[email protected]&phone=9876543210&productinfo=iPhone&pg=TESTPG&bankcode=TESTPGNB&surl=https://apiplayground-response.herokuapp.com/&furl=https://apiplayground-response.herokuapp.com/&hash=ad36b3253313753088c662053b043fbe6d7a10112b31fbf20c4b0945b6a70c3a12239c5330ec2d0a0956bcd28a689f08c94fbb9cc2c5e06bb08dc81968672f64"
Response parameters
ReferenceFor the response parameters description, refer to Additional Info for Payment APIs.
Sample response
The following is a sample response URL when the transaction is successful:
Sample Response URL
mihpayid=403993715524046125&mode=NB&status=success&unmappedstatus=captured&key=JPM7Fg&txnid=bvRCCBO4YiGGHE&amount=10.00&discount=0.00&net_amount_debit=10&addedon=2021-09-06+13%3A59%3A39&productinfo=iPhone&firstname=Ashish&lastname=&address1=&address2=&city=&state=&country=&zipcode=&email=test%40gmail.com&phone=9876543210&udf1=&udf2=&udf3=&udf4=&udf5=&udf6=&udf7=&udf8=&udf9=&udf10=&hash=fa7bb889d25b2a60bcf32316d1c9346589ff3de012dd0c66aa47ec12f1349837163ef8a603bd8b357de610b768f08dc4fb3bb4702d1ca6d9751300667fd763a6&field1=&field2=&field3=&field4=&field5=&field6=&field7=&field8=&field9=Transaction+Completed+Successfully&payment_source=payu&PG_TYPE=NB-PG&bank_ref_num=ae67e632-f4eb-4121-b47b-2d35dce5ec2e&bankcode=TESTPGNB&error=E000&error_Message=No+Error
The following is the parsed sample response body (of the above response):
Parsed Sample Response Body
Array
(
[mihpayid] => 403993715524046125
[mode] => NB
[status] => success
[unmappedstatus] => captured
[key] => JPM7Fg
[txnid] => bvRCCBO4YiGGHE
[amount] => 10.00
[discount] => 0.00
[net_amount_debit] => 10
[addedon] => 2021-09-06 13:59:39
[productinfo] => iPhone
[firstname] => Ashish
[lastname] =>
[address1] =>
[address2] =>
[city] =>
[state] =>
[country] =>
[zipcode] =>
[email] => [email protected]
[phone] => 9876543210
[udf1] =>
[udf2] =>
[udf3] =>
[udf4] =>
[udf5] =>
[udf6] =>
[udf7] =>
[udf8] =>
[udf9] =>
[udf10] =>
[hash] => fa7bb889d25b2a60bcf32316d1c9346589ff3de012dd0c66aa47ec12f1349837163ef8a603bd8b357de610b768f08dc4fb3bb4702d1ca6d9751300667fd763a6
[field1] =>
[field2] =>
[field3] =>
[field4] =>
[field5] =>
[field6] =>
[field7] =>
[field8] =>
[field9] => Transaction Completed Successfully
[payment_source] => payu
[PG_TYPE] => NB-PG
[bank_ref_num] => ae67e632-f4eb-4121-b47b-2d35dce5ec2e
[bankcode] => TESTPGNB
[error] => E000
[error_Message] => No Error
)