curl --request POST \
--url https://sandbox.birrpay.io/routing/rule/evaluate \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"created_by": "<string>",
"parameters": {},
"fallback_output": [
{
"gateway_id": "<string>"
}
]
}
'import requests
url = "https://sandbox.birrpay.io/routing/rule/evaluate"
payload = {
"created_by": "<string>",
"parameters": {},
"fallback_output": [{ "gateway_id": "<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({
created_by: '<string>',
parameters: {},
fallback_output: [{gateway_id: '<string>'}]
})
};
fetch('https://sandbox.birrpay.io/routing/rule/evaluate', 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/routing/rule/evaluate",
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([
'created_by' => '<string>',
'parameters' => [
],
'fallback_output' => [
[
'gateway_id' => '<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.birrpay.io/routing/rule/evaluate"
payload := strings.NewReader("{\n \"created_by\": \"<string>\",\n \"parameters\": {},\n \"fallback_output\": [\n {\n \"gateway_id\": \"<string>\"\n }\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/routing/rule/evaluate")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"created_by\": \"<string>\",\n \"parameters\": {},\n \"fallback_output\": [\n {\n \"gateway_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.birrpay.io/routing/rule/evaluate")
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 \"created_by\": \"<string>\",\n \"parameters\": {},\n \"fallback_output\": [\n {\n \"gateway_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"output": "<unknown>",
"evaluated_output": [
{
"connector": "authipay",
"merchant_connector_id": "<string>"
}
],
"eligible_connectors": [
{
"connector": "authipay",
"merchant_connector_id": "<string>"
}
]
}Routing - Rule Evaluate
Evaluate routing rules
curl --request POST \
--url https://sandbox.birrpay.io/routing/rule/evaluate \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"created_by": "<string>",
"parameters": {},
"fallback_output": [
{
"gateway_id": "<string>"
}
]
}
'import requests
url = "https://sandbox.birrpay.io/routing/rule/evaluate"
payload = {
"created_by": "<string>",
"parameters": {},
"fallback_output": [{ "gateway_id": "<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({
created_by: '<string>',
parameters: {},
fallback_output: [{gateway_id: '<string>'}]
})
};
fetch('https://sandbox.birrpay.io/routing/rule/evaluate', 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/routing/rule/evaluate",
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([
'created_by' => '<string>',
'parameters' => [
],
'fallback_output' => [
[
'gateway_id' => '<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.birrpay.io/routing/rule/evaluate"
payload := strings.NewReader("{\n \"created_by\": \"<string>\",\n \"parameters\": {},\n \"fallback_output\": [\n {\n \"gateway_id\": \"<string>\"\n }\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/routing/rule/evaluate")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"created_by\": \"<string>\",\n \"parameters\": {},\n \"fallback_output\": [\n {\n \"gateway_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.birrpay.io/routing/rule/evaluate")
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 \"created_by\": \"<string>\",\n \"parameters\": {},\n \"fallback_output\": [\n {\n \"gateway_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"output": "<unknown>",
"evaluated_output": [
{
"connector": "authipay",
"merchant_connector_id": "<string>"
}
],
"eligible_connectors": [
{
"connector": "authipay",
"merchant_connector_id": "<string>"
}
]
}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.
Body
Parameters that can be used in the routing evaluate request. eg: {"parameters": { "payment_method": {"type": "enum_variant", "value": "card"}, "payment_method_type": {"type": "enum_variant", "value": "credit"}, "amount": {"type": "number", "value": 10}, "currency": {"type": "str_value", "value": "INR"}, "authentication_type": {"type": "enum_variant", "value": "three_ds"}, "card_bin": {"type": "str_value", "value": "424242"}, "capture_method": {"type": "enum_variant", "value": "scheduled"}, "business_country": {"type": "str_value", "value": "IN"}, "billing_country": {"type": "str_value", "value": "IN"}, "business_label": {"type": "str_value", "value": "business_label"}, "setup_future_usage": {"type": "enum_variant", "value": "off_session"}, "card_network": {"type": "enum_variant", "value": "visa"}, "payment_type": {"type": "enum_variant", "value": "recurring_mandate"}, "mandate_type": {"type": "enum_variant", "value": "single_use"}, "mandate_acceptance_type": {"type": "enum_variant", "value": "online"}, "metadata":{"type": "metadata_variant", "value": {"key": "key1", "value": "value1"}} }}
Show child attributes
Show child attributes