Equated Monthly Installment (EMI) as a payment option gives your customers the affordability to purchase high-value products by dividing the purchase price across monthly installments.
You can collect EMI payments directly from customers using the Merchant Hosted (seamless) integration. Post "EMI" for paymentMethod.name, the corresponding bank and tenure code for paymentMethod.bankCode, and the card details in paymentMethod.paymentCard.
For the list of supported EMI bank and tenure codes, refer to EMI Codes.
Environment
| Test Environment | https://apitest.payu.in/v2/payments |
| Production Environment | https://api.payu.in/v2/payments |
Request header
| Parameter | Description |
|---|---|
| date | The current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT. |
| authorization | The actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to authorization fields description. |
authorization fields description
| Field | Description |
|---|---|
| username | Represents the username or identifier for the client or merchant, for example smsplus. |
| algorithm | Use SHA512 algorithm for hashing and send this as header value. |
| headers | Specifies which headers have been used in generating the hash, for example date. |
| signature | The HMAC signature generated using the specified algorithm. For more information, refer to hashing algorithm. |
hashing algorithm
You must hash the request parameters using the following hash logic:
Hash logic: sha512(`<Body data>` + '|' + date + '|' + merchant_secret)
Where <Body data> contains the request body posted with the request.
Sample header code
var merchant_key = '<YOUR_TEST_KEY>';
var merchant_secret = 'YOUR_TEST_SALT';
// date
var date = new Date();
date = date.toUTCString();
// authorization
var authorization = getAuthHeader(date);
function getAuthHeader(date) {
var AUTH_TYPE = 'sha512';
var data = isEmpty(request['data']) ? "" : request['data'];
var hash_string = data + '|' + date + '|' + merchant_secret;
var hash = CryptoJS.SHA512(hash_string).toString(CryptoJS.enc.Hex);
return `hmac username="${merchant_key}", algorithm="${AUTH_TYPE}", headers="date", signature="${hash}"`;
}Request body
All the parameters are mandatory.
| Parameter | Description | Example |
|---|---|---|
| accountId | String The merchant key provided by PayU during onboarding. | MERCHANT123 |
| txnId | String Unique transaction ID generated by merchant. Character limit: 50. | TXN_EMI_20261005 |
| currency | String Currency code for payment. Must be "INR". | INR |
| paymentMethod | Object Details about EMI method:• name: Must be "EMI" • bankCode: EMI tenure code (e.g., "EMI6", "HDFC03") • paymentCard: Card details object. For more information, refer to paymentMethod object fields description | {"name": "EMI", "bankCode": "EMI6"} |
| order | Object Details about the transaction order including product info and payment charge specification. | Refer to order section |
| additionalInfo | Object S2S flow configuration and transaction options. | Refer to additionalInfo object fields description. |
| callBackActions | Object Redirection URLs for payment outcomes. | Refer to callBackActions object fields description |
| billingDetails | Object Billing contact and address details of customer. | Refer to billingDetails object fields description |
paymentMethod object fields description
| Field | Description | Example |
|---|---|---|
name |
|
EMI |
bankCode |
|
EMI6 |
paymentCard |
|
Refer to paymentCard section |
paymentCard object fields description
| Parameter | Description | Example |
|---|---|---|
cardNumbermandatory for physical card |
Card number. | 5***77***517***7 |
validThroughmandatory for physical card |
Expiry date in MM/YYYY format. | |
ownerNameoptional |
Name of the card owner. | |
cvvmandatory for physical card |
CVV number of the card. | 123 |
tavvmandatory for saved card |
Cryptogram of the card for tokenized payments. | AAABA***mQAAAABjRWWZEEFgFz |
last4Digitsmandatory for saved card |
Last four digits of the card. | 0603 |
cardTokenTypemandatory for saved card |
Card token type. Valid values: PAYU, NETWORK, ISSUER. | PAYU |
cardTokenmandatory for saved card |
Card token of the stored card. | b5**7857680876***m9 |
order object fields description
| Parameter | Description | Example |
|---|---|---|
productInfomandatory | Product details. Type: String | Product details |
orderedItemoptional | Details about the items ordered. Type: Array of Objects | |
userDefinedFieldsoptional | Custom fields for additional information. Type: Object. Fields: udf1, udf2, udf3, udf4, udf5, udf6, udf7, udf8, udf9, udf10. | |
paymentChargeSpecificationmandatory | Includes amount and charges. Type: Object. For more information, refer to paymentChargeSpecification object fields description |
paymentChargeSpecification object fields description
| Parameter | Description | Example |
|---|---|---|
pricemandatory | The transaction amount. Type: Number | 1000 |
netAmountDebitoptional | Net amount to be debited. Type: Number | 1000 |
taxSpecificationoptional | Tax details of the product/order. Type: Object | |
convenienceFeeoptional | Fees format. Type: String | CC:12 |
offersoptional | Offers applied or available for the payment. Type: Object |
userDefinedFields object fields description
| Field | Description |
|---|---|
| udf1 | User defined field. |
| udf2 | User defined field. |
| udf3 | User defined field. |
| udf4 | User defined field. |
| udf5 | User defined field. |
| udf6 | User defined field. |
| udf7 | User defined field. |
| udf8 | User defined field. |
| udf9 | User defined field. |
| udf10 | User defined field. |
additionalInfo object fields description
| Parameter | Description | Example |
|---|---|---|
txnS2sFlowmandatory |
Transaction flow configuration. Set to "4" for seamless 3DS redirection. |
4 |
createOrderoptional |
A boolean flag indicating whether to persist the order details in PayU (true / false). |
true |
enforcePaymethodoptional |
Restricts transaction mode. For EMI, set to "EMI". |
EMI |
callBackActions object fields description
| Parameter | Description | Example |
|---|---|---|
successActionmandatory |
URL to be called on payment success. | https://example.com/success |
failureActionmandatory |
URL to be called on payment failure. | https://example.com/failure |
cancelActionmandatory |
URL to be called if user cancels the payment. | https://example.com/cancel |
codActionoptional |
URL for Cash on Delivery (COD) action. | https://example.com/cod |
billingDetails object fields description
| Parameter | Description | Example |
|---|---|---|
firstNamemandatory |
First name of the billing contact. | Ashish |
lastNameoptional |
Last name of the billing contact. | Kumar |
address1mandatory |
Primary billing address. | 123 Main Street |
address2optional |
Secondary billing address. | Apt 4B |
phoneoptional |
Phone number of the billing contact. | 9123456789 |
emailmandatory |
Email address of the billing contact. | [email protected] |
cityoptional |
City of the billing address. | Bharatpur |
stateoptional |
State of the billing address. | Rajasthan |
countryoptional |
Country of the billing address. | India |
zipCodeoptional |
Postal/Zip code of the billing address. | 321028 |
Sample request
curl -X POST 'https://apitest.payu.in/v2/payments' \
-H 'date: Mon, 05 Oct 2026 10:00:00 GMT' \
-H 'authorization: hmac username="<YOUR_TEST_KEY>", algorithm="sha512", headers="date", signature="<SIGNATURE>"' \
-H 'content-type: application/json' \
-d '{
"accountId": "<YOUR_TEST_KEY>",
"txnId": "TXN_EMI_20261005",
"currency": "INR",
"paymentMethod": {
"name": "EMI",
"bankCode": "EMI6",
"paymentCard": {
"cardNumber": "5004461234560000",
"validThrough": "12/2026",
"ownerName": "John Doe",
"cvv": "123"
}
},
"order": {
"productInfo": "EMI Payment for Electronics",
"paymentChargeSpecification": {
"price": 10000.00
},
"userDefinedFields": {
"udf1": "laptop_emi",
"udf2": "tenure_6m"
}
},
"additionalInfo": {
"txnS2sFlow": "4",
"createOrder": true
},
"callBackActions": {
"successAction": "<redacted URL>",
"failureAction": "<redacted URL>",
"cancelAction": "<redacted URL>"
},
"billingDetails": {
"firstName": "John",
"lastName": "Doe",
"phone": "9876543210",
"email": "[email protected]",
"address1": "123 Main Street",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zipCode": "400001"
}
}'import requests
import json
url = "https://apitest.payu.in/v2/payments"
headers = {
"date": "Mon, 05 Oct 2026 10:00:00 GMT",
"authorization": 'hmac username="<YOUR_TEST_KEY>", algorithm="sha512", headers="date", signature="<SIGNATURE>"',
"content-type": "application/json"
}
payload = {
"accountId": "<YOUR_TEST_KEY>",
"txnId": "TXN_EMI_20261005",
"currency": "INR",
"paymentMethod": {
"name": "EMI",
"bankCode": "EMI6",
"paymentCard": {
"cardNumber": "5004461234560000",
"validThrough": "12/2026",
"ownerName": "John Doe",
"cvv": "123"
}
},
"order": {
"productInfo": "EMI Payment for Electronics",
"paymentChargeSpecification": {
"price": 10000.00
},
"userDefinedFields": {
"udf1": "laptop_emi"
}
},
"additionalInfo": {
"txnS2sFlow": "4",
"createOrder": True
},
"callBackActions": {
"successAction": "<redacted URL>",
"failureAction": "<redacted URL>",
"cancelAction": "<redacted URL>"
},
"billingDetails": {
"firstName": "John",
"lastName": "Doe",
"phone": "9876543210",
"email": "[email protected]",
"address1": "123 Main Street",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zipCode": "400001"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())<?php
$url = "https://apitest.payu.in/v2/payments";
$payload = json_encode([
"accountId" => "<YOUR_TEST_KEY>",
"txnId" => "TXN_EMI_20261005",
"currency" => "INR",
"paymentMethod" => [
"name" => "EMI",
"bankCode" => "EMI6",
"paymentCard" => [
"cardNumber" => "5004461234560000",
"validThrough" => "12/2026",
"ownerName" => "John Doe",
"cvv" => "123"
]
],
"order" => [
"productInfo" => "EMI Payment for Electronics",
"paymentChargeSpecification" => [
"price" => 10000.00
]
],
"additionalInfo" => [
"txnS2sFlow" => "4",
"createOrder" => true
],
"callBackActions" => [
"successAction" => "<redacted URL>",
"failureAction" => "<redacted URL>",
"cancelAction" => "<redacted URL>"
],
"billingDetails" => [
"firstName" => "John",
"lastName" => "Doe",
"phone" => "9876543210",
"email" => "[email protected]",
"address1" => "123 Main Street",
"city" => "Mumbai",
"state" => "Maharashtra",
"country" => "India",
"zipCode" => "400001"
]
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"date: Mon, 05 Oct 2026 10:00:00 GMT",
"authorization: hmac username=\"<YOUR_TEST_KEY>\", algorithm=\"sha512\", headers=\"date\", signature=\"<SIGNATURE>\"",
"content-type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class PayUEMIRequest {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String payload = """
{
"accountId": "<YOUR_TEST_KEY>",
"txnId": "TXN_EMI_20261005",
"currency": "INR",
"paymentMethod": {
"name": "EMI",
"bankCode": "EMI6",
"paymentCard": {
"cardNumber": "5004461234560000",
"validThrough": "12/2026",
"ownerName": "John Doe",
"cvv": "123"
}
},
"order": {
"productInfo": "EMI Payment for Electronics",
"paymentChargeSpecification": {
"price": 10000.00
}
},
"additionalInfo": {
"txnS2sFlow": "4",
"createOrder": true
},
"callBackActions": {
"successAction": "<redacted URL>",
"failureAction": "<redacted URL>",
"cancelAction": "<redacted URL>"
},
"billingDetails": {
"firstName": "John",
"lastName": "Doe",
"phone": "9876543210",
"email": "[email protected]",
"address1": "123 Main Street",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zipCode": "400001"
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://apitest.payu.in/v2/payments"))
.header("date", "Mon, 05 Oct 2026 10:00:00 GMT")
.header("authorization", "hmac username=\"<YOUR_TEST_KEY>\", algorithm=\"sha512\", headers=\"date\", signature=\"<SIGNATURE>\"")
.header("content-type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}const url = "https://apitest.payu.in/v2/payments";
const payload = {
accountId: "<YOUR_TEST_KEY>",
txnId: "TXN_EMI_20261005",
currency: "INR",
paymentMethod: {
name: "EMI",
bankCode: "EMI6",
paymentCard: {
cardNumber: "5004461234560000",
validThrough: "12/2026",
ownerName: "John Doe",
cvv: "123"
}
},
order: {
productInfo: "EMI Payment for Electronics",
paymentChargeSpecification: {
price: 10000.00
}
},
additionalInfo: {
txnS2sFlow: "4",
createOrder: true
},
callBackActions: {
successAction: "<redacted URL>",
failureAction: "<redacted URL>",
cancelAction: "<redacted URL>"
},
billingDetails: {
firstName: "John",
lastName: "Doe",
phone: "9876543210",
email: "[email protected]",
address1: "123 Main Street",
city: "Mumbai",
state: "Maharashtra",
country: "India",
zipCode: "400001"
}
};
fetch(url, {
method: "POST",
headers: {
"date": "Mon, 05 Oct 2026 10:00:00 GMT",
"authorization": 'hmac username="<YOUR_TEST_KEY>", algorithm="sha512", headers="date", signature="<SIGNATURE>"',
"content-type": "application/json"
},
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error("Error:", err));Sample response
{
"status": "PENDING",
"result": {
"checkoutUrl": "<redacted URL>"
},
"txnId": "TXN_EMI_20261005",
"paymentId": "1999110000001769",
"message": "Redirect customer to checkoutUrl for 3DS authentication"
}Response parameters
| Parameter | Description |
|---|---|
| message | This parameter contains the status message of the transaction. |
| status | This parameter returns the status of web service call. The status can be any of the following: `0` - If web service call failed. `1` - If web service call succeeded. |
| result | This parameter contains the payment status details in a JSON format including payment ID of the transaction. For more detailes, refer to the result JSON Object fields description table (next accordion) |
Reference:To check the transaction status, refer to Verify Payment API.
Error Codes
| Code | HTTP Status | Description | Resolution |
|---|---|---|---|
INVALID_AMOUNT | 400 | Amount below minimum EMI threshold | Check issuer minimum EMI amount rules |
INVALID_CURRENCY | 400 | Unsupported currency | Set currency: "INR" |
AUTHENTICATION_FAILED | 401 | Invalid token or signature | Verify authorization credentials |
DUPLICATE_REFERENCE | 409 | txnId already used | Use unique transaction ID |
PAYMENT_DECLINED | 422 | Card issuer declined EMI authorization | Verify card eligibility with bank |
Next Steps
- Redirect for Bank 3DS Authentication:
- Redirect the cardholder to the issuing bank's 3DS page via
result.paymentUrlto authenticate the EMI transaction.
- Redirect the cardholder to the issuing bank's 3DS page via
- Display Loan & Repayment Summary:
- Upon receiving the successful callback, present the approved tenure, monthly EMI amount, and annual interest rate on the order confirmation screen.
- Verify Transaction & Order Creation:
- Verify the payment status using the Verify Payment API and confirm the transaction amount matches the total EMI schedule.
