Seamless Debit Transaction API

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

EnvironmentURL
Testhttps://test.payu.in/_payment
Productionhttps://secure.payu.in/_payment

HTTP Method: POST

Request Headers

ParameterDescription
Content-Type
mandatory
String application/x-www-form-urlencoded

Request Parameters

Body Parameters

The request body contains both encrypted and decrypted parameters.

Encrypted

ParameterDescription
encdata
mandatory
String Encrypted request body containing all the decrypted parameters

Decrypted

ParameterDescriptionExample
txnId
mandatory
Alphanumeric(25) Unique transaction ID generated by the merchant56882
key
mandatory
Alphanumeric(50) Merchant key provided by PayU during onboardingKPQwN8
productinfo
mandatory
Alphanumeric(100) Brief description of the productiPhone
Customer_id
optional
Numeric(50) Unique ID for the customer (merchant's identifier)89342546
walleturn
optional
Numeric(11) Wallet URN generated by the system70000000008
firstName
mandatory
String(60) Customer's first name (only characters and single spaces)Sourav
lastName
optional
String(60) Customer's last nameMishra
phone
mandatory
Numeric(15) Customer's phone number including ISD code919988776655
email
mandatory
String(50) Customer email address[email protected]
ws_online_response
mandatory
String(255) URL to redirect customer if transaction succeedshttps://success.url.com
ws_failure_response
mandatory
String(255) URL to redirect customer if transaction failshttps://failure.url.com
amount
mandatory
Numeric(12) Amount to debit in implied decimals (₹4.10 → 410)4100
pg
mandatory
String(10) Set to 'CLW' for PayU's closed loop walletCLW
txn_s2s_flow
mandatory
Numeric(1) Constant value '4' to identify Seamless Debit4
bankcode
mandatory
String(10) Code indicating the PG used (merchant-specific)PAY
hash
mandatory
String(128) SHA512 hash for request authentication6e640b...
📘

Note: Either Customer_id or walleturn must be provided.

Response Parameters

ParameterDescriptionExample
mihpayidUnique PayU-generated transaction reference number1735903830180094
modePayment method usedCLW
statusTransaction statussuccess
keyMerchant key (echoed back)KPQwN8
txnidTransaction ID (echoed back)56882
amountTransaction amount10.00
productinfoProduct description (echoed back)iPhone
firstnameCustomer first nameSourav
lastnameCustomer last nameMishra
emailCustomer email[email protected]
phoneCustomer phone number919988776655
hashResponse hash for verificationabc123...
PG_TYPEPayment gateway typeCLW
bank_ref_numBank reference number123456789
errorError message (if any)Insufficient balance
error_MessageDetailed error messageWallet balance is insufficient

Sample Request

Encrypted Packet

curl --location --request POST 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'encdata=h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz123...'

Decrypted Packet

txnId=56882&key=KPQwN8&productinfo=iPhone&Customer_id=89342546&firstName=Sourav&lastName=Mishra&phone=919988776655&[email protected]&ws_online_response=https://success.url.com&ws_failure_response=https://failure.url.com&amount=4100&pg=CLW&txn_s2s_flow=4&bankcode=PAY&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 CodeDescription
200OK - Request processed successfully
400Bad Request - Invalid request parameters
401Unauthorized - Authentication failed
500Internal Server Error
Ask AI Beta

Hi! I am an AI Assistant. Ask me about PayU and get help with your integration.
Responses are generated by AI, may contain some mistakes.

EXAMPLE QUESTIONS