Load and Pay Transaction API

The Load and Pay Transaction API is designed to handle wallet transactions where the wallet balance is insufficient. It enables users to first load money into their wallet and then directly proceed with the payment (debiting the wallet) in a single streamlined transaction.

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

Parameter Description Example
key
mandatory
String Merchant key provided by PayU during onboarding KOEfPI
txnid
mandatory
Alphanumeric Unique transaction ID generated for each load and pay transaction ram1234
amount
mandatory
Numeric Transaction amount in implied decimals (₹41.00 → 4100) 4100
productinfo
mandatory
String Description and details about the product being purchased eCommerce
firstname
mandatory
String Customer's first name John
lastname
optional
String Customer's last name Doe
email
mandatory
String Email ID associated with the customer wallet/account [email protected]
phone
mandatory
Numeric Customer's phone number with country code 919988776655
surl
mandatory
String Success URL where customer will be redirected upon successful transaction https://merchant.com/success
furl
mandatory
String Failure URL where customer will be redirected upon failed transaction https://merchant.com/failure
pg
mandatory
String Constant parameter indicating the payment gateway (CLW) CLW
bankcode
mandatory
String Bank code indicating the payment option used for the transaction PAY
customer_id
conditional
Numeric Unique wallet/customer ID for wallet integration 70000000008
walleturn
conditional
Numeric URN (Unique Reference Number) for wallet transactions 123456789
loadmoney
mandatory
Numeric Amount to be loaded into the wallet if existing balance is insufficient 1000
txn_s2s_flow
mandatory
Numeric Identifies the merchant-hosted transaction flow (constant value 4) 4
hash
mandatory
String SHA512 hash for securing the API request. For more information, refer to Hash Calculation 84bbbf...f5c9

📘

Note: Either customer_id or walleturn must be provided to identify the wallet.

Hash calculation

The hash is calculated using SHA512 with the following string:

key|txnid|amount|productinfo|firstname|email|||||||||||||{salt}

Sample request

curl --location --request POST 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=KOEfPI' \
--data-urlencode 'txnid=ram1234' \
--data-urlencode 'amount=41.00' \
--data-urlencode 'productinfo=eCommerce' \
--data-urlencode 'firstname=John' \
--data-urlencode 'lastname=Doe' \
--data-urlencode '[email protected]' \
--data-urlencode 'phone=919988776655' \
--data-urlencode 'surl=https://merchant.com/success' \
--data-urlencode 'furl=https://merchant.com/failure' \
--data-urlencode 'pg=CLW' \
--data-urlencode 'bankcode=PAY' \
--data-urlencode 'walleturn=123456789' \
--data-urlencode 'loadmoney=1000' \
--data-urlencode 'txn_s2s_flow=4' \
--data-urlencode 'hash=84bbbf...f5c9'

Sample Response

Successful Transaction

{
  "mihpayid": "1735903830180094",
  "status": "success",
  "key": "KOEfPI",
  "txnid": "ram1234",
  "amount": "41.00",
  "addedon": "2025-01-13 18:24:06",
  "net_amount_debit": "40.00",
  "hash": "6e640b16...2b2a",
  "bank_ref_num": "1099",
  "PG_TYPE": "CLW-PG",
  "error": "E000",
  "error_message": "No Error",
  "firstname": "John",
  "lastname": "Doe",
  "email": "[email protected]",
  "phone": "919988776655"
}

Failed Transaction

{
  "mihpayid": "1735903830180095",
  "status": "failure",
  "key": "KOEfPI",
  "txnid": "ram1235",
  "amount": "41.00",
  "error": "E001",
  "error_message": "Payment gateway error",
  "hash": "xyz789abc123..."
}

Response Parameters

ParameterDescriptionExample
mihpayidUnique PayU-generated transaction reference number1735903830180094
statusTransaction final status (success, failure, pending)success
keyMerchant key (echoed back)KOEfPI
txnidTransaction ID (echoed back)ram1234
amountTransaction amount debited from the wallet41.00
addedonTime and date when the transaction was completed2025-01-13 18:24:06
net_amount_debitFinal successfully paid amount after processing fees40.00
hashResponse hash generated by PayU for verification6e640b16...2b2a
bank_ref_numUnique reference number generated by the bank1099
PG_TYPEPayment gateway used for the transactionCLW-PG
errorError code if the transaction failsE000
error_messageDetailed error descriptionNo Error
firstnameCustomer's first nameJohn
lastnameCustomer's last nameDoe
emailCustomer's email[email protected]
phoneCustomer's phone number919988776655

HTTP Status Codes

Status CodeDescription
200OK - Request processed successfully
400Bad Request - Invalid request parameters
401Unauthorized - Authentication failed
500Internal Server Error

Error Scenarios

ErrorDescriptionSolution
Payment gateway failurePG load transaction failedRetry with different payment method
Insufficient load amountloadmoney less than requiredIncrease load amount
Invalid walletCustomer ID or wallet URN not foundVerify wallet details
Transaction limit exceededAmount exceeds allowed limitsCheck transaction limits
Hash mismatchInvalid hash in requestVerify hash calculation
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