curl --request POST \
--url https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
"payment_token": "token_abc123xyz",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "24",
"card_exp_year": "24",
"card_cvc": "123",
"card_holder_name": "John Test",
"card_issuer": "chase",
"card_type": "CREDIT",
"card_issuing_country": "INDIA",
"card_issuing_country_code": "IN",
"bank_code": "JP_AMEX",
"nick_name": "John Test"
},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
},
"browser_info": {
"color_depth": 1,
"java_enabled": true,
"java_script_enabled": true,
"language": "<string>",
"screen_height": 1,
"screen_width": 1,
"time_zone": 123,
"ip_address": "<string>",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"user_agent": "<string>",
"os_type": "<string>",
"os_version": "<string>",
"device_model": "<string>",
"accept_language": "<string>",
"referer": "<string>"
}
}
'import requests
url = "https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility"
payload = {
"client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
"payment_token": "token_abc123xyz",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "24",
"card_exp_year": "24",
"card_cvc": "123",
"card_holder_name": "John Test",
"card_issuer": "chase",
"card_type": "CREDIT",
"card_issuing_country": "INDIA",
"card_issuing_country_code": "IN",
"bank_code": "JP_AMEX",
"nick_name": "John Test"
},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
},
"browser_info": {
"color_depth": 1,
"java_enabled": True,
"java_script_enabled": True,
"language": "<string>",
"screen_height": 1,
"screen_width": 1,
"time_zone": 123,
"ip_address": "<string>",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"user_agent": "<string>",
"os_type": "<string>",
"os_version": "<string>",
"device_model": "<string>",
"accept_language": "<string>",
"referer": "<string>"
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_secret: 'pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo',
payment_token: 'token_abc123xyz',
payment_method_data: {
card: {
card_number: '4242424242424242',
card_exp_month: '24',
card_exp_year: '24',
card_cvc: '123',
card_holder_name: 'John Test',
card_issuer: 'chase',
card_type: 'CREDIT',
card_issuing_country: 'INDIA',
card_issuing_country_code: 'IN',
bank_code: 'JP_AMEX',
nick_name: 'John Test'
},
billing: {
address: {
city: 'New York',
line1: '123, King Street',
line2: 'Powelson Avenue',
line3: 'Bridgewater',
zip: '08807',
state: 'New York',
first_name: 'John',
last_name: 'Doe',
origin_zip: '08807'
},
phone: {number: '9123456789', country_code: '+1'},
email: '<string>'
}
},
browser_info: {
color_depth: 1,
java_enabled: true,
java_script_enabled: true,
language: '<string>',
screen_height: 1,
screen_width: 1,
time_zone: 123,
ip_address: '<string>',
accept_header: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
user_agent: '<string>',
os_type: '<string>',
os_version: '<string>',
device_model: '<string>',
accept_language: '<string>',
referer: '<string>'
}
})
};
fetch('https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_secret' => 'pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo',
'payment_token' => 'token_abc123xyz',
'payment_method_data' => [
'card' => [
'card_number' => '4242424242424242',
'card_exp_month' => '24',
'card_exp_year' => '24',
'card_cvc' => '123',
'card_holder_name' => 'John Test',
'card_issuer' => 'chase',
'card_type' => 'CREDIT',
'card_issuing_country' => 'INDIA',
'card_issuing_country_code' => 'IN',
'bank_code' => 'JP_AMEX',
'nick_name' => 'John Test'
],
'billing' => [
'address' => [
'city' => 'New York',
'line1' => '123, King Street',
'line2' => 'Powelson Avenue',
'line3' => 'Bridgewater',
'zip' => '08807',
'state' => 'New York',
'first_name' => 'John',
'last_name' => 'Doe',
'origin_zip' => '08807'
],
'phone' => [
'number' => '9123456789',
'country_code' => '+1'
],
'email' => '<string>'
]
],
'browser_info' => [
'color_depth' => 1,
'java_enabled' => true,
'java_script_enabled' => true,
'language' => '<string>',
'screen_height' => 1,
'screen_width' => 1,
'time_zone' => 123,
'ip_address' => '<string>',
'accept_header' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'user_agent' => '<string>',
'os_type' => '<string>',
'os_version' => '<string>',
'device_model' => '<string>',
'accept_language' => '<string>',
'referer' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility"
payload := strings.NewReader("{\n \"client_secret\": \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\",\n \"payment_token\": \"token_abc123xyz\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"24\",\n \"card_exp_year\": \"24\",\n \"card_cvc\": \"123\",\n \"card_holder_name\": \"John Test\",\n \"card_issuer\": \"chase\",\n \"card_type\": \"CREDIT\",\n \"card_issuing_country\": \"INDIA\",\n \"card_issuing_country_code\": \"IN\",\n \"bank_code\": \"JP_AMEX\",\n \"nick_name\": \"John Test\"\n },\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n },\n \"browser_info\": {\n \"color_depth\": 1,\n \"java_enabled\": true,\n \"java_script_enabled\": true,\n \"language\": \"<string>\",\n \"screen_height\": 1,\n \"screen_width\": 1,\n \"time_zone\": 123,\n \"ip_address\": \"<string>\",\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n \"user_agent\": \"<string>\",\n \"os_type\": \"<string>\",\n \"os_version\": \"<string>\",\n \"device_model\": \"<string>\",\n \"accept_language\": \"<string>\",\n \"referer\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_secret\": \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\",\n \"payment_token\": \"token_abc123xyz\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"24\",\n \"card_exp_year\": \"24\",\n \"card_cvc\": \"123\",\n \"card_holder_name\": \"John Test\",\n \"card_issuer\": \"chase\",\n \"card_type\": \"CREDIT\",\n \"card_issuing_country\": \"INDIA\",\n \"card_issuing_country_code\": \"IN\",\n \"bank_code\": \"JP_AMEX\",\n \"nick_name\": \"John Test\"\n },\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n },\n \"browser_info\": {\n \"color_depth\": 1,\n \"java_enabled\": true,\n \"java_script_enabled\": true,\n \"language\": \"<string>\",\n \"screen_height\": 1,\n \"screen_width\": 1,\n \"time_zone\": 123,\n \"ip_address\": \"<string>\",\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n \"user_agent\": \"<string>\",\n \"os_type\": \"<string>\",\n \"os_version\": \"<string>\",\n \"device_model\": \"<string>\",\n \"accept_language\": \"<string>\",\n \"referer\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_secret\": \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\",\n \"payment_token\": \"token_abc123xyz\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"24\",\n \"card_exp_year\": \"24\",\n \"card_cvc\": \"123\",\n \"card_holder_name\": \"John Test\",\n \"card_issuer\": \"chase\",\n \"card_type\": \"CREDIT\",\n \"card_issuing_country\": \"INDIA\",\n \"card_issuing_country_code\": \"IN\",\n \"bank_code\": \"JP_AMEX\",\n \"nick_name\": \"John Test\"\n },\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n },\n \"browser_info\": {\n \"color_depth\": 1,\n \"java_enabled\": true,\n \"java_script_enabled\": true,\n \"language\": \"<string>\",\n \"screen_height\": 1,\n \"screen_width\": 1,\n \"time_zone\": 123,\n \"ip_address\": \"<string>\",\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n \"user_agent\": \"<string>\",\n \"os_type\": \"<string>\",\n \"os_version\": \"<string>\",\n \"device_model\": \"<string>\",\n \"accept_language\": \"<string>\",\n \"referer\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"sdk_next_action": {
"next_action": "post_session_tokens",
"should_block_confirm": true
},
"surcharge_details": {
"surcharge": {
"type": "fixed",
"value": 123
},
"display_surcharge_amount": 123,
"display_tax_on_surcharge_amount": 123,
"display_total_surcharge_amount": 123,
"tax_on_surcharge": {
"percentage": 123
}
}
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}Payments - Submit Eligibility Data
Runs eligibility checks (blocklist, card testing guard) and calculates an external surcharge in a single call. Intended to be called by the SDK before the final confirm step.
- If eligibility is denied the response will contain
sdk_next_action: denyand no surcharge details. - If the merchant has no surcharge connector configured,
surcharge_detailswill benull. - Surcharge calculation is best-effort: if the external call fails the payment still proceeds
with
surcharge_details: null.
curl --request POST \
--url https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
"payment_token": "token_abc123xyz",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "24",
"card_exp_year": "24",
"card_cvc": "123",
"card_holder_name": "John Test",
"card_issuer": "chase",
"card_type": "CREDIT",
"card_issuing_country": "INDIA",
"card_issuing_country_code": "IN",
"bank_code": "JP_AMEX",
"nick_name": "John Test"
},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
},
"browser_info": {
"color_depth": 1,
"java_enabled": true,
"java_script_enabled": true,
"language": "<string>",
"screen_height": 1,
"screen_width": 1,
"time_zone": 123,
"ip_address": "<string>",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"user_agent": "<string>",
"os_type": "<string>",
"os_version": "<string>",
"device_model": "<string>",
"accept_language": "<string>",
"referer": "<string>"
}
}
'import requests
url = "https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility"
payload = {
"client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
"payment_token": "token_abc123xyz",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "24",
"card_exp_year": "24",
"card_cvc": "123",
"card_holder_name": "John Test",
"card_issuer": "chase",
"card_type": "CREDIT",
"card_issuing_country": "INDIA",
"card_issuing_country_code": "IN",
"bank_code": "JP_AMEX",
"nick_name": "John Test"
},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
},
"browser_info": {
"color_depth": 1,
"java_enabled": True,
"java_script_enabled": True,
"language": "<string>",
"screen_height": 1,
"screen_width": 1,
"time_zone": 123,
"ip_address": "<string>",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"user_agent": "<string>",
"os_type": "<string>",
"os_version": "<string>",
"device_model": "<string>",
"accept_language": "<string>",
"referer": "<string>"
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_secret: 'pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo',
payment_token: 'token_abc123xyz',
payment_method_data: {
card: {
card_number: '4242424242424242',
card_exp_month: '24',
card_exp_year: '24',
card_cvc: '123',
card_holder_name: 'John Test',
card_issuer: 'chase',
card_type: 'CREDIT',
card_issuing_country: 'INDIA',
card_issuing_country_code: 'IN',
bank_code: 'JP_AMEX',
nick_name: 'John Test'
},
billing: {
address: {
city: 'New York',
line1: '123, King Street',
line2: 'Powelson Avenue',
line3: 'Bridgewater',
zip: '08807',
state: 'New York',
first_name: 'John',
last_name: 'Doe',
origin_zip: '08807'
},
phone: {number: '9123456789', country_code: '+1'},
email: '<string>'
}
},
browser_info: {
color_depth: 1,
java_enabled: true,
java_script_enabled: true,
language: '<string>',
screen_height: 1,
screen_width: 1,
time_zone: 123,
ip_address: '<string>',
accept_header: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
user_agent: '<string>',
os_type: '<string>',
os_version: '<string>',
device_model: '<string>',
accept_language: '<string>',
referer: '<string>'
}
})
};
fetch('https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_secret' => 'pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo',
'payment_token' => 'token_abc123xyz',
'payment_method_data' => [
'card' => [
'card_number' => '4242424242424242',
'card_exp_month' => '24',
'card_exp_year' => '24',
'card_cvc' => '123',
'card_holder_name' => 'John Test',
'card_issuer' => 'chase',
'card_type' => 'CREDIT',
'card_issuing_country' => 'INDIA',
'card_issuing_country_code' => 'IN',
'bank_code' => 'JP_AMEX',
'nick_name' => 'John Test'
],
'billing' => [
'address' => [
'city' => 'New York',
'line1' => '123, King Street',
'line2' => 'Powelson Avenue',
'line3' => 'Bridgewater',
'zip' => '08807',
'state' => 'New York',
'first_name' => 'John',
'last_name' => 'Doe',
'origin_zip' => '08807'
],
'phone' => [
'number' => '9123456789',
'country_code' => '+1'
],
'email' => '<string>'
]
],
'browser_info' => [
'color_depth' => 1,
'java_enabled' => true,
'java_script_enabled' => true,
'language' => '<string>',
'screen_height' => 1,
'screen_width' => 1,
'time_zone' => 123,
'ip_address' => '<string>',
'accept_header' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'user_agent' => '<string>',
'os_type' => '<string>',
'os_version' => '<string>',
'device_model' => '<string>',
'accept_language' => '<string>',
'referer' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility"
payload := strings.NewReader("{\n \"client_secret\": \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\",\n \"payment_token\": \"token_abc123xyz\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"24\",\n \"card_exp_year\": \"24\",\n \"card_cvc\": \"123\",\n \"card_holder_name\": \"John Test\",\n \"card_issuer\": \"chase\",\n \"card_type\": \"CREDIT\",\n \"card_issuing_country\": \"INDIA\",\n \"card_issuing_country_code\": \"IN\",\n \"bank_code\": \"JP_AMEX\",\n \"nick_name\": \"John Test\"\n },\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n },\n \"browser_info\": {\n \"color_depth\": 1,\n \"java_enabled\": true,\n \"java_script_enabled\": true,\n \"language\": \"<string>\",\n \"screen_height\": 1,\n \"screen_width\": 1,\n \"time_zone\": 123,\n \"ip_address\": \"<string>\",\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n \"user_agent\": \"<string>\",\n \"os_type\": \"<string>\",\n \"os_version\": \"<string>\",\n \"device_model\": \"<string>\",\n \"accept_language\": \"<string>\",\n \"referer\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_secret\": \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\",\n \"payment_token\": \"token_abc123xyz\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"24\",\n \"card_exp_year\": \"24\",\n \"card_cvc\": \"123\",\n \"card_holder_name\": \"John Test\",\n \"card_issuer\": \"chase\",\n \"card_type\": \"CREDIT\",\n \"card_issuing_country\": \"INDIA\",\n \"card_issuing_country_code\": \"IN\",\n \"bank_code\": \"JP_AMEX\",\n \"nick_name\": \"John Test\"\n },\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n },\n \"browser_info\": {\n \"color_depth\": 1,\n \"java_enabled\": true,\n \"java_script_enabled\": true,\n \"language\": \"<string>\",\n \"screen_height\": 1,\n \"screen_width\": 1,\n \"time_zone\": 123,\n \"ip_address\": \"<string>\",\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n \"user_agent\": \"<string>\",\n \"os_type\": \"<string>\",\n \"os_version\": \"<string>\",\n \"device_model\": \"<string>\",\n \"accept_language\": \"<string>\",\n \"referer\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/payments/{payment_id}/eligibility")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_secret\": \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\",\n \"payment_token\": \"token_abc123xyz\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"card_exp_month\": \"24\",\n \"card_exp_year\": \"24\",\n \"card_cvc\": \"123\",\n \"card_holder_name\": \"John Test\",\n \"card_issuer\": \"chase\",\n \"card_type\": \"CREDIT\",\n \"card_issuing_country\": \"INDIA\",\n \"card_issuing_country_code\": \"IN\",\n \"bank_code\": \"JP_AMEX\",\n \"nick_name\": \"John Test\"\n },\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n },\n \"browser_info\": {\n \"color_depth\": 1,\n \"java_enabled\": true,\n \"java_script_enabled\": true,\n \"language\": \"<string>\",\n \"screen_height\": 1,\n \"screen_width\": 1,\n \"time_zone\": 123,\n \"ip_address\": \"<string>\",\n \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\n \"user_agent\": \"<string>\",\n \"os_type\": \"<string>\",\n \"os_version\": \"<string>\",\n \"device_model\": \"<string>\",\n \"accept_language\": \"<string>\",\n \"referer\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"sdk_next_action": {
"next_action": "post_session_tokens",
"should_block_confirm": true
},
"surcharge_details": {
"surcharge": {
"type": "fixed",
"value": 123
},
"display_surcharge_amount": 123,
"display_tax_on_surcharge_amount": 123,
"display_total_surcharge_amount": 123,
"tax_on_surcharge": {
"percentage": 123
}
}
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}Authorizations
Publishable keys are a type of keys that can be public and have limited scope of usage.
Path Parameters
The identifier for the payment
Body
Request body for the eligibility endpoint. Combines eligibility checks with external surcharge calculation in a single call.
Token used for client side verification
"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo"
Indicates the type of payment method. Eg: 'card', 'wallet', etc.
card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment, network_token The payment token to look up the saved payment method
"token_abc123xyz"
Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.
ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, paysera, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, bluecode, boleto, bca_bank_transfer, bni_va, breadpay, bri_va, bhn_card_network, card_redirect, cimb_va, classic, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eft_debit_order, eps, flexiti, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, payjustnow, paypal, paze, pix, pix_key, pix_emv, pix_qr, pix_automatico_qr, pix_automatico_push, pay_safe_card, przelewy24, prompt_pay, pse, qris, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sepa_guarenteed_debit, skrill, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, upi_qr, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer, instant_bank_transfer_finland, instant_bank_transfer_poland, revolut_pay, indonesian_bank_transfer, open_banking, network_token Payment method data request for eligibility check
- EligibilityCard
- CardRedirect
- Wallet
- PayLater
- BankRedirect
- BankDebit
- BankTransfer
- RealTimePayment
- Crypto
- Upi
- Voucher
- GiftCard
- CardToken
- OpenBanking
- MobilePayment
- NetworkToken
Show child attributes
Show child attributes
Browser information to be used for 3DS 2.0
Show child attributes
Show child attributes
Was this page helpful?