Skip to main content
POST
/
euclid.EuclidService
/
Evaluate
Evaluate an existing routing Rule
curl --request POST \
  --url https://api.example.com/euclid.EuclidService/Evaluate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-profile-id: <x-profile-id>' \
  --header 'x-tenant-id: <x-tenant-id>' \
  --data '
{
  "algorithm_id": "routing_ec1ac351-7944-440f-bdc7-6a500df1116f",
  "parameters": {
    "payment_method": {
      "type": "enum_variant",
      "value": "card"
    },
    "amount": {
      "type": "number",
      "value": 2000
    }
  }
}
'
import requests

url = "https://api.example.com/euclid.EuclidService/Evaluate"

payload = {
"algorithm_id": "routing_ec1ac351-7944-440f-bdc7-6a500df1116f",
"parameters": {
"payment_method": {
"type": "enum_variant",
"value": "card"
},
"amount": {
"type": "number",
"value": 2000
}
}
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"x-profile-id": "<x-profile-id>",
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
'x-profile-id': '<x-profile-id>',
'x-api-key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
algorithm_id: 'routing_ec1ac351-7944-440f-bdc7-6a500df1116f',
parameters: {
payment_method: {type: 'enum_variant', value: 'card'},
amount: {type: 'number', value: 2000}
}
})
};

fetch('https://api.example.com/euclid.EuclidService/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://api.example.com/euclid.EuclidService/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([
'algorithm_id' => 'routing_ec1ac351-7944-440f-bdc7-6a500df1116f',
'parameters' => [
'payment_method' => [
'type' => 'enum_variant',
'value' => 'card'
],
'amount' => [
'type' => 'number',
'value' => 2000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-profile-id: <x-profile-id>",
"x-tenant-id: <x-tenant-id>"
],
]);

$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://api.example.com/euclid.EuclidService/Evaluate"

payload := strings.NewReader("{\n \"algorithm_id\": \"routing_ec1ac351-7944-440f-bdc7-6a500df1116f\",\n \"parameters\": {\n \"payment_method\": {\n \"type\": \"enum_variant\",\n \"value\": \"card\"\n },\n \"amount\": {\n \"type\": \"number\",\n \"value\": 2000\n }\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("x-profile-id", "<x-profile-id>")
req.Header.Add("x-api-key", "<x-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://api.example.com/euclid.EuclidService/Evaluate")
.header("x-tenant-id", "<x-tenant-id>")
.header("x-profile-id", "<x-profile-id>")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"algorithm_id\": \"routing_ec1ac351-7944-440f-bdc7-6a500df1116f\",\n \"parameters\": {\n \"payment_method\": {\n \"type\": \"enum_variant\",\n \"value\": \"card\"\n },\n \"amount\": {\n \"type\": \"number\",\n \"value\": 2000\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/euclid.EuclidService/Evaluate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["x-profile-id"] = '<x-profile-id>'
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"algorithm_id\": \"routing_ec1ac351-7944-440f-bdc7-6a500df1116f\",\n \"parameters\": {\n \"payment_method\": {\n \"type\": \"enum_variant\",\n \"value\": \"card\"\n },\n \"amount\": {\n \"type\": \"number\",\n \"value\": 2000\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "output": {
    "priority": {
      "connectors": [
        "stripe",
        "adyen"
      ]
    }
  },
  "evaluated_output": [
    "stripe"
  ],
  "eligible_connectors": []
}

Headers

x-tenant-id
string
required
x-profile-id
string
required
x-api-key
string
required

Body

application/json
algorithm_id
string
Example:

"routing_ec1ac351-7944-440f-bdc7-6a500df1116f"

parameters
object
Example:
{
"payment_method": { "type": "enum_variant", "value": "card" },
"amount": { "type": "number", "value": 1500 }
}

Response

Evaluation result

status
string
output
object
Example:
{ "connectors": ["stripe", "adyen"] }
evaluated_output
string[]
eligible_connectors
string[]