The Seamless Debit Transaction API allows you to debit funds from a wallet seamlessly through PayU payment gateway. This API provides a smooth user experience by handling the payment flow without redirecting the customer away from your application.
Environment
| Environment | URL |
|---|---|
| Test | https://test.payu.in/_payment |
| Production | https://secure.payu.in/_payment |
HTTP Method: POST
Request Headers
| Parameter | Description |
|---|---|
Content-Typemandatory | String application/x-www-form-urlencoded |
Request Parameters
| Parameter | Description | Example |
|---|---|---|
txnIdmandatory | Alphanumeric(25) Unique transaction ID generated by the merchant | 56882 |
keymandatory | Alphanumeric(50) Merchant key provided by PayU during onboarding | KPQwN8 |
productinfomandatory | Alphanumeric(100) Brief description of the product | iPhone |
Customer_idoptional | Numeric(50) Unique ID for the customer (merchant's identifier) | 89342546 |
walleturnoptional | Numeric(11) Wallet URN generated by the system | 70000000008 |
firstNamemandatory | String(60) Customer's first name (only characters and single spaces) | Sourav |
lastNameoptional | String(60) Customer's last name | Mishra |
phonemandatory | Numeric(15) Customer's phone number including ISD code | 919988776655 |
emailmandatory | String(50) Customer email address | [email protected] |
ws_online_responsemandatory | String(255) URL to redirect customer if transaction succeeds | https://success.url.com |
ws_failure_responsemandatory | String(255) URL to redirect customer if transaction fails | https://failure.url.com |
amountmandatory | Numeric(12) Amount to debit in implied decimals (₹4.10 → 410) | 4100 |
pgmandatory | String(10) Set to 'CLW' for PayU's closed loop wallet | CLW |
txn_s2s_flowmandatory | Numeric(1) Constant value '4' to identify Seamless Debit | 4 |
bankcodemandatory | String(10) Code indicating the PG used (merchant-specific) | PAY |
hashmandatory | String(128) SHA512 hash for request authentication | 6e640b... |
Note: Either
Customer_idorwalleturnmust be provided.
Hashing
You must hash the request parameters using the following hash logic:
sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)
For more information, refer to Generate Hash.
Response Parameters
| Parameter | Description | Example |
|---|---|---|
| mihpayid | Unique PayU-generated transaction reference number | 1735903830180094 |
| mode | Payment method used | CLW |
| status | Transaction status | success |
| key | Merchant key (echoed back) | KPQwN8 |
| txnid | Transaction ID (echoed back) | 56882 |
| amount | Transaction amount | 10.00 |
| productinfo | Product description (echoed back) | iPhone |
| firstname | Customer first name | Sourav |
| lastname | Customer last name | Mishra |
| Customer email | [email protected] | |
| phone | Customer phone number | 919988776655 |
| hash | Response hash for verification | abc123... |
| PG_TYPE | Payment gateway type | CLW |
| bank_ref_num | Bank reference number | 123456789 |
| error | Error message (if any) | Insufficient balance |
| error_Message | Detailed error message | Wallet balance is insufficient |
Sample Request
curl --location --request POST 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'txnId=56882' \
--data 'key=KPQwN8' \
--data 'productinfo=iPhone' \
--data 'Customer_id=89342546' \
--data 'firstName=Sourav' \
--data 'lastName=Mishra' \
--data 'phone=919988776655' \
--data '[email protected]' \
--data 'ws_online_response=https://success.url.com' \
--data 'ws_failure_response=https://failure.url.com' \
--data 'amount=4100' \
--data 'pg=CLW' \
--data 'txn_s2s_flow=4' \
--data 'bankcode=PAY' \
--data 'hash=6e640b...'
Sample Response
Successful Transaction
{
"mihpayid": "1735903830180094",
"mode": "CLW",
"status": "success",
"key": "KPQwN8",
"txnid": "56882",
"amount": "41.00",
"productinfo": "iPhone",
"firstname": "Sourav",
"lastname": "Mishra",
"email": "[email protected]",
"phone": "919988776655",
"hash": "abc123def456...",
"PG_TYPE": "CLW",
"bank_ref_num": "123456789"
}Failed Transaction
{
"mihpayid": "1735903830180095",
"mode": "CLW",
"status": "failure",
"key": "KPQwN8",
"txnid": "56883",
"amount": "41.00",
"productinfo": "iPhone",
"firstname": "Sourav",
"lastname": "Mishra",
"email": "[email protected]",
"phone": "919988776655",
"hash": "xyz789abc123...",
"PG_TYPE": "CLW",
"error": "Insufficient balance",
"error_Message": "Wallet balance is insufficient for this transaction"
}HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | OK - Request processed successfully |
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Authentication failed |
| 500 | Internal Server Error |
