curl --request POST \
--url https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"decision_engine_configs": {
"defaultLatencyThreshold": 90,
"defaultBucketSize": 100,
"defaultHedgingPercent": 5,
"defaultLowerResetFactor": 0.5,
"defaultUpperResetFactor": 1.5,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "card",
"paymentMethod": "credit",
"latencyThreshold": 90,
"bucketSize": 100,
"hedgingPercent": 5,
"lowerResetFactor": 0.5,
"upperResetFactor": 1.5,
"gatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
]
}
]
},
"params": [],
"config": {
"min_aggregates_size": 1,
"default_success_rate": 123,
"max_aggregates_size": 1,
"current_block_threshold": {
"duration_in_mins": 1,
"max_total_count": 1
},
"exploration_percent": 123,
"shuffle_on_tie_during_exploitation": true
}
}
'import requests
url = "https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload = {
"decision_engine_configs": {
"defaultLatencyThreshold": 90,
"defaultBucketSize": 100,
"defaultHedgingPercent": 5,
"defaultLowerResetFactor": 0.5,
"defaultUpperResetFactor": 1.5,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "card",
"paymentMethod": "credit",
"latencyThreshold": 90,
"bucketSize": 100,
"hedgingPercent": 5,
"lowerResetFactor": 0.5,
"upperResetFactor": 1.5,
"gatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
]
}
]
},
"params": [],
"config": {
"min_aggregates_size": 1,
"default_success_rate": 123,
"max_aggregates_size": 1,
"current_block_threshold": {
"duration_in_mins": 1,
"max_total_count": 1
},
"exploration_percent": 123,
"shuffle_on_tie_during_exploitation": True
}
}
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({
decision_engine_configs: {
defaultLatencyThreshold: 90,
defaultBucketSize: 100,
defaultHedgingPercent: 5,
defaultLowerResetFactor: 0.5,
defaultUpperResetFactor: 1.5,
defaultGatewayExtraScore: [{gatewayName: '<string>', gatewaySigmaFactor: 123}],
subLevelInputConfig: [
{
paymentMethodType: 'card',
paymentMethod: 'credit',
latencyThreshold: 90,
bucketSize: 100,
hedgingPercent: 5,
lowerResetFactor: 0.5,
upperResetFactor: 1.5,
gatewayExtraScore: [{gatewayName: '<string>', gatewaySigmaFactor: 123}]
}
]
},
params: [],
config: {
min_aggregates_size: 1,
default_success_rate: 123,
max_aggregates_size: 1,
current_block_threshold: {duration_in_mins: 1, max_total_count: 1},
exploration_percent: 123,
shuffle_on_tie_during_exploitation: true
}
})
};
fetch('https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create', 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/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create",
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([
'decision_engine_configs' => [
'defaultLatencyThreshold' => 90,
'defaultBucketSize' => 100,
'defaultHedgingPercent' => 5,
'defaultLowerResetFactor' => 0.5,
'defaultUpperResetFactor' => 1.5,
'defaultGatewayExtraScore' => [
[
'gatewayName' => '<string>',
'gatewaySigmaFactor' => 123
]
],
'subLevelInputConfig' => [
[
'paymentMethodType' => 'card',
'paymentMethod' => 'credit',
'latencyThreshold' => 90,
'bucketSize' => 100,
'hedgingPercent' => 5,
'lowerResetFactor' => 0.5,
'upperResetFactor' => 1.5,
'gatewayExtraScore' => [
[
'gatewayName' => '<string>',
'gatewaySigmaFactor' => 123
]
]
]
]
],
'params' => [
],
'config' => [
'min_aggregates_size' => 1,
'default_success_rate' => 123,
'max_aggregates_size' => 1,
'current_block_threshold' => [
'duration_in_mins' => 1,
'max_total_count' => 1
],
'exploration_percent' => 123,
'shuffle_on_tie_during_exploitation' => true
]
]),
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/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload := strings.NewReader("{\n \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 90,\n \"defaultBucketSize\": 100,\n \"defaultHedgingPercent\": 5,\n \"defaultLowerResetFactor\": 0.5,\n \"defaultUpperResetFactor\": 1.5,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"card\",\n \"paymentMethod\": \"credit\",\n \"latencyThreshold\": 90,\n \"bucketSize\": 100,\n \"hedgingPercent\": 5,\n \"lowerResetFactor\": 0.5,\n \"upperResetFactor\": 1.5,\n \"gatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ]\n }\n ]\n },\n \"params\": [],\n \"config\": {\n \"min_aggregates_size\": 1,\n \"default_success_rate\": 123,\n \"max_aggregates_size\": 1,\n \"current_block_threshold\": {\n \"duration_in_mins\": 1,\n \"max_total_count\": 1\n },\n \"exploration_percent\": 123,\n \"shuffle_on_tie_during_exploitation\": true\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/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 90,\n \"defaultBucketSize\": 100,\n \"defaultHedgingPercent\": 5,\n \"defaultLowerResetFactor\": 0.5,\n \"defaultUpperResetFactor\": 1.5,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"card\",\n \"paymentMethod\": \"credit\",\n \"latencyThreshold\": 90,\n \"bucketSize\": 100,\n \"hedgingPercent\": 5,\n \"lowerResetFactor\": 0.5,\n \"upperResetFactor\": 1.5,\n \"gatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ]\n }\n ]\n },\n \"params\": [],\n \"config\": {\n \"min_aggregates_size\": 1,\n \"default_success_rate\": 123,\n \"max_aggregates_size\": 1,\n \"current_block_threshold\": {\n \"duration_in_mins\": 1,\n \"max_total_count\": 1\n },\n \"exploration_percent\": 123,\n \"shuffle_on_tie_during_exploitation\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create")
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 \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 90,\n \"defaultBucketSize\": 100,\n \"defaultHedgingPercent\": 5,\n \"defaultLowerResetFactor\": 0.5,\n \"defaultUpperResetFactor\": 1.5,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"card\",\n \"paymentMethod\": \"credit\",\n \"latencyThreshold\": 90,\n \"bucketSize\": 100,\n \"hedgingPercent\": 5,\n \"lowerResetFactor\": 0.5,\n \"upperResetFactor\": 1.5,\n \"gatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ]\n }\n ]\n },\n \"params\": [],\n \"config\": {\n \"min_aggregates_size\": 1,\n \"default_success_rate\": 123,\n \"max_aggregates_size\": 1,\n \"current_block_threshold\": {\n \"duration_in_mins\": 1,\n \"max_total_count\": 1\n },\n \"exploration_percent\": 123,\n \"shuffle_on_tie_during_exploitation\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "routing_abc123",
"profile_id": "profile_123",
"name": "india_card_routing",
"description": "Volume split routing for domestic transactions",
"created_at": 1718000000000,
"modified_at": 1718050000000,
"decision_engine_routing_id": "de_route_456"
}Routing - Auth Rate Based
Create a success based dynamic routing algorithm
curl --request POST \
--url https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"decision_engine_configs": {
"defaultLatencyThreshold": 90,
"defaultBucketSize": 100,
"defaultHedgingPercent": 5,
"defaultLowerResetFactor": 0.5,
"defaultUpperResetFactor": 1.5,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "card",
"paymentMethod": "credit",
"latencyThreshold": 90,
"bucketSize": 100,
"hedgingPercent": 5,
"lowerResetFactor": 0.5,
"upperResetFactor": 1.5,
"gatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
]
}
]
},
"params": [],
"config": {
"min_aggregates_size": 1,
"default_success_rate": 123,
"max_aggregates_size": 1,
"current_block_threshold": {
"duration_in_mins": 1,
"max_total_count": 1
},
"exploration_percent": 123,
"shuffle_on_tie_during_exploitation": true
}
}
'import requests
url = "https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload = {
"decision_engine_configs": {
"defaultLatencyThreshold": 90,
"defaultBucketSize": 100,
"defaultHedgingPercent": 5,
"defaultLowerResetFactor": 0.5,
"defaultUpperResetFactor": 1.5,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "card",
"paymentMethod": "credit",
"latencyThreshold": 90,
"bucketSize": 100,
"hedgingPercent": 5,
"lowerResetFactor": 0.5,
"upperResetFactor": 1.5,
"gatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
]
}
]
},
"params": [],
"config": {
"min_aggregates_size": 1,
"default_success_rate": 123,
"max_aggregates_size": 1,
"current_block_threshold": {
"duration_in_mins": 1,
"max_total_count": 1
},
"exploration_percent": 123,
"shuffle_on_tie_during_exploitation": True
}
}
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({
decision_engine_configs: {
defaultLatencyThreshold: 90,
defaultBucketSize: 100,
defaultHedgingPercent: 5,
defaultLowerResetFactor: 0.5,
defaultUpperResetFactor: 1.5,
defaultGatewayExtraScore: [{gatewayName: '<string>', gatewaySigmaFactor: 123}],
subLevelInputConfig: [
{
paymentMethodType: 'card',
paymentMethod: 'credit',
latencyThreshold: 90,
bucketSize: 100,
hedgingPercent: 5,
lowerResetFactor: 0.5,
upperResetFactor: 1.5,
gatewayExtraScore: [{gatewayName: '<string>', gatewaySigmaFactor: 123}]
}
]
},
params: [],
config: {
min_aggregates_size: 1,
default_success_rate: 123,
max_aggregates_size: 1,
current_block_threshold: {duration_in_mins: 1, max_total_count: 1},
exploration_percent: 123,
shuffle_on_tie_during_exploitation: true
}
})
};
fetch('https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create', 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/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create",
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([
'decision_engine_configs' => [
'defaultLatencyThreshold' => 90,
'defaultBucketSize' => 100,
'defaultHedgingPercent' => 5,
'defaultLowerResetFactor' => 0.5,
'defaultUpperResetFactor' => 1.5,
'defaultGatewayExtraScore' => [
[
'gatewayName' => '<string>',
'gatewaySigmaFactor' => 123
]
],
'subLevelInputConfig' => [
[
'paymentMethodType' => 'card',
'paymentMethod' => 'credit',
'latencyThreshold' => 90,
'bucketSize' => 100,
'hedgingPercent' => 5,
'lowerResetFactor' => 0.5,
'upperResetFactor' => 1.5,
'gatewayExtraScore' => [
[
'gatewayName' => '<string>',
'gatewaySigmaFactor' => 123
]
]
]
]
],
'params' => [
],
'config' => [
'min_aggregates_size' => 1,
'default_success_rate' => 123,
'max_aggregates_size' => 1,
'current_block_threshold' => [
'duration_in_mins' => 1,
'max_total_count' => 1
],
'exploration_percent' => 123,
'shuffle_on_tie_during_exploitation' => true
]
]),
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/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload := strings.NewReader("{\n \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 90,\n \"defaultBucketSize\": 100,\n \"defaultHedgingPercent\": 5,\n \"defaultLowerResetFactor\": 0.5,\n \"defaultUpperResetFactor\": 1.5,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"card\",\n \"paymentMethod\": \"credit\",\n \"latencyThreshold\": 90,\n \"bucketSize\": 100,\n \"hedgingPercent\": 5,\n \"lowerResetFactor\": 0.5,\n \"upperResetFactor\": 1.5,\n \"gatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ]\n }\n ]\n },\n \"params\": [],\n \"config\": {\n \"min_aggregates_size\": 1,\n \"default_success_rate\": 123,\n \"max_aggregates_size\": 1,\n \"current_block_threshold\": {\n \"duration_in_mins\": 1,\n \"max_total_count\": 1\n },\n \"exploration_percent\": 123,\n \"shuffle_on_tie_during_exploitation\": true\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/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 90,\n \"defaultBucketSize\": 100,\n \"defaultHedgingPercent\": 5,\n \"defaultLowerResetFactor\": 0.5,\n \"defaultUpperResetFactor\": 1.5,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"card\",\n \"paymentMethod\": \"credit\",\n \"latencyThreshold\": 90,\n \"bucketSize\": 100,\n \"hedgingPercent\": 5,\n \"lowerResetFactor\": 0.5,\n \"upperResetFactor\": 1.5,\n \"gatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ]\n }\n ]\n },\n \"params\": [],\n \"config\": {\n \"min_aggregates_size\": 1,\n \"default_success_rate\": 123,\n \"max_aggregates_size\": 1,\n \"current_block_threshold\": {\n \"duration_in_mins\": 1,\n \"max_total_count\": 1\n },\n \"exploration_percent\": 123,\n \"shuffle_on_tie_during_exploitation\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create")
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 \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 90,\n \"defaultBucketSize\": 100,\n \"defaultHedgingPercent\": 5,\n \"defaultLowerResetFactor\": 0.5,\n \"defaultUpperResetFactor\": 1.5,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"card\",\n \"paymentMethod\": \"credit\",\n \"latencyThreshold\": 90,\n \"bucketSize\": 100,\n \"hedgingPercent\": 5,\n \"lowerResetFactor\": 0.5,\n \"upperResetFactor\": 1.5,\n \"gatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ]\n }\n ]\n },\n \"params\": [],\n \"config\": {\n \"min_aggregates_size\": 1,\n \"default_success_rate\": 123,\n \"max_aggregates_size\": 1,\n \"current_block_threshold\": {\n \"duration_in_mins\": 1,\n \"max_total_count\": 1\n },\n \"exploration_percent\": 123,\n \"shuffle_on_tie_during_exploitation\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "routing_abc123",
"profile_id": "profile_123",
"name": "india_card_routing",
"description": "Volume split routing for domestic transactions",
"created_at": 1718000000000,
"modified_at": 1718050000000,
"decision_engine_routing_id": "de_route_456"
}Authorizations
Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Path Parameters
Merchant id
Profile id under which Dynamic routing needs to be created
Query Parameters
Feature to enable for success based routing
metrics, dynamic_connector_selection, none Body
Configuration for Decision Engine success rate based routing
Show child attributes
Show child attributes
PaymentMethod, PaymentMethodType, AuthenticationType, Currency, Country, CardNetwork, CardBin Show child attributes
Show child attributes
Response
Routing Algorithm created
Metadata record representing a stored routing configuration.
Used in routing dictionary listings.
Unique identifier of the routing configuration.
Example:
"routing_abc123"
"routing_abc123"
Profile ID associated with this routing configuration.
Example:
"profile_123"
"profile_123"
Name of the routing configuration.
Example:
"india_card_routing"
"india_card_routing"
single, priority, volume_split, advanced, dynamic, three_ds_decision_rule Description of this routing configuration.
Example:
"Volume split routing for domestic transactions"
"Volume split routing for domestic transactions"
Creation timestamp (milliseconds since epoch).
1718000000000
Last modification timestamp (milliseconds since epoch).
1718050000000
payment, payout, three_ds_authentication Associated Decision Engine routing identifier (if applicable).
Present when routing is linked to an external decision engine.
Example:
"de_route_456"
"de_route_456"
Was this page helpful?