Evaluate routing rule
curl --request POST \
--url http://localhost:8080/routing/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"created_by": "test_merchant",
"parameters": {
"currency": {
"type": "str_value",
"value": "USD"
}
},
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
}
'import requests
url = "http://localhost:8080/routing/evaluate"
payload = {
"created_by": "test_merchant",
"parameters": { "currency": {
"type": "str_value",
"value": "USD"
} },
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
}
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({
created_by: 'test_merchant',
parameters: {currency: {type: 'str_value', value: 'USD'}},
payment_id: '<string>',
fallback_output: [{gateway_name: '<string>', gateway_id: '<string>'}]
})
};
fetch('http://localhost:8080/routing/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/routing/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' => 'test_merchant',
'parameters' => [
'currency' => [
'type' => 'str_value',
'value' => 'USD'
]
],
'payment_id' => '<string>',
'fallback_output' => [
[
'gateway_name' => '<string>',
'gateway_id' => '<string>'
]
]
]),
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/evaluate"
payload := strings.NewReader("{\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}")
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/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/routing/evaluate")
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 \"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}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"status": "<string>",
"output": {},
"evaluated_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
],
"eligible_connectors": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
}OpenAPI: Routing Rules
Evaluate Routing Rule
Evaluate the active routing rule for a merchant against a payment context. Returns the ordered list of gateways selected by the rule without consuming SR data.
POST
/
routing
/
evaluate
Evaluate routing rule
curl --request POST \
--url http://localhost:8080/routing/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"created_by": "test_merchant",
"parameters": {
"currency": {
"type": "str_value",
"value": "USD"
}
},
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
}
'import requests
url = "http://localhost:8080/routing/evaluate"
payload = {
"created_by": "test_merchant",
"parameters": { "currency": {
"type": "str_value",
"value": "USD"
} },
"payment_id": "<string>",
"fallback_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
}
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({
created_by: 'test_merchant',
parameters: {currency: {type: 'str_value', value: 'USD'}},
payment_id: '<string>',
fallback_output: [{gateway_name: '<string>', gateway_id: '<string>'}]
})
};
fetch('http://localhost:8080/routing/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/routing/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' => 'test_merchant',
'parameters' => [
'currency' => [
'type' => 'str_value',
'value' => 'USD'
]
],
'payment_id' => '<string>',
'fallback_output' => [
[
'gateway_name' => '<string>',
'gateway_id' => '<string>'
]
]
]),
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/evaluate"
payload := strings.NewReader("{\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}")
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/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/routing/evaluate")
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 \"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}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"status": "<string>",
"output": {},
"evaluated_output": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
],
"eligible_connectors": [
{
"gateway_name": "<string>",
"gateway_id": "<string>"
}
]
}Authorizations
BearerAuthApiKeyAuth
JWT token obtained from /auth/login
Body
application/json
Request body for POST /routing/evaluate (src/euclid/types.rs::RoutingRequest). No camelCase rename — snake_case field names.
Example:
"test_merchant"
Map of DSL parameter name (e.g. currency, amount, cardType) to its ValueType.
Show child attributes
Show child attributes
Example:
{
"currency": { "type": "str_value", "value": "USD" }
}
Used when the rule evaluation yields no eligible connector.
Show child attributes
Show child attributes
Was this page helpful?
⌘I