The Collect Payment using Rewards API (_payment API) is used to initiate a payment transaction that combines reward points (TWID/Zillion) with other payment methods like Cards or UPI.
Environment
HTTP Method: POST
Request parameters
| Parameter | Description | Example |
|---|---|---|
key mandatory
|
String Merchant key provided by PayU during onboarding.
|
KOEfPI |
txnid mandatory
|
String The transaction ID is a reference number for a specific order that is generated by the merchant.
|
ram1234 |
amount mandatory
|
String The payment amount for the transaction.
|
100 |
productinfo mandatory
|
String A brief description of the product.
|
Product Info |
firstname mandatory
|
String The first name of the customer.
|
Ashish |
email mandatory
|
String The email address of the customer.
|
[email protected] |
phone mandatory
|
String The phone number of the customer.
|
9876543210 |
pg mandatory
|
String The pg parameter must contain SPLITPAY for Rewards transactions.
|
SPLITPAY |
bankcode mandatory
|
String The bankcode parameter. Use TWIDX for TWID Rewards or ZRD for Zillion Rewards.
|
TWIDX |
splitInfo mandatory
|
JSON This parameter must contain the split payment information including child payment instruments and earn payment instruments.
|
See splitInfo structure below |
surl mandatory
|
String The success URL, which is the page PayU will redirect to if the transaction is successful.
|
https://example.com/success |
furl mandatory
|
String The failure URL, which is the page PayU will redirect to if the transaction fails.
|
https://example.com/failure |
hash mandatory
|
String The hash calculated by the merchant using: sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|||||SALT)
|
|
txn_s2s_flow mandatory
|
String This parameter must be passed with the value as 4 for Legacy Decoupled flow.
|
4 |
udf1 - udf5 optional
|
String User-defined fields used to store any information corresponding to a particular transaction.
|
splitInfo JSON Object
The splitInfo parameter contains the payment instrument details for split payments with rewards.
Structure
{
"childPaymentInstruments": [...],
"earnPaymentInstruments": [...],
"totalAmount": "1000.00",
"consent": false
}childPaymentInstruments Fields
| Field | Description | Example |
|---|---|---|
| name | The name of the payment method: CC for Cards, RD for Rewards, UPI for UPI | CC |
| bankCode | The bank code identifier. Use TWIDLS for TWID or ZLS for Zillion |
CC |
cardNumber mandatory for cards |
The credit/debit card number for the transaction | 5123456789012346 |
cvv mandatory for cards |
The Card Verification Value (CVV) | 345 |
validThrough mandatory for cards |
The card expiry date in MM/YY format | 07/25 |
vpa mandatory for UPI |
The Virtual Payment Address for UPI transactions | kk@okaxis |
rewardId mandatory for TWID |
The TWID Rewards card holder ID | 269434 |
cardBin mandatory for TWID |
The TWID Rewards card BIN | 512345 |
cardLastFour mandatory for TWID |
The TWID Rewards card last four digits | 2346 |
| transactionAmount | The amount to be processed for this payment instrument | 512 |
Sample request
Burn Points with Card (TWID)
curl -X POST "https://test.payu.in/_payment" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"key": "KOEfPI",
"txnid": "ram1234",
"productinfo": "Product Info",
"amount": "100",
"email": "[email protected]",
"firstname": "Payu-Admin",
"lastname": "",
"phone": "880**08522",
"surl": "https://pp56admin.payu.in/test_response",
"furl": "https://pp56admin.payu.in/test_response",
"pg": "SPLITPAY",
"bankcode": "TWIDX",
"txn_s2s_flow": "4",
"splitInfo": {
"childPaymentInstruments": [
{
"name": "CC",
"bankCode": "CC",
"cardNumber": "5123456789012346",
"cvv": "345",
"validThrough": "07/25",
"ownerName": "Payu",
"transactionAmount": "412"
},
{
"name": "RD",
"bankCode": "TWIDLS",
"transactionAmount": "100",
"rewardId": 269434,
"cardBin": "512345",
"cardLastFour": "2346"
}
]
},
"hash": "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
}'import requests
import json
url = "https://test.payu.in/_payment"
data = {
"key": "KOEfPI",
"txnid": "ram1234",
"productinfo": "Product Info",
"amount": "100",
"email": "[email protected]",
"firstname": "Payu-Admin",
"lastname": "",
"phone": "880**08522",
"surl": "https://pp56admin.payu.in/test_response",
"furl": "https://pp56admin.payu.in/test_response",
"pg": "SPLITPAY",
"bankcode": "TWIDX",
"txn_s2s_flow": "4",
"splitInfo": {
"childPaymentInstruments": [
{
"name": "CC",
"bankCode": "CC",
"cardNumber": "5123456789012346",
"cvv": "345",
"validThrough": "07/25",
"ownerName": "Payu",
"transactionAmount": "412"
},
{
"name": "RD",
"bankCode": "TWIDLS",
"transactionAmount": "100",
"rewardId": 269434,
"cardBin": "512345",
"cardLastFour": "2346"
}
]
},
"hash": "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, json=data)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.text}")const url = "https://test.payu.in/_payment";
const data = {
key: "KOEfPI",
txnid: "ram1234",
productinfo: "Product Info",
amount: "100",
email: "[email protected]",
firstname: "Payu-Admin",
lastname: "",
phone: "880**08522",
surl: "https://pp56admin.payu.in/test_response",
furl: "https://pp56admin.payu.in/test_response",
pg: "SPLITPAY",
bankcode: "TWIDX",
txn_s2s_flow: "4",
splitInfo: {
childPaymentInstruments: [
{
name: "CC",
bankCode: "CC",
cardNumber: "5123456789012346",
cvv: "345",
validThrough: "07/25",
ownerName: "Payu",
transactionAmount: "412"
},
{
name: "RD",
bankCode: "TWIDLS",
transactionAmount: "100",
rewardId: 269434,
cardBin: "512345",
cardLastFour: "2346"
}
]
},
hash: "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
};
async function makePayment() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
const responseText = await response.text();
console.log(`Status Code: ${response.status}`);
console.log(`Response: ${responseText}`);
} catch (error) {
console.log(`Error: ${error.message}`);
}
}
makePayment();import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.HashMap;
import java.util.Map;
import java.util.Arrays;
public class PaymentRequest {
public static void main(String[] args) {
String url = "https://test.payu.in/_payment";
Map<String, Object> childInstrument = new HashMap<>();
childInstrument.put("name", "CC");
childInstrument.put("bankCode", "CC");
childInstrument.put("cardNumber", "5123456789012346");
childInstrument.put("cvv", "345");
childInstrument.put("validThrough", "07/25");
childInstrument.put("ownerName", "Payu");
childInstrument.put("transactionAmount", "412");
Map<String, Object> rewardInstrument = new HashMap<>();
rewardInstrument.put("name", "RD");
rewardInstrument.put("bankCode", "TWIDLS");
rewardInstrument.put("transactionAmount", "100");
rewardInstrument.put("rewardId", 269434);
rewardInstrument.put("cardBin", "512345");
rewardInstrument.put("cardLastFour", "2346");
Map<String, Object> splitInfo = new HashMap<>();
splitInfo.put("childPaymentInstruments", Arrays.asList(childInstrument, rewardInstrument));
Map<String, Object> data = new HashMap<>();
data.put("key", "KOEfPI");
data.put("txnid", "ram1234");
data.put("productinfo", "Product Info");
data.put("amount", "100");
data.put("email", "[email protected]");
data.put("firstname", "Payu-Admin");
data.put("lastname", "");
data.put("phone", "880**08522");
data.put("surl", "https://pp56admin.payu.in/test_response");
data.put("furl", "https://pp56admin.payu.in/test_response");
data.put("pg", "SPLITPAY");
data.put("bankcode", "TWIDX");
data.put("txn_s2s_flow", "4");
data.put("splitInfo", splitInfo);
data.put("hash", "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741");
Gson gson = new GsonBuilder().create();
String jsonData = gson.toJson(data);
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonData))
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Status Code: " + response.statusCode());
System.out.println("Response: " + response.body());
} catch (IOException | InterruptedException e) {
System.out.println("Error: " + e.getMessage());
}
}
}<?php
$url = "https://test.payu.in/_payment";
$data = array(
"key" => "KOEfPI",
"txnid" => "ram1234",
"productinfo" => "Product Info",
"amount" => "100",
"email" => "[email protected]",
"firstname" => "Payu-Admin",
"lastname" => "",
"phone" => "880**08522",
"surl" => "https://pp56admin.payu.in/test_response",
"furl" => "https://pp56admin.payu.in/test_response",
"pg" => "SPLITPAY",
"bankcode" => "TWIDX",
"txn_s2s_flow" => "4",
"splitInfo" => array(
"childPaymentInstruments" => array(
array(
"name" => "CC",
"bankCode" => "CC",
"cardNumber" => "5123456789012346",
"cvv" => "345",
"validThrough" => "07/25",
"ownerName" => "Payu",
"transactionAmount" => "412"
),
array(
"name" => "RD",
"bankCode" => "TWIDLS",
"transactionAmount" => "100",
"rewardId" => 269434,
"cardBin" => "512345",
"cardLastFour" => "2346"
)
)
),
"hash" => "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status Code: " . $httpCode . "\n";
echo "Response: " . $response . "\n";
?>Burn Points with Card (Zillion)
curl -X POST "https://test.payu.in/_payment" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"key": "KOEfPI",
"txnid": "ram1234",
"productinfo": "Product Info",
"amount": "100",
"email": "[email protected]",
"firstname": "Payu-Admin",
"lastname": "",
"phone": "880**08522",
"surl": "https://pp56admin.payu.in/test_response",
"furl": "https://pp56admin.payu.in/test_response",
"pg": "SPLITPAY",
"bankcode": "ZRD",
"txn_s2s_flow": "4",
"splitInfo": {
"childPaymentInstruments": [
{
"name": "CC",
"bankCode": "CC",
"cardNumber": "5123456789012346",
"cvv": "345",
"validThrough": "07/25",
"ownerName": "Payu",
"transactionAmount": "99"
},
{
"name": "RD",
"bankCode": "ZLS",
"transactionAmount": "1"
}
]
},
"hash": "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
}'Burn Points with UPI (TWID)
curl -X POST "https://test.payu.in/_payment" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"key": "KOEfPI",
"txnid": "ram1234",
"productinfo": "Product Info",
"amount": "100",
"email": "[email protected]",
"firstname": "Payu-Admin",
"lastname": "",
"phone": "9999999999",
"surl": "https://pp56admin.payu.in/test_response",
"furl": "https://pp56admin.payu.in/test_response",
"pg": "SPLITPAY",
"bankcode": "TWIDX",
"txn_s2s_flow": "4",
"splitInfo": {
"childPaymentInstruments": [
{
"name": "UPI",
"bankCode": "UPI",
"vpa": "kk@okaxis",
"transactionAmount": "412"
},
{
"name": "RD",
"bankCode": "TWIDLS",
"transactionAmount": "100",
"rewardId": 269434,
"cardBin": "512345",
"cardLastFour": "2346"
}
]
},
"hash": "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
}'Burn Points with UPI (Zillion)
curl -X POST "https://test.payu.in/_payment" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"key": "KOEfPI",
"txnid": "ram1234",
"productinfo": "Product Info",
"amount": "100",
"email": "[email protected]",
"firstname": "Payu-Admin",
"lastname": "",
"phone": "9999999999",
"surl": "https://pp56admin.payu.in/test_response",
"furl": "https://pp56admin.payu.in/test_response",
"pg": "SPLITPAY",
"bankcode": "ZRD",
"txn_s2s_flow": "4",
"splitInfo": {
"childPaymentInstruments": [
{
"name": "UPI",
"bankCode": "UPI",
"vpa": "kk@okaxis",
"transactionAmount": "99"
},
{
"name": "RD",
"bankCode": "ZLS",
"transactionAmount": "1"
}
]
},
"hash": "3842a54c294792e9c8c37c7eba8d9693a85517cb7a47aea33a0368a8f6b337e8343f5ef4f726af206ef68549b542ff75dc66fb3b8e8fd5786733131a74cbe741"
}'Response parameters
| Parameter | Description | Example |
|---|---|---|
| mihpayid | String - Unique reference number created for each transaction at PayU | 999091000010475 |
| mode | String - Payment mode used for the transaction | SPLITPAY |
| status | String - Transaction status: success, failure, or pending | success |
| unmappedstatus | String - Internal transaction status | success |
| txnid | String - Transaction ID provided by merchant | ram1234 |
| amount | String - Transaction amount | 100 |
| bankcode | String - Bank code used for the transaction | ZRD |
| error | String - Error code | E000 |
| error_Message | String - Error message description | No Error |
| splitPayInfo | Object - Contains details of split payment instruments and their respective amounts. For field descriptions, refer to splitPayInfo Fields. | See sample below |
splitPayInfo Fields
The splitPayInfo object contains the details of each payment instrument used in the split payment transaction. It includes separate objects for each payment method (e.g., cc for Cards, upi for UPI, rd for Rewards).
| Field | Description | Example |
|---|---|---|
| cc | Object - Card payment instrument details (present when card is used) | |
| cc.name | String - Name of the payment method | CC |
| cc.bankCode | String - Bank code identifier for the card | CC |
| cc.transactionAmount | String - Amount processed via card | 412 |
| upi | Object - UPI payment instrument details (present when UPI is used) | |
| upi.name | String - Name of the payment method | UPI |
| upi.bankCode | String - Bank code identifier for UPI | UPI |
| upi.vpa | String - Virtual Payment Address used for the transaction | kk@okaxis |
| upi.transactionAmount | String - Amount processed via UPI | 99 |
| rd | Object - Reward payment instrument details | |
| rd.name | String - Name of the payment method | RD |
| rd.bankCode | String - Bank code identifier for rewards (TWIDLS for TWID, ZLS for Zillion) | TWIDLS |
| rd.transactionAmount | String - Amount redeemed via reward points | 100 |
Sample response
Success scenario (TWID + Cards)
{
"mihpayid": "999091000010480",
"mode": "SPLITPAY",
"status": "success",
"unmappedstatus": "success",
"key": "KOEfPI",
"txnid": "ram1234",
"amount": "512",
"discount": "0.00",
"net_amount_debit": "512",
"addedon": "2025-01-10 15:00:00",
"productinfo": "Product Info",
"firstname": "Payu-Admin",
"email": "[email protected]",
"phone": "8800108522",
"hash": "29efcd4f7a8a9a60a61481d70e21baf5ba6e7a472716d9b99bd911ef5390240411107b959e5bc8cdabc31463d150d4e02578349afa20529b18e271f60dd6db59",
"payment_source": "payuS2S",
"PG_TYPE": "SPLITPAY-PG",
"bank_ref_num": "1255",
"error": "E000",
"bankcode": "TWIDX",
"error_Message": "No Error",
"splitPayInfo": {
"cc": {
"name": "CC",
"bankCode": "CC",
"transactionAmount": "412"
},
"rd": {
"name": "RD",
"bankCode": "TWIDLS",
"transactionAmount": "100"
}
}
}Success scenario (Zillion + UPI)
{
"mihpayid": "999091000010475",
"mode": "SPLITPAY",
"status": "success",
"unmappedstatus": "success",
"key": "KOEfPI",
"txnid": "ram12345",
"amount": "100",
"discount": "0.00",
"net_amount_debit": "100",
"addedon": "2025-01-10 14:56:13",
"productinfo": "Product Info",
"firstname": "Payu-Admin",
"email": "[email protected]",
"phone": "8800**8522",
"hash": "29efcd4f7a8a9a60a61481d70e21baf5ba6e7a472716d9b99bd911ef5390240411107b959e5bc8cdabc31463d150d4e02578349afa20529b18e271f60dd6db59",
"payment_source": "payuS2S",
"PG_TYPE": "SPLITPAY-PG",
"bank_ref_num": "1254",
"error": "E000",
"bankcode": "ZRD",
"error_Message": "No Error",
"splitPayInfo": {
"upi": {
"name": "UPI",
"bankCode": "UPI",
"vpa": "kk@okaxis",
"transactionAmount": "99"
},
"rd": {
"name": "RD",
"bankCode": "ZLS",
"transactionAmount": "1"
}
}
}Failure scenario
{
"mihpayid": "20869277619",
"mode": "CC",
"status": "failure",
"unmappedstatus": "failed",
"key": "L43t1c",
"txnid": "26ba7cd6a67b0a010542",
"amount": "1.00",
"cardCategory": "domestic",
"discount": "0.00",
"net_amount_debit": "0.00",
"error": "E1903",
"error_Message": "Authorization failed at Bank"
}