Routing - Auth Rate Based
curl --request POST \
--url https://sandbox.birrpay.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": 123,
"defaultBucketSize": 123,
"defaultHedgingPercent": 123,
"defaultLowerResetFactor": 123,
"defaultUpperResetFactor": 123,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "<string>",
"paymentMethod": "<string>",
"latencyThreshold": 123,
"bucketSize": 123,
"hedgingPercent": 123,
"lowerResetFactor": 123,
"upperResetFactor": 123,
"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.birrpay.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload = {
"decision_engine_configs": {
"defaultLatencyThreshold": 123,
"defaultBucketSize": 123,
"defaultHedgingPercent": 123,
"defaultLowerResetFactor": 123,
"defaultUpperResetFactor": 123,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "<string>",
"paymentMethod": "<string>",
"latencyThreshold": 123,
"bucketSize": 123,
"hedgingPercent": 123,
"lowerResetFactor": 123,
"upperResetFactor": 123,
"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: 123,
defaultBucketSize: 123,
defaultHedgingPercent: 123,
defaultLowerResetFactor: 123,
defaultUpperResetFactor: 123,
defaultGatewayExtraScore: [{gatewayName: '<string>', gatewaySigmaFactor: 123}],
subLevelInputConfig: [
{
paymentMethodType: '<string>',
paymentMethod: '<string>',
latencyThreshold: 123,
bucketSize: 123,
hedgingPercent: 123,
lowerResetFactor: 123,
upperResetFactor: 123,
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.birrpay.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.birrpay.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' => 123,
'defaultBucketSize' => 123,
'defaultHedgingPercent' => 123,
'defaultLowerResetFactor' => 123,
'defaultUpperResetFactor' => 123,
'defaultGatewayExtraScore' => [
[
'gatewayName' => '<string>',
'gatewaySigmaFactor' => 123
]
],
'subLevelInputConfig' => [
[
'paymentMethodType' => '<string>',
'paymentMethod' => '<string>',
'latencyThreshold' => 123,
'bucketSize' => 123,
'hedgingPercent' => 123,
'lowerResetFactor' => 123,
'upperResetFactor' => 123,
'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.birrpay.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload := strings.NewReader("{\n \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 123,\n \"defaultBucketSize\": 123,\n \"defaultHedgingPercent\": 123,\n \"defaultLowerResetFactor\": 123,\n \"defaultUpperResetFactor\": 123,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"latencyThreshold\": 123,\n \"bucketSize\": 123,\n \"hedgingPercent\": 123,\n \"lowerResetFactor\": 123,\n \"upperResetFactor\": 123,\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.birrpay.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\": 123,\n \"defaultBucketSize\": 123,\n \"defaultHedgingPercent\": 123,\n \"defaultLowerResetFactor\": 123,\n \"defaultUpperResetFactor\": 123,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"latencyThreshold\": 123,\n \"bucketSize\": 123,\n \"hedgingPercent\": 123,\n \"lowerResetFactor\": 123,\n \"upperResetFactor\": 123,\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.birrpay.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\": 123,\n \"defaultBucketSize\": 123,\n \"defaultHedgingPercent\": 123,\n \"defaultLowerResetFactor\": 123,\n \"defaultUpperResetFactor\": 123,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"latencyThreshold\": 123,\n \"bucketSize\": 123,\n \"hedgingPercent\": 123,\n \"lowerResetFactor\": 123,\n \"upperResetFactor\": 123,\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": "<string>",
"profile_id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": 123,
"modified_at": 123,
"decision_engine_routing_id": "<string>"
}Routing
Routing - Auth Rate Based
Create a success based dynamic routing algorithm
POST
/
account
/
{account_id}
/
business_profile
/
{profile_id}
/
dynamic_routing
/
success_based
/
create
Routing - Auth Rate Based
curl --request POST \
--url https://sandbox.birrpay.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": 123,
"defaultBucketSize": 123,
"defaultHedgingPercent": 123,
"defaultLowerResetFactor": 123,
"defaultUpperResetFactor": 123,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "<string>",
"paymentMethod": "<string>",
"latencyThreshold": 123,
"bucketSize": 123,
"hedgingPercent": 123,
"lowerResetFactor": 123,
"upperResetFactor": 123,
"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.birrpay.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload = {
"decision_engine_configs": {
"defaultLatencyThreshold": 123,
"defaultBucketSize": 123,
"defaultHedgingPercent": 123,
"defaultLowerResetFactor": 123,
"defaultUpperResetFactor": 123,
"defaultGatewayExtraScore": [
{
"gatewayName": "<string>",
"gatewaySigmaFactor": 123
}
],
"subLevelInputConfig": [
{
"paymentMethodType": "<string>",
"paymentMethod": "<string>",
"latencyThreshold": 123,
"bucketSize": 123,
"hedgingPercent": 123,
"lowerResetFactor": 123,
"upperResetFactor": 123,
"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: 123,
defaultBucketSize: 123,
defaultHedgingPercent: 123,
defaultLowerResetFactor: 123,
defaultUpperResetFactor: 123,
defaultGatewayExtraScore: [{gatewayName: '<string>', gatewaySigmaFactor: 123}],
subLevelInputConfig: [
{
paymentMethodType: '<string>',
paymentMethod: '<string>',
latencyThreshold: 123,
bucketSize: 123,
hedgingPercent: 123,
lowerResetFactor: 123,
upperResetFactor: 123,
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.birrpay.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.birrpay.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' => 123,
'defaultBucketSize' => 123,
'defaultHedgingPercent' => 123,
'defaultLowerResetFactor' => 123,
'defaultUpperResetFactor' => 123,
'defaultGatewayExtraScore' => [
[
'gatewayName' => '<string>',
'gatewaySigmaFactor' => 123
]
],
'subLevelInputConfig' => [
[
'paymentMethodType' => '<string>',
'paymentMethod' => '<string>',
'latencyThreshold' => 123,
'bucketSize' => 123,
'hedgingPercent' => 123,
'lowerResetFactor' => 123,
'upperResetFactor' => 123,
'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.birrpay.io/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create"
payload := strings.NewReader("{\n \"decision_engine_configs\": {\n \"defaultLatencyThreshold\": 123,\n \"defaultBucketSize\": 123,\n \"defaultHedgingPercent\": 123,\n \"defaultLowerResetFactor\": 123,\n \"defaultUpperResetFactor\": 123,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"latencyThreshold\": 123,\n \"bucketSize\": 123,\n \"hedgingPercent\": 123,\n \"lowerResetFactor\": 123,\n \"upperResetFactor\": 123,\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.birrpay.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\": 123,\n \"defaultBucketSize\": 123,\n \"defaultHedgingPercent\": 123,\n \"defaultLowerResetFactor\": 123,\n \"defaultUpperResetFactor\": 123,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"latencyThreshold\": 123,\n \"bucketSize\": 123,\n \"hedgingPercent\": 123,\n \"lowerResetFactor\": 123,\n \"upperResetFactor\": 123,\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.birrpay.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\": 123,\n \"defaultBucketSize\": 123,\n \"defaultHedgingPercent\": 123,\n \"defaultLowerResetFactor\": 123,\n \"defaultUpperResetFactor\": 123,\n \"defaultGatewayExtraScore\": [\n {\n \"gatewayName\": \"<string>\",\n \"gatewaySigmaFactor\": 123\n }\n ],\n \"subLevelInputConfig\": [\n {\n \"paymentMethodType\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"latencyThreshold\": 123,\n \"bucketSize\": 123,\n \"hedgingPercent\": 123,\n \"lowerResetFactor\": 123,\n \"upperResetFactor\": 123,\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": "<string>",
"profile_id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": 123,
"modified_at": 123,
"decision_engine_routing_id": "<string>"
}Authorizations
api_keyjwt_key
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
Available options:
metrics, dynamic_connector_selection, none Body
application/json
Response
Routing Algorithm created
Available options:
single, priority, volume_split, advanced, dynamic, three_ds_decision_rule Available options:
payment, payout, three_ds_authentication ⌘I