Decide routing
curl --request POST \
--url http://localhost:8080/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_id": "pay_demo",
"merchant_id": "pro_demo",
"amount": 1000,
"currency": "USD",
"payment_method_type": "card",
"payment_method_sub_type": "credit",
"authentication_type": null,
"capture_method": null,
"mandate_type": null,
"mandate_acceptance_type": null,
"setup_future_usage": null,
"transaction_initiator": null,
"surcharge_amount": null,
"business_country": null,
"billing_country": "US",
"business_label": null,
"card": {
"card_isin": "001234",
"card_extended_bin": "00123456",
"card_network": "Visa",
"card_type": "credit",
"card_issuer": null,
"card_issuing_country_code": "US",
"card_subtype": null,
"card_discovery": null,
"card_switch_provider": null
},
"customer_device_platform": null,
"customer_device_type": null,
"customer_device_display_size": null,
"pay_later": null,
"wallet": null,
"upi": null,
"voucher": null,
"bank_redirect": null,
"bank_debit": null,
"bank_transfer": null,
"real_time_payment": null,
"gift_card": null,
"card_redirect": null,
"open_banking": null,
"mobile_payment": null,
"crypto": null,
"reward": null,
"network_token": null,
"metadata": {
"segment": "premium"
},
"country": null,
"customer_id": null,
"routing_config": {
"algorithm_for": "payment",
"elimination_enabled": null,
"enable_multi_objective": null,
"ranking_algorithm": null,
"eligible_connectors": [
{
"gateway_name": "worldpay",
"payment_merchant_connector_id": "mca_wp"
},
{
"gateway_name": "checkout",
"payment_merchant_connector_id": "mca_cko"
}
],
"preferred_connectors": null
}
}
'import requests
url = "http://localhost:8080/decide"
payload = {
"payment_id": "pay_demo",
"merchant_id": "pro_demo",
"amount": 1000,
"currency": "USD",
"payment_method_type": "card",
"payment_method_sub_type": "credit",
"authentication_type": None,
"capture_method": None,
"mandate_type": None,
"mandate_acceptance_type": None,
"setup_future_usage": None,
"transaction_initiator": None,
"surcharge_amount": None,
"business_country": None,
"billing_country": "US",
"business_label": None,
"card": {
"card_isin": "001234",
"card_extended_bin": "00123456",
"card_network": "Visa",
"card_type": "credit",
"card_issuer": None,
"card_issuing_country_code": "US",
"card_subtype": None,
"card_discovery": None,
"card_switch_provider": None
},
"customer_device_platform": None,
"customer_device_type": None,
"customer_device_display_size": None,
"pay_later": None,
"wallet": None,
"upi": None,
"voucher": None,
"bank_redirect": None,
"bank_debit": None,
"bank_transfer": None,
"real_time_payment": None,
"gift_card": None,
"card_redirect": None,
"open_banking": None,
"mobile_payment": None,
"crypto": None,
"reward": None,
"network_token": None,
"metadata": { "segment": "premium" },
"country": None,
"customer_id": None,
"routing_config": {
"algorithm_for": "payment",
"elimination_enabled": None,
"enable_multi_objective": None,
"ranking_algorithm": None,
"eligible_connectors": [
{
"gateway_name": "worldpay",
"payment_merchant_connector_id": "mca_wp"
},
{
"gateway_name": "checkout",
"payment_merchant_connector_id": "mca_cko"
}
],
"preferred_connectors": None
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_id: 'pay_demo',
merchant_id: 'pro_demo',
amount: 1000,
currency: 'USD',
payment_method_type: 'card',
payment_method_sub_type: 'credit',
authentication_type: null,
capture_method: null,
mandate_type: null,
mandate_acceptance_type: null,
setup_future_usage: null,
transaction_initiator: null,
surcharge_amount: null,
business_country: null,
billing_country: 'US',
business_label: null,
card: {
card_isin: '001234',
card_extended_bin: '00123456',
card_network: 'Visa',
card_type: 'credit',
card_issuer: null,
card_issuing_country_code: 'US',
card_subtype: null,
card_discovery: null,
card_switch_provider: null
},
customer_device_platform: null,
customer_device_type: null,
customer_device_display_size: null,
pay_later: null,
wallet: null,
upi: null,
voucher: null,
bank_redirect: null,
bank_debit: null,
bank_transfer: null,
real_time_payment: null,
gift_card: null,
card_redirect: null,
open_banking: null,
mobile_payment: null,
crypto: null,
reward: null,
network_token: null,
metadata: {segment: 'premium'},
country: null,
customer_id: null,
routing_config: {
algorithm_for: 'payment',
elimination_enabled: null,
enable_multi_objective: null,
ranking_algorithm: null,
eligible_connectors: [
{gateway_name: 'worldpay', payment_merchant_connector_id: 'mca_wp'},
{gateway_name: 'checkout', payment_merchant_connector_id: 'mca_cko'}
],
preferred_connectors: null
}
})
};
fetch('http://localhost:8080/decide', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/decide",
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([
'payment_id' => 'pay_demo',
'merchant_id' => 'pro_demo',
'amount' => 1000,
'currency' => 'USD',
'payment_method_type' => 'card',
'payment_method_sub_type' => 'credit',
'authentication_type' => null,
'capture_method' => null,
'mandate_type' => null,
'mandate_acceptance_type' => null,
'setup_future_usage' => null,
'transaction_initiator' => null,
'surcharge_amount' => null,
'business_country' => null,
'billing_country' => 'US',
'business_label' => null,
'card' => [
'card_isin' => '001234',
'card_extended_bin' => '00123456',
'card_network' => 'Visa',
'card_type' => 'credit',
'card_issuer' => null,
'card_issuing_country_code' => 'US',
'card_subtype' => null,
'card_discovery' => null,
'card_switch_provider' => null
],
'customer_device_platform' => null,
'customer_device_type' => null,
'customer_device_display_size' => null,
'pay_later' => null,
'wallet' => null,
'upi' => null,
'voucher' => null,
'bank_redirect' => null,
'bank_debit' => null,
'bank_transfer' => null,
'real_time_payment' => null,
'gift_card' => null,
'card_redirect' => null,
'open_banking' => null,
'mobile_payment' => null,
'crypto' => null,
'reward' => null,
'network_token' => null,
'metadata' => [
'segment' => 'premium'
],
'country' => null,
'customer_id' => null,
'routing_config' => [
'algorithm_for' => 'payment',
'elimination_enabled' => null,
'enable_multi_objective' => null,
'ranking_algorithm' => null,
'eligible_connectors' => [
[
'gateway_name' => 'worldpay',
'payment_merchant_connector_id' => 'mca_wp'
],
[
'gateway_name' => 'checkout',
'payment_merchant_connector_id' => 'mca_cko'
]
],
'preferred_connectors' => null
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/decide"
payload := strings.NewReader("{\n \"payment_id\": \"pay_demo\",\n \"merchant_id\": \"pro_demo\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"payment_method_type\": \"card\",\n \"payment_method_sub_type\": \"credit\",\n \"authentication_type\": null,\n \"capture_method\": null,\n \"mandate_type\": null,\n \"mandate_acceptance_type\": null,\n \"setup_future_usage\": null,\n \"transaction_initiator\": null,\n \"surcharge_amount\": null,\n \"business_country\": null,\n \"billing_country\": \"US\",\n \"business_label\": null,\n \"card\": {\n \"card_isin\": \"001234\",\n \"card_extended_bin\": \"00123456\",\n \"card_network\": \"Visa\",\n \"card_type\": \"credit\",\n \"card_issuer\": null,\n \"card_issuing_country_code\": \"US\",\n \"card_subtype\": null,\n \"card_discovery\": null,\n \"card_switch_provider\": null\n },\n \"customer_device_platform\": null,\n \"customer_device_type\": null,\n \"customer_device_display_size\": null,\n \"pay_later\": null,\n \"wallet\": null,\n \"upi\": null,\n \"voucher\": null,\n \"bank_redirect\": null,\n \"bank_debit\": null,\n \"bank_transfer\": null,\n \"real_time_payment\": null,\n \"gift_card\": null,\n \"card_redirect\": null,\n \"open_banking\": null,\n \"mobile_payment\": null,\n \"crypto\": null,\n \"reward\": null,\n \"network_token\": null,\n \"metadata\": {\n \"segment\": \"premium\"\n },\n \"country\": null,\n \"customer_id\": null,\n \"routing_config\": {\n \"algorithm_for\": \"payment\",\n \"elimination_enabled\": null,\n \"enable_multi_objective\": null,\n \"ranking_algorithm\": null,\n \"eligible_connectors\": [\n {\n \"gateway_name\": \"worldpay\",\n \"payment_merchant_connector_id\": \"mca_wp\"\n },\n {\n \"gateway_name\": \"checkout\",\n \"payment_merchant_connector_id\": \"mca_cko\"\n }\n ],\n \"preferred_connectors\": null\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:8080/decide")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"pay_demo\",\n \"merchant_id\": \"pro_demo\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"payment_method_type\": \"card\",\n \"payment_method_sub_type\": \"credit\",\n \"authentication_type\": null,\n \"capture_method\": null,\n \"mandate_type\": null,\n \"mandate_acceptance_type\": null,\n \"setup_future_usage\": null,\n \"transaction_initiator\": null,\n \"surcharge_amount\": null,\n \"business_country\": null,\n \"billing_country\": \"US\",\n \"business_label\": null,\n \"card\": {\n \"card_isin\": \"001234\",\n \"card_extended_bin\": \"00123456\",\n \"card_network\": \"Visa\",\n \"card_type\": \"credit\",\n \"card_issuer\": null,\n \"card_issuing_country_code\": \"US\",\n \"card_subtype\": null,\n \"card_discovery\": null,\n \"card_switch_provider\": null\n },\n \"customer_device_platform\": null,\n \"customer_device_type\": null,\n \"customer_device_display_size\": null,\n \"pay_later\": null,\n \"wallet\": null,\n \"upi\": null,\n \"voucher\": null,\n \"bank_redirect\": null,\n \"bank_debit\": null,\n \"bank_transfer\": null,\n \"real_time_payment\": null,\n \"gift_card\": null,\n \"card_redirect\": null,\n \"open_banking\": null,\n \"mobile_payment\": null,\n \"crypto\": null,\n \"reward\": null,\n \"network_token\": null,\n \"metadata\": {\n \"segment\": \"premium\"\n },\n \"country\": null,\n \"customer_id\": null,\n \"routing_config\": {\n \"algorithm_for\": \"payment\",\n \"elimination_enabled\": null,\n \"enable_multi_objective\": null,\n \"ranking_algorithm\": null,\n \"eligible_connectors\": [\n {\n \"gateway_name\": \"worldpay\",\n \"payment_merchant_connector_id\": \"mca_wp\"\n },\n {\n \"gateway_name\": \"checkout\",\n \"payment_merchant_connector_id\": \"mca_cko\"\n }\n ],\n \"preferred_connectors\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/decide")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"pay_demo\",\n \"merchant_id\": \"pro_demo\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"payment_method_type\": \"card\",\n \"payment_method_sub_type\": \"credit\",\n \"authentication_type\": null,\n \"capture_method\": null,\n \"mandate_type\": null,\n \"mandate_acceptance_type\": null,\n \"setup_future_usage\": null,\n \"transaction_initiator\": null,\n \"surcharge_amount\": null,\n \"business_country\": null,\n \"billing_country\": \"US\",\n \"business_label\": null,\n \"card\": {\n \"card_isin\": \"001234\",\n \"card_extended_bin\": \"00123456\",\n \"card_network\": \"Visa\",\n \"card_type\": \"credit\",\n \"card_issuer\": null,\n \"card_issuing_country_code\": \"US\",\n \"card_subtype\": null,\n \"card_discovery\": null,\n \"card_switch_provider\": null\n },\n \"customer_device_platform\": null,\n \"customer_device_type\": null,\n \"customer_device_display_size\": null,\n \"pay_later\": null,\n \"wallet\": null,\n \"upi\": null,\n \"voucher\": null,\n \"bank_redirect\": null,\n \"bank_debit\": null,\n \"bank_transfer\": null,\n \"real_time_payment\": null,\n \"gift_card\": null,\n \"card_redirect\": null,\n \"open_banking\": null,\n \"mobile_payment\": null,\n \"crypto\": null,\n \"reward\": null,\n \"network_token\": null,\n \"metadata\": {\n \"segment\": \"premium\"\n },\n \"country\": null,\n \"customer_id\": null,\n \"routing_config\": {\n \"algorithm_for\": \"payment\",\n \"elimination_enabled\": null,\n \"enable_multi_objective\": null,\n \"ranking_algorithm\": null,\n \"eligible_connectors\": [\n {\n \"gateway_name\": \"worldpay\",\n \"payment_merchant_connector_id\": \"mca_wp\"\n },\n {\n \"gateway_name\": \"checkout\",\n \"payment_merchant_connector_id\": \"mca_cko\"\n }\n ],\n \"preferred_connectors\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"evaluated_connectors": [
{
"gateway_name": "<string>",
"payment_merchant_connector_id": "<string>"
}
],
"decision": {
"outcome": "routed",
"source": "<string>",
"decision_id": "<string>"
}
}OpenAPI: Gateway Decision
Decide (MultiObjective)
Evaluate routing with the unified payment payload.
POST
/
decide
Decide routing
curl --request POST \
--url http://localhost:8080/decide \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_id": "pay_demo",
"merchant_id": "pro_demo",
"amount": 1000,
"currency": "USD",
"payment_method_type": "card",
"payment_method_sub_type": "credit",
"authentication_type": null,
"capture_method": null,
"mandate_type": null,
"mandate_acceptance_type": null,
"setup_future_usage": null,
"transaction_initiator": null,
"surcharge_amount": null,
"business_country": null,
"billing_country": "US",
"business_label": null,
"card": {
"card_isin": "001234",
"card_extended_bin": "00123456",
"card_network": "Visa",
"card_type": "credit",
"card_issuer": null,
"card_issuing_country_code": "US",
"card_subtype": null,
"card_discovery": null,
"card_switch_provider": null
},
"customer_device_platform": null,
"customer_device_type": null,
"customer_device_display_size": null,
"pay_later": null,
"wallet": null,
"upi": null,
"voucher": null,
"bank_redirect": null,
"bank_debit": null,
"bank_transfer": null,
"real_time_payment": null,
"gift_card": null,
"card_redirect": null,
"open_banking": null,
"mobile_payment": null,
"crypto": null,
"reward": null,
"network_token": null,
"metadata": {
"segment": "premium"
},
"country": null,
"customer_id": null,
"routing_config": {
"algorithm_for": "payment",
"elimination_enabled": null,
"enable_multi_objective": null,
"ranking_algorithm": null,
"eligible_connectors": [
{
"gateway_name": "worldpay",
"payment_merchant_connector_id": "mca_wp"
},
{
"gateway_name": "checkout",
"payment_merchant_connector_id": "mca_cko"
}
],
"preferred_connectors": null
}
}
'import requests
url = "http://localhost:8080/decide"
payload = {
"payment_id": "pay_demo",
"merchant_id": "pro_demo",
"amount": 1000,
"currency": "USD",
"payment_method_type": "card",
"payment_method_sub_type": "credit",
"authentication_type": None,
"capture_method": None,
"mandate_type": None,
"mandate_acceptance_type": None,
"setup_future_usage": None,
"transaction_initiator": None,
"surcharge_amount": None,
"business_country": None,
"billing_country": "US",
"business_label": None,
"card": {
"card_isin": "001234",
"card_extended_bin": "00123456",
"card_network": "Visa",
"card_type": "credit",
"card_issuer": None,
"card_issuing_country_code": "US",
"card_subtype": None,
"card_discovery": None,
"card_switch_provider": None
},
"customer_device_platform": None,
"customer_device_type": None,
"customer_device_display_size": None,
"pay_later": None,
"wallet": None,
"upi": None,
"voucher": None,
"bank_redirect": None,
"bank_debit": None,
"bank_transfer": None,
"real_time_payment": None,
"gift_card": None,
"card_redirect": None,
"open_banking": None,
"mobile_payment": None,
"crypto": None,
"reward": None,
"network_token": None,
"metadata": { "segment": "premium" },
"country": None,
"customer_id": None,
"routing_config": {
"algorithm_for": "payment",
"elimination_enabled": None,
"enable_multi_objective": None,
"ranking_algorithm": None,
"eligible_connectors": [
{
"gateway_name": "worldpay",
"payment_merchant_connector_id": "mca_wp"
},
{
"gateway_name": "checkout",
"payment_merchant_connector_id": "mca_cko"
}
],
"preferred_connectors": None
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_id: 'pay_demo',
merchant_id: 'pro_demo',
amount: 1000,
currency: 'USD',
payment_method_type: 'card',
payment_method_sub_type: 'credit',
authentication_type: null,
capture_method: null,
mandate_type: null,
mandate_acceptance_type: null,
setup_future_usage: null,
transaction_initiator: null,
surcharge_amount: null,
business_country: null,
billing_country: 'US',
business_label: null,
card: {
card_isin: '001234',
card_extended_bin: '00123456',
card_network: 'Visa',
card_type: 'credit',
card_issuer: null,
card_issuing_country_code: 'US',
card_subtype: null,
card_discovery: null,
card_switch_provider: null
},
customer_device_platform: null,
customer_device_type: null,
customer_device_display_size: null,
pay_later: null,
wallet: null,
upi: null,
voucher: null,
bank_redirect: null,
bank_debit: null,
bank_transfer: null,
real_time_payment: null,
gift_card: null,
card_redirect: null,
open_banking: null,
mobile_payment: null,
crypto: null,
reward: null,
network_token: null,
metadata: {segment: 'premium'},
country: null,
customer_id: null,
routing_config: {
algorithm_for: 'payment',
elimination_enabled: null,
enable_multi_objective: null,
ranking_algorithm: null,
eligible_connectors: [
{gateway_name: 'worldpay', payment_merchant_connector_id: 'mca_wp'},
{gateway_name: 'checkout', payment_merchant_connector_id: 'mca_cko'}
],
preferred_connectors: null
}
})
};
fetch('http://localhost:8080/decide', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/decide",
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([
'payment_id' => 'pay_demo',
'merchant_id' => 'pro_demo',
'amount' => 1000,
'currency' => 'USD',
'payment_method_type' => 'card',
'payment_method_sub_type' => 'credit',
'authentication_type' => null,
'capture_method' => null,
'mandate_type' => null,
'mandate_acceptance_type' => null,
'setup_future_usage' => null,
'transaction_initiator' => null,
'surcharge_amount' => null,
'business_country' => null,
'billing_country' => 'US',
'business_label' => null,
'card' => [
'card_isin' => '001234',
'card_extended_bin' => '00123456',
'card_network' => 'Visa',
'card_type' => 'credit',
'card_issuer' => null,
'card_issuing_country_code' => 'US',
'card_subtype' => null,
'card_discovery' => null,
'card_switch_provider' => null
],
'customer_device_platform' => null,
'customer_device_type' => null,
'customer_device_display_size' => null,
'pay_later' => null,
'wallet' => null,
'upi' => null,
'voucher' => null,
'bank_redirect' => null,
'bank_debit' => null,
'bank_transfer' => null,
'real_time_payment' => null,
'gift_card' => null,
'card_redirect' => null,
'open_banking' => null,
'mobile_payment' => null,
'crypto' => null,
'reward' => null,
'network_token' => null,
'metadata' => [
'segment' => 'premium'
],
'country' => null,
'customer_id' => null,
'routing_config' => [
'algorithm_for' => 'payment',
'elimination_enabled' => null,
'enable_multi_objective' => null,
'ranking_algorithm' => null,
'eligible_connectors' => [
[
'gateway_name' => 'worldpay',
'payment_merchant_connector_id' => 'mca_wp'
],
[
'gateway_name' => 'checkout',
'payment_merchant_connector_id' => 'mca_cko'
]
],
'preferred_connectors' => null
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/decide"
payload := strings.NewReader("{\n \"payment_id\": \"pay_demo\",\n \"merchant_id\": \"pro_demo\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"payment_method_type\": \"card\",\n \"payment_method_sub_type\": \"credit\",\n \"authentication_type\": null,\n \"capture_method\": null,\n \"mandate_type\": null,\n \"mandate_acceptance_type\": null,\n \"setup_future_usage\": null,\n \"transaction_initiator\": null,\n \"surcharge_amount\": null,\n \"business_country\": null,\n \"billing_country\": \"US\",\n \"business_label\": null,\n \"card\": {\n \"card_isin\": \"001234\",\n \"card_extended_bin\": \"00123456\",\n \"card_network\": \"Visa\",\n \"card_type\": \"credit\",\n \"card_issuer\": null,\n \"card_issuing_country_code\": \"US\",\n \"card_subtype\": null,\n \"card_discovery\": null,\n \"card_switch_provider\": null\n },\n \"customer_device_platform\": null,\n \"customer_device_type\": null,\n \"customer_device_display_size\": null,\n \"pay_later\": null,\n \"wallet\": null,\n \"upi\": null,\n \"voucher\": null,\n \"bank_redirect\": null,\n \"bank_debit\": null,\n \"bank_transfer\": null,\n \"real_time_payment\": null,\n \"gift_card\": null,\n \"card_redirect\": null,\n \"open_banking\": null,\n \"mobile_payment\": null,\n \"crypto\": null,\n \"reward\": null,\n \"network_token\": null,\n \"metadata\": {\n \"segment\": \"premium\"\n },\n \"country\": null,\n \"customer_id\": null,\n \"routing_config\": {\n \"algorithm_for\": \"payment\",\n \"elimination_enabled\": null,\n \"enable_multi_objective\": null,\n \"ranking_algorithm\": null,\n \"eligible_connectors\": [\n {\n \"gateway_name\": \"worldpay\",\n \"payment_merchant_connector_id\": \"mca_wp\"\n },\n {\n \"gateway_name\": \"checkout\",\n \"payment_merchant_connector_id\": \"mca_cko\"\n }\n ],\n \"preferred_connectors\": null\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:8080/decide")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"pay_demo\",\n \"merchant_id\": \"pro_demo\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"payment_method_type\": \"card\",\n \"payment_method_sub_type\": \"credit\",\n \"authentication_type\": null,\n \"capture_method\": null,\n \"mandate_type\": null,\n \"mandate_acceptance_type\": null,\n \"setup_future_usage\": null,\n \"transaction_initiator\": null,\n \"surcharge_amount\": null,\n \"business_country\": null,\n \"billing_country\": \"US\",\n \"business_label\": null,\n \"card\": {\n \"card_isin\": \"001234\",\n \"card_extended_bin\": \"00123456\",\n \"card_network\": \"Visa\",\n \"card_type\": \"credit\",\n \"card_issuer\": null,\n \"card_issuing_country_code\": \"US\",\n \"card_subtype\": null,\n \"card_discovery\": null,\n \"card_switch_provider\": null\n },\n \"customer_device_platform\": null,\n \"customer_device_type\": null,\n \"customer_device_display_size\": null,\n \"pay_later\": null,\n \"wallet\": null,\n \"upi\": null,\n \"voucher\": null,\n \"bank_redirect\": null,\n \"bank_debit\": null,\n \"bank_transfer\": null,\n \"real_time_payment\": null,\n \"gift_card\": null,\n \"card_redirect\": null,\n \"open_banking\": null,\n \"mobile_payment\": null,\n \"crypto\": null,\n \"reward\": null,\n \"network_token\": null,\n \"metadata\": {\n \"segment\": \"premium\"\n },\n \"country\": null,\n \"customer_id\": null,\n \"routing_config\": {\n \"algorithm_for\": \"payment\",\n \"elimination_enabled\": null,\n \"enable_multi_objective\": null,\n \"ranking_algorithm\": null,\n \"eligible_connectors\": [\n {\n \"gateway_name\": \"worldpay\",\n \"payment_merchant_connector_id\": \"mca_wp\"\n },\n {\n \"gateway_name\": \"checkout\",\n \"payment_merchant_connector_id\": \"mca_cko\"\n }\n ],\n \"preferred_connectors\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/decide")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"pay_demo\",\n \"merchant_id\": \"pro_demo\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"payment_method_type\": \"card\",\n \"payment_method_sub_type\": \"credit\",\n \"authentication_type\": null,\n \"capture_method\": null,\n \"mandate_type\": null,\n \"mandate_acceptance_type\": null,\n \"setup_future_usage\": null,\n \"transaction_initiator\": null,\n \"surcharge_amount\": null,\n \"business_country\": null,\n \"billing_country\": \"US\",\n \"business_label\": null,\n \"card\": {\n \"card_isin\": \"001234\",\n \"card_extended_bin\": \"00123456\",\n \"card_network\": \"Visa\",\n \"card_type\": \"credit\",\n \"card_issuer\": null,\n \"card_issuing_country_code\": \"US\",\n \"card_subtype\": null,\n \"card_discovery\": null,\n \"card_switch_provider\": null\n },\n \"customer_device_platform\": null,\n \"customer_device_type\": null,\n \"customer_device_display_size\": null,\n \"pay_later\": null,\n \"wallet\": null,\n \"upi\": null,\n \"voucher\": null,\n \"bank_redirect\": null,\n \"bank_debit\": null,\n \"bank_transfer\": null,\n \"real_time_payment\": null,\n \"gift_card\": null,\n \"card_redirect\": null,\n \"open_banking\": null,\n \"mobile_payment\": null,\n \"crypto\": null,\n \"reward\": null,\n \"network_token\": null,\n \"metadata\": {\n \"segment\": \"premium\"\n },\n \"country\": null,\n \"customer_id\": null,\n \"routing_config\": {\n \"algorithm_for\": \"payment\",\n \"elimination_enabled\": null,\n \"enable_multi_objective\": null,\n \"ranking_algorithm\": null,\n \"eligible_connectors\": [\n {\n \"gateway_name\": \"worldpay\",\n \"payment_merchant_connector_id\": \"mca_wp\"\n },\n {\n \"gateway_name\": \"checkout\",\n \"payment_merchant_connector_id\": \"mca_cko\"\n }\n ],\n \"preferred_connectors\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"evaluated_connectors": [
{
"gateway_name": "<string>",
"payment_merchant_connector_id": "<string>"
}
],
"decision": {
"outcome": "routed",
"source": "<string>",
"decision_id": "<string>"
}
}Authorizations
BearerAuthApiKeyAuth
JWT token obtained from /auth/login
Body
application/json
Amount in currency minor units. Supplies both existing amount and payment_amount rule keys and the dynamic payment amount.
Currency code, e.g. USD.
Show child attributes
Show child attributes
Routing scope previously supplied as created_by. Use the same identifier, including the HS profile ID where applicable.
Payment method family, e.g. card.
Payment method subtype, e.g. credit.
Amount in currency minor units.
ISO 3166 alpha-2 country code.
ISO 3166 alpha-2 country code.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ISO 3166 alpha-2 country code.
Was this page helpful?