This document provides a comprehensive guide for integrating with PayU Net Banking Seamless Integration v2 using the v2/payments
API. The seamless integration allows you to process Net Banking payments directly through server-to-server communication, providing a streamlined payment experience while maintaining control over the user interface.
The v2 Net Banking seamless integration consists of two main steps:
Create the payment request to PayU's v2/payments API with Net Banking payment method
Verify the payment status using the verification API
Request HeadersParameter Description date The current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT. authorization The actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to authorization fields description .
Field Description username Represents the username or identifier for the client or merchant, for example smsplus. algorithm Use SHA512 algorithm for hashing and send this as header value. headers Specifies which headers have been used in generating the hash, for example date. signature The HMAC signature generated using the specified algorithm. For more information, refer to hashing algorithm .
You must hash the request parameters using the following hash logic:
Hash logic : sha512(<Body data>
+ '|' + date + '|' + merchant_secret)
Where <Body data>
contains the request body posted with the request.
Sample header code JavaScript
var merchant_key = 'smsplus';
var merchant_secret = 'izF09TlpX4ZOwmf9MvXijwYsBPUmxYHD';
// date
var date = new Date();
date = date.toUTCString();
// authorization
var authorization = getAuthHeader(date);
function getAuthHeader(date) {
var AUTH_TYPE = 'sha512';
var data = isEmpty(request['data']) ? "" : request['data'];
var hash_string = data + '|' + date + '|' + merchant_secret;
var hash = CryptoJS.SHA512(hash_string).toString(CryptoJS.enc.Hex);
return `hmac username="${merchant_key}", algorithm="${AUTH_TYPE}", headers="date", signature="${hash}"`;
}
The v2/payments API request for Net Banking seamless integration contains the following main parameters:
Parameter
Description
Example
accountIdmandatory
Merchant key provided by PayU. Character limit: 50
"smsplus"
txnIdmandatory
Unique transaction ID for the transaction. Character limit: 50
"REF_123456789"
paymentMethodmandatory
Net Banking payment method details. See paymentMethod object
{"name": "NetBanking", "bankCode": "EFTAXIS"}
ordermandatory
Order details containing product information and pricing. See order object
{"productInfo": "Net Banking Payment", "paymentChargeSpecification": {"price": 10000.00}}
billingDetailsmandatory
Customer billing information. See billingDetails object
{"firstName": "John", "email": "[email protected] ", "phone": "9876543210"}
callBackActionsoptional
Callback URLs for different payment outcomes. See callBackActions object
{"successAction": "https://merchant.com/success", "failureAction": "https://merchant.com/failure"}
additionalInfomandatory
Additional transaction parameters including flow type. See additionalInfo object
{"txnFlow": "seamless", "enforcePaymethod": "NB"}
beneficiaryDetailmandatory
Beneficiary account details for Net Banking transfer. See beneficiaryDetail object
{"beneficiaryName": "Merchant Account", "beneficiaryAccountNumber": "1234567890", "beneficiaryAccountType": "SAVINGS"}
Payment Method ObjectFor Net Banking seamless integration, the payment method object should contain:
Parameter Type Description Required name
String Must be "NetBanking" for Net Banking payments Yes bankCode
String Specific bank code for the selected bank (e.g., "TESTNB", "SBIN", "HDFC") Yes
Example:
JSON
{
"name": "NetBanking",
"bankCode": "TESTNB"
}
Order Object
Parameter
Description
Example
productInfomandatory
Product details.
Product details
orderedItemoptional
Details about the items ordered.
Array of Objects
userDefinedFieldsoptional
Custom fields for additional information. Fields: udf1, udf2, udf3, udf4, udf5, udf6, udf7, udf8, udf9, udf10. For more information, refer to
Object
paymentChargeSpecificationmandatory
Includes amount and charges. For more information, refer to paymentChargeSpecification object fields description
Object
Parameter
Description
Example
pricemandatory
The transaction amount.
1000
netAmountDebitoptional
Net amount to be debited.
1000
taxSpecificationoptional
Tax details of the product/order.
Object
convenienceFeeoptional
Fees format (e.g., CC:12).
CC:12
offersoptional
Offers applied or available for the payment.
Object
Field Description udf1 User defined field. udf2 User defined field. udf3 User defined field. udf4 User defined field. udf5 User defined field. udf6 User defined field. udf7 User defined field. udf8 User defined field. udf9 User defined field. udf10 User defined field.
Payment Charge Specification Object
Parameter
Description
Example
pricemandatory
The transaction amount.
1000
netAmountDebitoptional
Net amount to be debited.
1000
taxSpecificationoptional
Tax details of the product/order.
Object
convenienceFeeoptional
Fees format (e.g., CC:12).
CC:12
offersoptional
Offers applied or available for the payment.
Object
Additional Info Object
Parameter
Description
Example
partnerHoldTime optional
Time held by the partner for the transaction.
60
createOrder optional
A flag to store the order details (true/false).
true
txnS2sFlow optional
For defining seamless/non-seamless flows in handling payments.
seamless
Callback Actions Object
Parameter
Description
Example
successActionmandatory
URL to be called on payment success.
https://example.com/success
failureActionmandatory
URL to be called on payment failure.
https://example.com/failure
cancelActionmandatory
URL to be called if user cancels the payment.
https://example.com/cancel
codActionoptional
URL for Cash on Delivery (COD) action.
https://example.com/cod
Billing Details Object
Parameter
Description
Example
firstNamemandatory
First name of the billing contact.
Ashish
lastNameoptional
Last name of the billing contact.
Kumar
address1mandatory
Primary billing address.
123 Main Street
address2optional
Secondary billing address.
Apt 4B
phoneoptional
Phone number of the billing contact.
9123456789
emailmandatory
Email address of the billing contact.
[email protected]
cityoptional
City of the billing address.
Bharatpur
stateoptional
State of the billing address.
Rajasthan
countryoptional
Country of the billing address.
India
zipCodeoptional
Postal/Zip code of the billing address.
321028
JSON
curl -X POST \
https://apitest.payu.in/v2/payments \
-H 'date: Mon, 05 Oct 2024 11:00:00 GMT' \
-H 'authorization: HMAC smsplus:4d1ea4e74243ea5b2b5b8b1d8a7b1a2e3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9' \
-H 'content-type: application/json' \
-d '{
"accountId": "smsplus",
"referenceId": "REF_" + Math.random().toString(36).substring(7),
"paymentMethod": {
"name": "NetBanking",
"bankCode": "EFTAXIS"
},
"order": {
"productInfo": "Net Banking Payment",
"paymentChargeSpecification": {
"price": 10000.00,
"convenienceFee": "NB:15"
},
"userDefinedFields": {
"udf1": "Net Banking Transaction",
"udf2": "Seamless Payment"
}
},
"billingDetails": {
"firstName": "John",
"lastName": "Doe",
"email": "[email protected] ",
"phone": "9876543210",
"address": "123 Main Street",
"city": "New Delhi",
"state": "Delhi",
"country": "India",
"zipCode": "110001"
},
"callBackActions": {
"successAction": "https://merchant.com/success",
"failureAction": "https://merchant.com/failure",
"cancelAction": "https://merchant.com/cancel"
},
"additionalInfo": {
"txnFlow": "seamless",
"createOrder": true,
"enforcePaymethod": "NB",
"txnS2sFlow": "2"
},
"beneficiaryDetail": {
"beneficiaryName": "Merchant Account",
"beneficiaryAccountNumber": "1234567890",
"beneficiaryAccountType": "SAVINGS"
}
}'
JSON
{
"result": {
"paymentId": "1999110000001769",
"redirectUrl": "https://secure.payu.in/ResponseHandler.php",
"authAction": "https://apitest.payu.in/v2/payments/1999110000001769/auth"
},
"status": "PENDING"
}
After the payment is processed, you must verify the payment status using the verification API to get the final transaction status.
Environment
Environment URL Test https://test.payu.in/v3/transaction
Production https://api.payu.in/v3/transaction
curl --location 'https://test.payu.in/v3/transaction' \
--header 'Content-Type: application/json' \
--header 'date: Thu, 27 Mar 2025 06:35:21 GMT' \
--header 'authorization: hmac username="PRiQvJ", algorithm="sha512", headers="date", signature="42a54cc7450fe1e7a3cf35ebfaed1b828e37062964266fd33186c7b2526e85e3ea2d46946a728ca50e46423ea9a6b2edb8c1315b58fa69297e1e91d3d34804a1"' \
--header 'Info-Command: verify_payment' \
--data '{
"txnId":["512345678901234"]
}'
JSON
{
"message": "Success",
"status": 1,
"result": [
{
"mihpayId": 1999110000001769,
"bankReferenceNumber": "NB12345678",
"amount": 100.00,
"mode": "NB",
"requestId": "",
"originalAmount": 100.00,
"additionalCharges": 0.00,
"discount": 0.00,
"netDebitAmount": 100.00,
"productInfo": "Net Banking Test Product",
"firstName": "John",
"bankcode": "TESTNB",
"udf1": null,
"udf2": null,
"udf3": null,
"udf4": null,
"udf5": null,
"field2": "140455",
"field9": "Transaction is Successful",
"errorCode": "E000",
"errorMessage": "No Error",
"addedOn": "2024-11-19 21:17:55",
"settledAt": "0000-00-00 00:00:00",
"paymentSource": "WEB",
"pgType": "NB-PG",
"status": "success",
"unmappedStatus": "captured",
"merchantUTR": null,
"originalCurrency": "INR",
"message": "Found TxnId",
"txnId": "b5f2d8785768087678fn4"
}
]
}