Get the EMI amount for a merchant.
Use this endpoint to get the EMI amount for a merchant. merchant_id must be digits. bankcode and tenure are not checked in this method. A success body is the getEmiAmountAccordingToInterest response, returned unchanged.
POST
/partner/getEmiAmount
Environment
| Environment | URL |
|---|---|
| Test Environment | https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount |
| Production Environment | https://api.payu.in/partner/getEmiAmount |
Sample Request
curl -X POST https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount \
-H "Content-Type: application/json" \
-H "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123" \
-d '{
"merchant_id": "8739528",
"amount": "1000.00",
"bankcode": "HDFC",
"tenure": "3"
}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class PartnerRequest {
public static void main(String[] args) throws Exception {
String body = "{\"merchant_id\": \"8739528\", \"amount\": \"1000.00\", \"bankcode\": \"HDFC\", \"tenure\": \"3\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}import requests
url = "https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
}
payload = {
"merchant_id": "8739528",
"amount": "1000.00",
"bankcode": "HDFC",
"tenure": "3"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"merchant_id\": \"8739528\", \"amount\": \"1000.00\", \"bankcode\": \"HDFC\", \"tenure\": \"3\"}",
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($curl);
curl_close($curl);const response = await fetch("https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
},
body: JSON.stringify({
"merchant_id": "8739528",
"amount": "1000.00",
"bankcode": "HDFC",
"tenure": "3"
})
});
console.log(await response.text());using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123");
request.Content = new StringContent("{\"merchant_id\": \"8739528\", \"amount\": \"1000.00\", \"bankcode\": \"HDFC\", \"tenure\": \"3\"}", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());require "net/http"
require "json"
uri = URI("https://test-partnerapilayer.payu.in/apilayer/partner/getEmiAmount")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
request.body = {"merchant_id": "8739528", "amount": "1000.00", "bankcode": "HDFC", "tenure": "3"}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
Mandatory ParametersParameters marked with * are mandatory.
| Parameter | Description |
|---|---|
Content-Type* | string Send the body as application/json. |
Authorization* | string Partner access token. Send as Authorization Bearer token. |
merchant_id* | string Digits only. Parsed to an integer after the format check. |
amount* | string Amount. |
bankcode | string Forwarded with the map. Not validated in PartnerService.getEmiAmount. |
tenure | string Forwarded with the map. The method signature is Map of strings, so send tenure as a string. |
Sample Response
{
"7": {
"EMIA3": {
"transactionAmount": 100000,
"paybackAmount": 0,
"loanAmount": 100000,
"emiAmount": 33333.33,
"additionalCost": "0.00",
"emiMdrNote": null,
"emiBankInterest": 16,
"bankRate": null,
"bankCharge": 0,
"amount": 33333.33,
"card_type": "credit card",
"emi_value": 34226.15,
"emi_interest_paid": 2678.44,
"tenure": "03 months"
}
}
}| Parameter | Description |
|---|---|
7 | Tenure-code key. The sample uses 7. Each value is an object of EMI codes. Parameter descriptions are explained in the 7 Object Parameters section. |
7 Object
7 Object| Parameter | Description |
|---|---|
EMIA3 | EMI code for one plan. Other EMI codes use the same fields. Parameter descriptions are explained in the EMIA3 Object Parameters section. |
EMIA3 Object
EMIA3 Object| Parameter | Description |
|---|---|
transactionAmount | The transaction amount that will be converted into EMI. |
paybackAmount | The amount to be paid back over the EMI tenure, including interest. |
loanAmount | The loan amount that needs to be converted as EMI. |
emiAmount | The amount that needs to be converted as EMI. |
additionalCost | The processing fee or additional cost for processing the EMI, excluding interest. |
emiMdrNote | The EMI merchant discount rate note, when one applies. |
emiBankInterest | Bank interest for the EMI plan. The sample value is 16. |
bankRate | The interest rate in percentage for the EMI, excluding the processing fee. |
bankCharge | The bank charges for the EMI transaction. |
amount | The principal part of the EMI. |
card_type | The card type used by the customer. credit card or debit card. |
emi_value | The amount to be paid per EMI. |
emi_interest_paid | The total interest paid for all the EMIs. |
tenure | The tenure for the EMI. The sample value is 03 months. |
Errors
Below are the failure scenarios.
merchant_id or amount param is missing in body
{
"error": "merchant_id or amount param is missing in body"
}Reason: This error occurs when merchant_id or amount is missing from the request body.
Recommended Fix: Include merchant_id and amount in the request body and retry.
Invalid Auth token
{
"error": "Invalid Auth token"
}Reason: This error occurs when the auth token is missing or invalid.
Recommended Fix: Generate a new auth token and send it in the Authorization header.
