Get eligible EMI bins for a merchant from the eligible-bins service.
Use this endpoint to get eligible EMI bins for a merchant. pg and offer_type are not read. A success body is the eligibleBinsForEMI response, returned unchanged.
POST
/partner/getEligibleBins
Environment
| Environment | URL |
|---|---|
| Test Environment | https://test-partnerapilayer.payu.in/apilayer/partner/getEligibleBins |
| Production Environment | https://api.payu.in/partner/getEligibleBins |
Sample Request
curl -X POST https://test-partnerapilayer.payu.in/apilayer/partner/getEligibleBins \
-H "Content-Type: application/json" \
-H "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123" \
-d '{
"merchant_id": "8739528",
"type": "bin",
"var2": "EMI"
}'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\", \"type\": \"bin\", \"var2\": \"EMI\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://test-partnerapilayer.payu.in/apilayer/partner/getEligibleBins"))
.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/getEligibleBins"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
}
payload = {
"merchant_id": "8739528",
"type": "bin",
"var2": "EMI"
}
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/getEligibleBins",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"merchant_id\": \"8739528\", \"type\": \"bin\", \"var2\": \"EMI\"}",
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/getEligibleBins", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
},
body: JSON.stringify({
"merchant_id": "8739528",
"type": "bin",
"var2": "EMI"
})
});
console.log(await response.text());using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test-partnerapilayer.payu.in/apilayer/partner/getEligibleBins");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123");
request.Content = new StringContent("{\"merchant_id\": \"8739528\", \"type\": \"bin\", \"var2\": \"EMI\"}", 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/getEligibleBins")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
request.body = {"merchant_id": "8739528", "type": "bin", "var2": "EMI"}.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. |
type* | string Required by PartnerService. Forwarded to the eligible-bins service. |
var2* | string Required by PartnerService. Forwarded to the eligible-bins service. |
Sample Response
{
"isEligible": 1,
"bank": "AXIS",
"minAmount": 2500
}| Parameter | Description |
|---|---|
isEligible | 1 when the BIN is eligible for EMI. |
bank | Issuing bank for the BIN. The sample value is AXIS. |
minAmount | Minimum transaction amount that qualifies for EMI. The sample value is 2500. |
Errors
Below are the failure scenarios.
merchant_id, type and var2 param are mandatory params
{
"error": "merchant_id, type and var2 param are mandatory params"
}Reason: This error occurs when merchant_id, type, or var2 is missing from the request.
Recommended Fix: Include merchant_id, type, and var2 in the request 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.
