Wallets Integration

You can collect payments from customers with leading wallets using the Merchant Hosted integration. You need to ensure that Wallet for the paymentMethod.name field and wallet code based on the desired wallet for the paymentMethod.bankCode parameter is posted.

Steps to Integrate

  1. Initiate the payment with PayU
  2. Verify Payment
👍

Before you begin:

  • Register for an account with PayU before you start integration. For more information, refer to Register for a Merchant Account.
  • PayU recommends you integrate with Test environment for testing and then move to the Production environment.

Step 1: Initiate the payment with PayU

The following parameters vary for the Wallet payment mode in the Collect Payment API (v2/payments API).

📘

Reference:

For the API reference, refer to Collect Payments API under API Reference.

Request Header

ParameterDescription
dateThe current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT.
authorizationThe actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to authorization fields description.

authorization fields description

FieldDescription
usernameRepresents the username or identifier for the client or merchant, for example smsplus.
algorithmUse SHA512 algorithm for hashing and send this as header value.
headersSpecifies which headers have been used in generating the hash, for example date.
signatureThe HMAC signature generated using the specified algorithm. For more information, refer to hashing algorithm.

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
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}"`;
}

Request Body

The following table describes the request body parameters:

Parameter Description Example

accountId
mandatory

String The merchant key provided by PayU during onboarding.

MERCHANT123

referenceId
mandatory

String Reference ID for transaction tracking and this must be unique for every transaction.

REF123456

paymentMethod
mandatory

Object Contains the payment method details. For wallet payments, includes name and bankCode for the specific wallet.

{ "name": "Wallet", "bankCode": "PAYTM" }

order
mandatory
Order details containing product information and pricing. See order object {"productInfo": "Wallets Integration", "paymentChargeSpecification": {"price": 10000.00}}
billingDetails
mandatory
Customer billing information. See billingDetails object {"firstName": "John", "email": "[email protected]", "phone": "9876543210"}
callBackActions
optional
Callback URLs for different payment outcomes. See callBackActions object {"successAction": "https://merchant.com/success", "failureAction": "https://merchant.com/failure"}
additionalInfo
mandatory
Additional transaction parameters including flow type. See additionalInfo object {"txnFlow": "seamless"}

order object

order Object
Parameter Description Example
productInfo
mandatory
Product details. Product details
orderedItem
optional
Details about the items ordered. Array of Objects
userDefinedFields
optional
Custom fields for additional information. Fields: udf1, udf2, udf3, udf4, udf5, udf6, udf7, udf8, udf9, udf10. For more information, refer to Object
paymentChargeSpecification
mandatory
Includes amount and charges. For more information, refer to paymentChargeSpecification object fields description Object
paymentChargeSpecification object fields description
Parameter Description Example
price
mandatory
The transaction amount. 1000
netAmountDebit
optional
Net amount to be debited. 1000
taxSpecification
optional
Tax details of the product/order. Object
convenienceFee
optional
Fees format (e.g., CC:12). CC:12
offers
optional
Offers applied or available for the payment. Object
userDefinedFields object fields description
FieldDescription
udf1User defined field.
udf2User defined field.
udf3User defined field.
udf4User defined field.
udf5User defined field.
udf6User defined field.
udf7User defined field.
udf8User defined field.
udf9User defined field.
udf10User defined field.

callBackActions object

callBackActions Object
Parameter Description Example
successAction
mandatory
URL to be called on payment success. https://example.com/success
failureAction
mandatory
URL to be called on payment failure. https://example.com/failure
cancelAction
mandatory
URL to be called if user cancels the payment. https://example.com/cancel
codAction
optional
URL for Cash on Delivery (COD) action. https://example.com/cod

billingDetails object

billingDetails Object
Parameter Description Example
firstName
mandatory
First name of the billing contact. Ashish
lastName
optional
Last name of the billing contact. Kumar
address1
mandatory
Primary billing address. 123 Main Street
address2
optional
Secondary billing address. Apt 4B
phone
optional
Phone number of the billing contact. 9123456789
email
mandatory
Email address of the billing contact. [email protected]
city
optional
City of the billing address. Bharatpur
state
optional
State of the billing address. Rajasthan
country
optional
Country of the billing address. India
zipCode
optional
Postal/Zip code of the billing address. 321028

additionalInfo 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
txnFlow
optional
For defining seamless/non-seamless flows in handling payments. seamless

Sample request

curl --location 'https://apitest.payu.in/v2/payments' \\
--header 'date: Thu, 27 Mar 2025 10:12:27 GMT' \\
--header 'authorization: hmac username="smsplus", algorithm="sha512", headers="date", signature="<signature>"' \\
--header 'Content-Type: application/json' \\
--data-raw '{
    "accountId": "smsplus",
    "referenceId": "b5f2d8785768087678fn4",
    "currency": "INR",
    "paymentSource": "WEB",
    "paymentMethod": {
        "name": "Wallet",
        "bankCode": "PAYTM"
    },
    "order": {
        "productInfo": "qwertyuiopasdfghjkl",
        "userDefinedFields": {
            "udf1": "",
            "udf2": ""
        },
        "paymentChargeSpecification": {
            "price": "10"
        }
    },
    "callBackActions": {
        "successAction": "https://pp78admin.payu.in/test_response",
        "failureAction": "https://pp78admin.payu.in/test_response",
        "cancelAction": "https://pp78admin.payu.in/test_response"
    },
    "billingDetails": {
        "firstName": "sartaj",
        "lastName": "",
        "phone": "9876543210",
        "email": "[email protected]",
        "city": "Bharatpur",
        "state": "Rajasthan",
        "country": "India",
        "zipCode": "321028"
    }
}'

Sample response

Parameter Description
txnId This parameter contains the transaction ID of the transaction.
paymentId This parameter contains the payment ID of the transaction.
message This parameter contains the status message of the transaction.
{
    "referenceId": "b5f2d8785768087678fm9",
    "paymentId": "1999110000001769",
    "message": "Please call verify api to get the transaction status"
}

Step 2: Verify the payment

After initiating the payment, you must verify the payment status using the Verify Payment API. For more information, refer to Verify Payment API.

The customer will be redirected to the wallet provider (e.g., Paytm) to complete the payment, and you can verify the transaction status to confirm the payment.

📘

Note:

  • The wallet transaction may take some time to complete
  • Always verify the payment status before providing the service to the customer
  • Use the referenceId from the initial request to track the transaction
  • For supported wallet codes, refer to Wallet Codes