Skip to main content
POST
/
euclid.EuclidService
/
Create
Create a routing Rule
curl --request POST \
  --url https://api.example.com/euclid.EuclidService/Create \
  --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 '
{
  "name": "Test Routing Rule",
  "algorithm": {
    "globals": {},
    "default_selection": {
      "priority": {
        "connectors": [
          "stripe",
          "adyen",
          "checkout"
        ]
      }
    },
    "rules": [
      {
        "name": "Card Rule",
        "routing_type": "priority",
        "output": {
          "priority": {
            "connectors": [
              "stripe",
              "adyen"
            ]
          }
        },
        "statements": [
          {
            "condition": [
              {
                "lhs": "payment_method",
                "comparison": "equal",
                "value": {
                  "enum_variant": "card"
                },
                "metadata": {}
              },
              {
                "lhs": "amount",
                "comparison": "greater_than",
                "value": {
                  "number": 1000
                },
                "metadata": {}
              }
            ]
          }
        ]
      }
    ],
    "metadata": {}
  }
}
'
{
  "algorithm_id": "routing_ec1ac351-7944-440f-bdc7-6a500df1116f",
  "name": "Test Routing Rule",
  "created_at": "2025-04-09 8:03:44.85588",
  "modified_at": "2025-04-09 8:03:44.85588"
}

Headers

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

Body

application/json
name
string
Example:

"Test Routing Rule"

algorithm
object
Example:
{
"globals": {},
"default_selection": {
"priority": { "connectors": ["stripe", "checkout"] }
},
"rules": [
{
"name": "High Amount Card",
"routing_type": "priority",
"output": { "priority": { "connectors": ["adyen"] } },
"statements": [
{
"condition": [
{
"lhs": "payment_method",
"comparison": "equal",
"value": "card",
"metadata": {}
},
{
"lhs": "amount",
"comparison": "greater_than",
"value": 1000,
"metadata": {}
}
]
}
]
}
],
"metadata": {}
}

Response

Successful creation

algorithm_id
string

Algorithm Id for the routing rule

Example:

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

name
string

name of the routing rule

Example:

"test routing rule"

created_at
string

Timestamp for creation of routing rule

Example:

"2025-04-09 8:03:44.85588"

modified_at
string

Timestamp for modification of routing rule

Example:

"2025-04-09 8:03:44.85588"