Hybrid routing evaluation
curl --request POST \
--url http://localhost:8080/routing/hybrid \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"static_routing_request": {
"created_by": "test_merchant",
"parameters": {
"currency": {
"type": "str_value",
"value": "USD"
}
},
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
},
"dynamic_routing_request": {
"merchantId": "test_merchant",
"paymentInfo": {
"paymentId": "pay_001",
"amount": 1000,
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"paymentMethodType": "CARD",
"paymentMethod": "CREDIT",
"country": "US",
"customerId": "cust_123",
"udfs": {},
"preferredGateway": "<string>",
"metadata": "<string>",
"internalMetadata": "<string>",
"isEmi": true,
"emiBank": "<string>",
"emiTenure": 123,
"paymentSource": "<string>",
"authType": "THREE_DS",
"cardIssuerBankName": "<string>",
"cardIsin": "411111",
"cardType": "CREDIT",
"cardSwitchProvider": "<string>",
"cardProgram": "<string>",
"cardIssuerCountry": "<string>",
"channel": "<string>"
},
"eligibleGatewayList": [
"stripe",
"paypal",
"adyen"
],
"rankingAlgorithm": "SR_BASED_ROUTING",
"eliminationEnabled": false,
"enableMultiObjective": true
}
}
'import requests
url = "http://localhost:8080/routing/hybrid"
payload = {
"static_routing_request": {
"created_by": "test_merchant",
"parameters": { "currency": {
"type": "str_value",
"value": "USD"
} },
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
},
"dynamic_routing_request": {
"merchantId": "test_merchant",
"paymentInfo": {
"paymentId": "pay_001",
"amount": 1000,
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"paymentMethodType": "CARD",
"paymentMethod": "CREDIT",
"country": "US",
"customerId": "cust_123",
"udfs": {},
"preferredGateway": "<string>",
"metadata": "<string>",
"internalMetadata": "<string>",
"isEmi": True,
"emiBank": "<string>",
"emiTenure": 123,
"paymentSource": "<string>",
"authType": "THREE_DS",
"cardIssuerBankName": "<string>",
"cardIsin": "411111",
"cardType": "CREDIT",
"cardSwitchProvider": "<string>",
"cardProgram": "<string>",
"cardIssuerCountry": "<string>",
"channel": "<string>"
},
"eligibleGatewayList": ["stripe", "paypal", "adyen"],
"rankingAlgorithm": "SR_BASED_ROUTING",
"eliminationEnabled": False,
"enableMultiObjective": True
}
}
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({
static_routing_request: {
created_by: 'test_merchant',
parameters: {currency: {type: 'str_value', value: 'USD'}},
payment_id: '<string>',
fallback_output: [{gateway_name: '<string>', gateway_id: '<string>'}]
},
dynamic_routing_request: {
merchantId: 'test_merchant',
paymentInfo: {
paymentId: 'pay_001',
amount: 1000,
currency: 'USD',
paymentType: 'ORDER_PAYMENT',
paymentMethodType: 'CARD',
paymentMethod: 'CREDIT',
country: 'US',
customerId: 'cust_123',
udfs: {},
preferredGateway: '<string>',
metadata: '<string>',
internalMetadata: '<string>',
isEmi: true,
emiBank: '<string>',
emiTenure: 123,
paymentSource: '<string>',
authType: 'THREE_DS',
cardIssuerBankName: '<string>',
cardIsin: '411111',
cardType: 'CREDIT',
cardSwitchProvider: '<string>',
cardProgram: '<string>',
cardIssuerCountry: '<string>',
channel: '<string>'
},
eligibleGatewayList: ['stripe', 'paypal', 'adyen'],
rankingAlgorithm: 'SR_BASED_ROUTING',
eliminationEnabled: false,
enableMultiObjective: true
}
})
};
fetch('http://localhost:8080/routing/hybrid', 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/routing/hybrid",
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([
'static_routing_request' => [
'created_by' => 'test_merchant',
'parameters' => [
'currency' => [
'type' => 'str_value',
'value' => 'USD'
]
],
'payment_id' => '<string>',
'fallback_output' => [
[
'gateway_name' => '<string>',
'gateway_id' => '<string>'
]
]
],
'dynamic_routing_request' => [
'merchantId' => 'test_merchant',
'paymentInfo' => [
'paymentId' => 'pay_001',
'amount' => 1000,
'currency' => 'USD',
'paymentType' => 'ORDER_PAYMENT',
'paymentMethodType' => 'CARD',
'paymentMethod' => 'CREDIT',
'country' => 'US',
'customerId' => 'cust_123',
'udfs' => [
],
'preferredGateway' => '<string>',
'metadata' => '<string>',
'internalMetadata' => '<string>',
'isEmi' => true,
'emiBank' => '<string>',
'emiTenure' => 123,
'paymentSource' => '<string>',
'authType' => 'THREE_DS',
'cardIssuerBankName' => '<string>',
'cardIsin' => '411111',
'cardType' => 'CREDIT',
'cardSwitchProvider' => '<string>',
'cardProgram' => '<string>',
'cardIssuerCountry' => '<string>',
'channel' => '<string>'
],
'eligibleGatewayList' => [
'stripe',
'paypal',
'adyen'
],
'rankingAlgorithm' => 'SR_BASED_ROUTING',
'eliminationEnabled' => false,
'enableMultiObjective' => true
]
]),
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/routing/hybrid"
payload := strings.NewReader("{\n \"static_routing_request\": {\n \"created_by\": \"test_merchant\",\n \"parameters\": {\n \"currency\": {\n \"type\": \"str_value\",\n \"value\": \"USD\"\n }\n },\n \"payment_id\": \"<string>\",\n \"fallback_output\": [\n {\n \"gateway_name\": \"<string>\",\n \"gateway_id\": \"<string>\"\n }\n ]\n },\n \"dynamic_routing_request\": {\n \"merchantId\": \"test_merchant\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"udfs\": {},\n \"preferredGateway\": \"<string>\",\n \"metadata\": \"<string>\",\n \"internalMetadata\": \"<string>\",\n \"isEmi\": true,\n \"emiBank\": \"<string>\",\n \"emiTenure\": 123,\n \"paymentSource\": \"<string>\",\n \"authType\": \"THREE_DS\",\n \"cardIssuerBankName\": \"<string>\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardSwitchProvider\": \"<string>\",\n \"cardProgram\": \"<string>\",\n \"cardIssuerCountry\": \"<string>\",\n \"channel\": \"<string>\"\n },\n \"eligibleGatewayList\": [\n \"stripe\",\n \"paypal\",\n \"adyen\"\n ],\n \"rankingAlgorithm\": \"SR_BASED_ROUTING\",\n \"eliminationEnabled\": false,\n \"enableMultiObjective\": true\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/routing/hybrid")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"static_routing_request\": {\n \"created_by\": \"test_merchant\",\n \"parameters\": {\n \"currency\": {\n \"type\": \"str_value\",\n \"value\": \"USD\"\n }\n },\n \"payment_id\": \"<string>\",\n \"fallback_output\": [\n {\n \"gateway_name\": \"<string>\",\n \"gateway_id\": \"<string>\"\n }\n ]\n },\n \"dynamic_routing_request\": {\n \"merchantId\": \"test_merchant\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"udfs\": {},\n \"preferredGateway\": \"<string>\",\n \"metadata\": \"<string>\",\n \"internalMetadata\": \"<string>\",\n \"isEmi\": true,\n \"emiBank\": \"<string>\",\n \"emiTenure\": 123,\n \"paymentSource\": \"<string>\",\n \"authType\": \"THREE_DS\",\n \"cardIssuerBankName\": \"<string>\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardSwitchProvider\": \"<string>\",\n \"cardProgram\": \"<string>\",\n \"cardIssuerCountry\": \"<string>\",\n \"channel\": \"<string>\"\n },\n \"eligibleGatewayList\": [\n \"stripe\",\n \"paypal\",\n \"adyen\"\n ],\n \"rankingAlgorithm\": \"SR_BASED_ROUTING\",\n \"eliminationEnabled\": false,\n \"enableMultiObjective\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/routing/hybrid")
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 \"static_routing_request\": {\n \"created_by\": \"test_merchant\",\n \"parameters\": {\n \"currency\": {\n \"type\": \"str_value\",\n \"value\": \"USD\"\n }\n },\n \"payment_id\": \"<string>\",\n \"fallback_output\": [\n {\n \"gateway_name\": \"<string>\",\n \"gateway_id\": \"<string>\"\n }\n ]\n },\n \"dynamic_routing_request\": {\n \"merchantId\": \"test_merchant\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"udfs\": {},\n \"preferredGateway\": \"<string>\",\n \"metadata\": \"<string>\",\n \"internalMetadata\": \"<string>\",\n \"isEmi\": true,\n \"emiBank\": \"<string>\",\n \"emiTenure\": 123,\n \"paymentSource\": \"<string>\",\n \"authType\": \"THREE_DS\",\n \"cardIssuerBankName\": \"<string>\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardSwitchProvider\": \"<string>\",\n \"cardProgram\": \"<string>\",\n \"cardIssuerCountry\": \"<string>\",\n \"channel\": \"<string>\"\n },\n \"eligibleGatewayList\": [\n \"stripe\",\n \"paypal\",\n \"adyen\"\n ],\n \"rankingAlgorithm\": \"SR_BASED_ROUTING\",\n \"eliminationEnabled\": false,\n \"enableMultiObjective\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"static_routing": {},
"dynamic_routing": {},
"evaluated_connectors": [
{}
]
}OpenAPI: Routing Rules
Hybrid Routing
Evaluate hybrid routing using the active routing rule plus runtime payment context.
POST
/
routing
/
hybrid
Hybrid routing evaluation
curl --request POST \
--url http://localhost:8080/routing/hybrid \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"static_routing_request": {
"created_by": "test_merchant",
"parameters": {
"currency": {
"type": "str_value",
"value": "USD"
}
},
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
},
"dynamic_routing_request": {
"merchantId": "test_merchant",
"paymentInfo": {
"paymentId": "pay_001",
"amount": 1000,
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"paymentMethodType": "CARD",
"paymentMethod": "CREDIT",
"country": "US",
"customerId": "cust_123",
"udfs": {},
"preferredGateway": "<string>",
"metadata": "<string>",
"internalMetadata": "<string>",
"isEmi": true,
"emiBank": "<string>",
"emiTenure": 123,
"paymentSource": "<string>",
"authType": "THREE_DS",
"cardIssuerBankName": "<string>",
"cardIsin": "411111",
"cardType": "CREDIT",
"cardSwitchProvider": "<string>",
"cardProgram": "<string>",
"cardIssuerCountry": "<string>",
"channel": "<string>"
},
"eligibleGatewayList": [
"stripe",
"paypal",
"adyen"
],
"rankingAlgorithm": "SR_BASED_ROUTING",
"eliminationEnabled": false,
"enableMultiObjective": true
}
}
'import requests
url = "http://localhost:8080/routing/hybrid"
payload = {
"static_routing_request": {
"created_by": "test_merchant",
"parameters": { "currency": {
"type": "str_value",
"value": "USD"
} },
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
},
"dynamic_routing_request": {
"merchantId": "test_merchant",
"paymentInfo": {
"paymentId": "pay_001",
"amount": 1000,
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"paymentMethodType": "CARD",
"paymentMethod": "CREDIT",
"country": "US",
"customerId": "cust_123",
"udfs": {},
"preferredGateway": "<string>",
"metadata": "<string>",
"internalMetadata": "<string>",
"isEmi": True,
"emiBank": "<string>",
"emiTenure": 123,
"paymentSource": "<string>",
"authType": "THREE_DS",
"cardIssuerBankName": "<string>",
"cardIsin": "411111",
"cardType": "CREDIT",
"cardSwitchProvider": "<string>",
"cardProgram": "<string>",
"cardIssuerCountry": "<string>",
"channel": "<string>"
},
"eligibleGatewayList": ["stripe", "paypal", "adyen"],
"rankingAlgorithm": "SR_BASED_ROUTING",
"eliminationEnabled": False,
"enableMultiObjective": True
}
}
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({
static_routing_request: {
created_by: 'test_merchant',
parameters: {currency: {type: 'str_value', value: 'USD'}},
payment_id: '<string>',
fallback_output: [{gateway_name: '<string>', gateway_id: '<string>'}]
},
dynamic_routing_request: {
merchantId: 'test_merchant',
paymentInfo: {
paymentId: 'pay_001',
amount: 1000,
currency: 'USD',
paymentType: 'ORDER_PAYMENT',
paymentMethodType: 'CARD',
paymentMethod: 'CREDIT',
country: 'US',
customerId: 'cust_123',
udfs: {},
preferredGateway: '<string>',
metadata: '<string>',
internalMetadata: '<string>',
isEmi: true,
emiBank: '<string>',
emiTenure: 123,
paymentSource: '<string>',
authType: 'THREE_DS',
cardIssuerBankName: '<string>',
cardIsin: '411111',
cardType: 'CREDIT',
cardSwitchProvider: '<string>',
cardProgram: '<string>',
cardIssuerCountry: '<string>',
channel: '<string>'
},
eligibleGatewayList: ['stripe', 'paypal', 'adyen'],
rankingAlgorithm: 'SR_BASED_ROUTING',
eliminationEnabled: false,
enableMultiObjective: true
}
})
};
fetch('http://localhost:8080/routing/hybrid', 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/routing/hybrid",
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([
'static_routing_request' => [
'created_by' => 'test_merchant',
'parameters' => [
'currency' => [
'type' => 'str_value',
'value' => 'USD'
]
],
'payment_id' => '<string>',
'fallback_output' => [
[
'gateway_name' => '<string>',
'gateway_id' => '<string>'
]
]
],
'dynamic_routing_request' => [
'merchantId' => 'test_merchant',
'paymentInfo' => [
'paymentId' => 'pay_001',
'amount' => 1000,
'currency' => 'USD',
'paymentType' => 'ORDER_PAYMENT',
'paymentMethodType' => 'CARD',
'paymentMethod' => 'CREDIT',
'country' => 'US',
'customerId' => 'cust_123',
'udfs' => [
],
'preferredGateway' => '<string>',
'metadata' => '<string>',
'internalMetadata' => '<string>',
'isEmi' => true,
'emiBank' => '<string>',
'emiTenure' => 123,
'paymentSource' => '<string>',
'authType' => 'THREE_DS',
'cardIssuerBankName' => '<string>',
'cardIsin' => '411111',
'cardType' => 'CREDIT',
'cardSwitchProvider' => '<string>',
'cardProgram' => '<string>',
'cardIssuerCountry' => '<string>',
'channel' => '<string>'
],
'eligibleGatewayList' => [
'stripe',
'paypal',
'adyen'
],
'rankingAlgorithm' => 'SR_BASED_ROUTING',
'eliminationEnabled' => false,
'enableMultiObjective' => true
]
]),
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/routing/hybrid"
payload := strings.NewReader("{\n \"static_routing_request\": {\n \"created_by\": \"test_merchant\",\n \"parameters\": {\n \"currency\": {\n \"type\": \"str_value\",\n \"value\": \"USD\"\n }\n },\n \"payment_id\": \"<string>\",\n \"fallback_output\": [\n {\n \"gateway_name\": \"<string>\",\n \"gateway_id\": \"<string>\"\n }\n ]\n },\n \"dynamic_routing_request\": {\n \"merchantId\": \"test_merchant\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"udfs\": {},\n \"preferredGateway\": \"<string>\",\n \"metadata\": \"<string>\",\n \"internalMetadata\": \"<string>\",\n \"isEmi\": true,\n \"emiBank\": \"<string>\",\n \"emiTenure\": 123,\n \"paymentSource\": \"<string>\",\n \"authType\": \"THREE_DS\",\n \"cardIssuerBankName\": \"<string>\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardSwitchProvider\": \"<string>\",\n \"cardProgram\": \"<string>\",\n \"cardIssuerCountry\": \"<string>\",\n \"channel\": \"<string>\"\n },\n \"eligibleGatewayList\": [\n \"stripe\",\n \"paypal\",\n \"adyen\"\n ],\n \"rankingAlgorithm\": \"SR_BASED_ROUTING\",\n \"eliminationEnabled\": false,\n \"enableMultiObjective\": true\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/routing/hybrid")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"static_routing_request\": {\n \"created_by\": \"test_merchant\",\n \"parameters\": {\n \"currency\": {\n \"type\": \"str_value\",\n \"value\": \"USD\"\n }\n },\n \"payment_id\": \"<string>\",\n \"fallback_output\": [\n {\n \"gateway_name\": \"<string>\",\n \"gateway_id\": \"<string>\"\n }\n ]\n },\n \"dynamic_routing_request\": {\n \"merchantId\": \"test_merchant\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"udfs\": {},\n \"preferredGateway\": \"<string>\",\n \"metadata\": \"<string>\",\n \"internalMetadata\": \"<string>\",\n \"isEmi\": true,\n \"emiBank\": \"<string>\",\n \"emiTenure\": 123,\n \"paymentSource\": \"<string>\",\n \"authType\": \"THREE_DS\",\n \"cardIssuerBankName\": \"<string>\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardSwitchProvider\": \"<string>\",\n \"cardProgram\": \"<string>\",\n \"cardIssuerCountry\": \"<string>\",\n \"channel\": \"<string>\"\n },\n \"eligibleGatewayList\": [\n \"stripe\",\n \"paypal\",\n \"adyen\"\n ],\n \"rankingAlgorithm\": \"SR_BASED_ROUTING\",\n \"eliminationEnabled\": false,\n \"enableMultiObjective\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/routing/hybrid")
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 \"static_routing_request\": {\n \"created_by\": \"test_merchant\",\n \"parameters\": {\n \"currency\": {\n \"type\": \"str_value\",\n \"value\": \"USD\"\n }\n },\n \"payment_id\": \"<string>\",\n \"fallback_output\": [\n {\n \"gateway_name\": \"<string>\",\n \"gateway_id\": \"<string>\"\n }\n ]\n },\n \"dynamic_routing_request\": {\n \"merchantId\": \"test_merchant\",\n \"paymentInfo\": {\n \"paymentId\": \"pay_001\",\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"paymentMethodType\": \"CARD\",\n \"paymentMethod\": \"CREDIT\",\n \"country\": \"US\",\n \"customerId\": \"cust_123\",\n \"udfs\": {},\n \"preferredGateway\": \"<string>\",\n \"metadata\": \"<string>\",\n \"internalMetadata\": \"<string>\",\n \"isEmi\": true,\n \"emiBank\": \"<string>\",\n \"emiTenure\": 123,\n \"paymentSource\": \"<string>\",\n \"authType\": \"THREE_DS\",\n \"cardIssuerBankName\": \"<string>\",\n \"cardIsin\": \"411111\",\n \"cardType\": \"CREDIT\",\n \"cardSwitchProvider\": \"<string>\",\n \"cardProgram\": \"<string>\",\n \"cardIssuerCountry\": \"<string>\",\n \"channel\": \"<string>\"\n },\n \"eligibleGatewayList\": [\n \"stripe\",\n \"paypal\",\n \"adyen\"\n ],\n \"rankingAlgorithm\": \"SR_BASED_ROUTING\",\n \"eliminationEnabled\": false,\n \"enableMultiObjective\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"static_routing": {},
"dynamic_routing": {},
"evaluated_connectors": [
{}
]
}Authorizations
BearerAuthApiKeyAuth
JWT token obtained from /auth/login
Body
application/json
At least one of static_routing_request or dynamic_routing_request must be provided.
Response
200 - application/json
OK
Was this page helpful?
⌘I