For Standing Instruction (SI) mandate registrations, append the following parameters to your basic S2S payload.
HTTP Method: POST
Environment
| Test Environment | https://test.payu.in/_payment |
| Production Environment | https://secure.payu.in/_payment |
Content Type: application/x-www-form-urlencoded
Request Parameters
The following table lists all the request parameters for S2S mandate registration for cards:
Mandatory Parameters
| Parameter | Description | Example |
|---|---|---|
keymandatory | StringMerchant key provided by PayU during onboarding. | JPM7Fg |
txnidmandatory | StringThe transaction ID is a reference number for a specific order generated by the merchant. Must be unique. | payuTestTxn12345 |
amountmandatory | StringThe payment amount for the transaction. | 100.00 |
productinfomandatory | StringA brief description of the product. Character Limit: 100 | iPhone |
firstnamemandatory | StringThe first name of the customer. Character Limit: 60 | Ashish |
emailmandatory | StringThe email address of the customer. Character Limit: 50 | [email protected] |
phonemandatory | StringThe phone number of the customer. | 9876543210 |
surlmandatory | StringThe Success URL - page PayU will redirect to if the transaction is successful. | https://example.com/success |
furlmandatory | StringThe Failure URL - page PayU will redirect to if the transaction fails. | https://example.com/failure |
hashmandatory | StringHash calculated for transaction security. | <generated_hash> |
pgmandatory | StringPayment gateway type. For cards, use CC. | CC |
bankcodemandatory | StringBank code for the payment option. Use CC for credit cards, DC for debit cards. | CC |
ccnummandatory | String13-19 digit card number (15 for AMEX, 13-19 for Maestro). Validate with LUHN algorithm. | 5506900480000008 |
ccvvmandatory | String3-digit CVV (4 digits for AMEX). | 123 |
ccnamemandatory | StringCardholder name as entered by the customer. | Test User |
ccexpmonmandatory | StringCard expiry month in MM format (01-12). | 09 |
ccexpyrmandatory | StringCard expiry year in YYYY format. | 2026 |
udf1mandatory for LRS S2S transaction | String The Permanent Account Number (PAN) of the buyer must be collected in this field. | AELPR****E |
udf3mandatory for LRS S2S transaction | String The date of birth of the buyer must be collected using this field in the DD-MM-YYYY format as on their Permanent Account Number (PAN).Note: This should be validated by PAN Status Check API | 02-02-1980 |
udf4mandatory for payment aggregators | String This parameter must include end merchant legal entity name. | XYZ Pvt. Ltd. |
udf5mandatory | String The invoice ID or invoice number must be collected using this field. | INV123456 |
txn_s2s_flowmandatory | IntegerParameter to enable S2S flow. Set to 4 for S2S4 flow. | 4 |
s2s_client_ipmandatory | StringClient IP captured by merchant in S2S flow. Required for fraud detection. | 10.200.12.12 |
s2s_device_infomandatory | StringUser Agent captured by merchant in S2S flow. | Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0 |
user_credentialsmandatory | StringFormat: merchant_key:customer_id. Required for token provisioning. | JPM7Fg:customer_1112 |
store_cardmandatory | IntegerSet to 1 to store the card token. | 1 |
si_details Object Structure
The si_details parameter is a JSON object containing the following fields:
{
"billingAmount": "200.00",
"billingCurrency": "INR",
"billingCycle": "ADHOC",
"billingInterval": 1,
"paymentStartDate": "2025-06-05",
"paymentEndDate": "2025-12-01",
"siTokenRequestor": "2"
}| Field | Description | Example |
|---|---|---|
billingAmount | Maximum amount for recurring transactions | 200.00 |
billingCurrency | Currency code | INR |
billingCycle | Billing frequency (DAILY, WEEKLY, MONTHLY, YEARLY, ADHOC) | ADHOC |
billingInterval | Interval between billing cycles | 1 |
paymentStartDate | Mandate start date (YYYY-MM-DD) | 2025-06-05 |
paymentEndDate | Mandate end date (YYYY-MM-DD) | 2025-12-01 |
siTokenRequestor | Token requestor ID. Set to 2 for mandate registrations. | 2 |
Sample Request
The sample code block for S2S mandate registration for cards is similar to the following:
curl --location --request POST 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=JPM7Fg' \
--data-urlencode 'txnid=payuTestMandate12345' \
--data-urlencode 'amount=100.00' \
--data-urlencode 'firstname=Ashish' \
--data-urlencode '[email protected]' \
--data-urlencode 'phone=9988776655' \
--data-urlencode 'productinfo=Subscription Plan' \
--data-urlencode 'surl=https://test.payu.in/admin/test_response' \
--data-urlencode 'furl=https://test.payu.in/admin/test_response' \
--data-urlencode 'pg=CC' \
--data-urlencode 'bankcode=CC' \
--data-urlencode 'ccnum=5506900480000008' \
--data-urlencode 'ccname=Test User' \
--data-urlencode 'ccvv=123' \
--data-urlencode 'ccexpmon=09' \
--data-urlencode 'ccexpyr=2026' \
--data-urlencode 'api_version=7' \
--data-urlencode 'si=1' \
--data-urlencode 'si_details={"billingAmount":"200.00","billingCurrency":"INR","billingCycle":"ADHOC","billingInterval":1,"paymentStartDate":"2025-06-05","paymentEndDate":"2025-12-01","siTokenRequestor":"2"}' \
--data-urlencode 'udf1=AELPR****E' \
--data-urlencode 'udf2=' \
--data-urlencode 'udf3=02-02-1980' \
--data-urlencode 'udf4=XYZ Pvt. Ltd.' \
--data-urlencode 'udf5=098450845' \
--data-urlencode 'txn_s2s_flow=4' \
--data-urlencode 's2s_client_ip=10.200.12.12' \
--data-urlencode 's2s_device_info=Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0' \
--data-urlencode 'hash=YOUR_CALCULATED_HASH'import requests
url = "https://test.payu.in/_payment"
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
data = {
'key': 'JPM7Fg',
'txnid': 'payuTestMandate12345',
'amount': '100.00',
'firstname': 'Ashish',
'email': '[email protected]',
'phone': '9988776655',
'productinfo': 'Subscription Plan',
'surl': 'https://test.payu.in/admin/test_response',
'furl': 'https://test.payu.in/admin/test_response',
'pg': 'CC',
'bankcode': 'CC',
'ccnum': '5506900480000008',
'ccname': 'Test User',
'ccvv': '123',
'ccexpmon': '09',
'ccexpyr': '2026',
'api_version': '7',
'si': '1',
'si_details': '{"billingAmount":"200.00","billingCurrency":"INR","billingCycle":"ADHOC","billingInterval":1,"paymentStartDate":"2025-06-05","paymentEndDate":"2025-12-01","siTokenRequestor":"2"}',
'udf1': 'AELPR****E',
'udf2': '',
'udf3': '02-02-1980',
'udf4': 'XYZ Pvt. Ltd.',
'udf5': '098450845',
'txn_s2s_flow': '4',
's2s_client_ip': '10.200.12.12',
's2s_device_info': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0',
'hash': 'YOUR_CALCULATED_HASH'
}
try:
response = requests.post(url, headers=headers, data=data)
print("Status Code:", response.status_code)
print("Response:", response.text)
except requests.exceptions.RequestException as e:
print("Error:", e)using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string url = "https://test.payu.in/_payment";
using HttpClient client = new HttpClient();
List<KeyValuePair<string, string>> postData = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("key", "JPM7Fg"),
new KeyValuePair<string, string>("txnid", "payuTestMandate12345"),
new KeyValuePair<string, string>("amount", "100.00"),
new KeyValuePair<string, string>("firstname", "Ashish"),
new KeyValuePair<string, string>("email", "[email protected]"),
new KeyValuePair<string, string>("phone", "9988776655"),
new KeyValuePair<string, string>("productinfo", "Subscription Plan"),
new KeyValuePair<string, string>("surl", "https://test.payu.in/admin/test_response"),
new KeyValuePair<string, string>("furl", "https://test.payu.in/admin/test_response"),
new KeyValuePair<string, string>("pg", "CC"),
new KeyValuePair<string, string>("bankcode", "CC"),
new KeyValuePair<string, string>("ccnum", "5506900480000008"),
new KeyValuePair<string, string>("ccname", "Test User"),
new KeyValuePair<string, string>("ccvv", "123"),
new KeyValuePair<string, string>("ccexpmon", "09"),
new KeyValuePair<string, string>("ccexpyr", "2026"),
new KeyValuePair<string, string>("api_version", "7"),
new KeyValuePair<string, string>("si", "1"),
new KeyValuePair<string, string>("si_details", "{\"billingAmount\":\"200.00\",\"billingCurrency\":\"INR\",\"billingCycle\":\"ADHOC\",\"billingInterval\":1,\"paymentStartDate\":\"2025-06-05\",\"paymentEndDate\":\"2025-12-01\",\"siTokenRequestor\":\"2\"}"),
new KeyValuePair<string, string>("udf1", "AELPR****E"),
new KeyValuePair<string, string>("udf2", ""),
new KeyValuePair<string, string>("udf3", "02-02-1980"),
new KeyValuePair<string, string>("udf4", "XYZ Pvt. Ltd."),
new KeyValuePair<string, string>("udf5", "098450845"),
new KeyValuePair<string, string>("txn_s2s_flow", "4"),
new KeyValuePair<string, string>("s2s_client_ip", "10.200.12.12"),
new KeyValuePair<string, string>("s2s_device_info", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0"),
new KeyValuePair<string, string>("hash", "YOUR_CALCULATED_HASH")
};
FormUrlEncodedContent content = new FormUrlEncodedContent(postData);
try
{
HttpResponseMessage response = await client.PostAsync(url, content);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine($"Status Code: {(int)response.StatusCode}");
Console.WriteLine($"Response: {responseBody}");
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}async function makePayment() {
const url = "https://test.payu.in/_payment";
const formData = new URLSearchParams();
formData.append('key', 'JPM7Fg');
formData.append('txnid', 'payuTestMandate12345');
formData.append('amount', '100.00');
formData.append('firstname', 'Ashish');
formData.append('email', '[email protected]');
formData.append('phone', '9988776655');
formData.append('productinfo', 'Subscription Plan');
formData.append('surl', 'https://test.payu.in/admin/test_response');
formData.append('furl', 'https://test.payu.in/admin/test_response');
formData.append('pg', 'CC');
formData.append('bankcode', 'CC');
formData.append('ccnum', '5506900480000008');
formData.append('ccname', 'Test User');
formData.append('ccvv', '123');
formData.append('ccexpmon', '09');
formData.append('ccexpyr', '2026');
formData.append('api_version', '7');
formData.append('si', '1');
formData.append('si_details', '{"billingAmount":"200.00","billingCurrency":"INR","billingCycle":"ADHOC","billingInterval":1,"paymentStartDate":"2025-06-05","paymentEndDate":"2025-12-01","siTokenRequestor":"2"}');
formData.append('udf1', 'AELPR****E');
formData.append('udf2', '');
formData.append('udf3', '02-02-1980');
formData.append('udf4', 'XYZ Pvt. Ltd.');
formData.append('udf5', '098450845');
formData.append('txn_s2s_flow', '4');
formData.append('s2s_client_ip', '10.200.12.12');
formData.append('s2s_device_info', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0');
formData.append('hash', 'YOUR_CALCULATED_HASH');
const requestOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: formData
};
try {
const response = await fetch(url, requestOptions);
const responseText = await response.text();
console.log('Status Code:', response.status);
console.log('Response:', responseText);
} catch (error) {
console.error('Error:', error);
}
}
makePayment();import java.io.*;
import java.net.*;
import java.nio.charset.StandardCharsets;
public class PayUPayment {
public static void main(String[] args) {
try {
String url = "https://test.payu.in/_payment";
URL obj = new URL(url);
HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setDoOutput(true);
StringBuilder postData = new StringBuilder();
postData.append("key=").append(URLEncoder.encode("JPM7Fg", StandardCharsets.UTF_8));
postData.append("&txnid=").append(URLEncoder.encode("payuTestMandate12345", StandardCharsets.UTF_8));
postData.append("&amount=").append(URLEncoder.encode("100.00", StandardCharsets.UTF_8));
postData.append("&firstname=").append(URLEncoder.encode("Ashish", StandardCharsets.UTF_8));
postData.append("&email=").append(URLEncoder.encode("[email protected]", StandardCharsets.UTF_8));
postData.append("&phone=").append(URLEncoder.encode("9988776655", StandardCharsets.UTF_8));
postData.append("&productinfo=").append(URLEncoder.encode("Subscription Plan", StandardCharsets.UTF_8));
postData.append("&surl=").append(URLEncoder.encode("https://test.payu.in/admin/test_response", StandardCharsets.UTF_8));
postData.append("&furl=").append(URLEncoder.encode("https://test.payu.in/admin/test_response", StandardCharsets.UTF_8));
postData.append("&pg=").append(URLEncoder.encode("CC", StandardCharsets.UTF_8));
postData.append("&bankcode=").append(URLEncoder.encode("CC", StandardCharsets.UTF_8));
postData.append("&ccnum=").append(URLEncoder.encode("5506900480000008", StandardCharsets.UTF_8));
postData.append("&ccname=").append(URLEncoder.encode("Test User", StandardCharsets.UTF_8));
postData.append("&ccvv=").append(URLEncoder.encode("123", StandardCharsets.UTF_8));
postData.append("&ccexpmon=").append(URLEncoder.encode("09", StandardCharsets.UTF_8));
postData.append("&ccexpyr=").append(URLEncoder.encode("2026", StandardCharsets.UTF_8));
postData.append("&api_version=").append(URLEncoder.encode("7", StandardCharsets.UTF_8));
postData.append("&si=").append(URLEncoder.encode("1", StandardCharsets.UTF_8));
postData.append("&si_details=").append(URLEncoder.encode("{\"billingAmount\":\"200.00\",\"billingCurrency\":\"INR\",\"billingCycle\":\"ADHOC\",\"billingInterval\":1,\"paymentStartDate\":\"2025-06-05\",\"paymentEndDate\":\"2025-12-01\",\"siTokenRequestor\":\"2\"}", StandardCharsets.UTF_8));
postData.append("&udf1=").append(URLEncoder.encode("AELPR****E", StandardCharsets.UTF_8));
postData.append("&udf2=").append(URLEncoder.encode("", StandardCharsets.UTF_8));
postData.append("&udf3=").append(URLEncoder.encode("02-02-1980", StandardCharsets.UTF_8));
postData.append("&udf4=").append(URLEncoder.encode("XYZ Pvt. Ltd.", StandardCharsets.UTF_8));
postData.append("&udf5=").append(URLEncoder.encode("098450845", StandardCharsets.UTF_8));
postData.append("&txn_s2s_flow=").append(URLEncoder.encode("4", StandardCharsets.UTF_8));
postData.append("&s2s_client_ip=").append(URLEncoder.encode("10.200.12.12", StandardCharsets.UTF_8));
postData.append("&s2s_device_info=").append(URLEncoder.encode("Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0", StandardCharsets.UTF_8));
postData.append("&hash=").append(URLEncoder.encode("YOUR_CALCULATED_HASH", StandardCharsets.UTF_8));
try (DataOutputStream wr = new DataOutputStream(connection.getOutputStream())) {
wr.writeBytes(postData.toString());
wr.flush();
}
int responseCode = connection.getResponseCode();
System.out.println("Status Code: " + responseCode);
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("Response: " + response.toString());
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}<?php
$url = "https://test.payu.in/_payment";
$postData = array(
'key' => 'JPM7Fg',
'txnid' => 'payuTestMandate12345',
'amount' => '100.00',
'firstname' => 'Ashish',
'email' => '[email protected]',
'phone' => '9988776655',
'productinfo' => 'Subscription Plan',
'surl' => 'https://test.payu.in/admin/test_response',
'furl' => 'https://test.payu.in/admin/test_response',
'pg' => 'CC',
'bankcode' => 'CC',
'ccnum' => '5506900480000008',
'ccname' => 'Test User',
'ccvv' => '123',
'ccexpmon' => '09',
'ccexpyr' => '2026',
'api_version' => '7',
'si' => '1',
'si_details' => '{"billingAmount":"200.00","billingCurrency":"INR","billingCycle":"ADHOC","billingInterval":1,"paymentStartDate":"2025-06-05","paymentEndDate":"2025-12-01","siTokenRequestor":"2"}',
'udf1' => 'AELPR****E',
'udf2' => '',
'udf3' => '02-02-1980',
'udf4' => 'XYZ Pvt. Ltd.',
'udf5' => '098450845',
'txn_s2s_flow' => '4',
's2s_client_ip' => '10.200.12.12',
's2s_device_info' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) PayU-API-Test/1.0',
'hash' => 'YOUR_CALCULATED_HASH'
);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($postData)
)
);
$context = stream_context_create($options);
try {
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
echo "Error: Failed to make request\n";
} else {
$http_response_header = $http_response_header ?? [];
echo "Status: " . (isset($http_response_header[0]) ? $http_response_header[0] : 'Unknown') . "\n";
echo "Response: " . $result . "\n";
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
?>Perfect! Here are all the language bindings presented sequentially - Python, C#, JavaScript, Java, and PHP - each implementing the exact same functionality as your original CURL request. Each code snippet is complete and ready to use! 🚀
Important:
- Replace
YOUR_CALCULATED_HASHwith the actual hash value calculated using the formula:SHA512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|||||si_details|SALT)- Ensure all placeholder values are replaced with actual transaction data
- The
si_detailsJSON must be properly URL-encoded when sending the request
Hash Generation for SI Transactions
Important:When
api_version=7is passed in the payload, thehashmust be generated with the following sequence:
SHA512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|||||si_details|SALT)Using Network Tokens with Mandates
For mandate registration using network tokens:
- Set
siTokenRequestorto2in thesi_detailsobject - Provide network token details using the Update SI API after registration
Note:Network token details cannot be passed during mandate registration. Use the Update SI API to add network token information after the mandate is registered.
