Update a routing rule
curl --request PATCH \
--url http://localhost:8081/v1/routing-ab-tests/{id}/comparison \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--header 'X-Reevit-Key: <api-key>' \
--data '
{
"name": "<string>",
"countries": [
"<string>"
],
"methods": [
"<string>"
],
"connection_id": "<string>",
"priority": 123,
"fallback_to_default": true,
"enabled": true
}
'import requests
url = "http://localhost:8081/v1/routing-ab-tests/{id}/comparison"
payload = {
"name": "<string>",
"countries": ["<string>"],
"methods": ["<string>"],
"connection_id": "<string>",
"priority": 123,
"fallback_to_default": True,
"enabled": True
}
headers = {
"X-Org-Id": "<x-org-id>",
"X-Reevit-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Org-Id': '<x-org-id>',
'X-Reevit-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
countries: ['<string>'],
methods: ['<string>'],
connection_id: '<string>',
priority: 123,
fallback_to_default: true,
enabled: true
})
};
fetch('http://localhost:8081/v1/routing-ab-tests/{id}/comparison', 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 => "8081",
CURLOPT_URL => "http://localhost:8081/v1/routing-ab-tests/{id}/comparison",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'countries' => [
'<string>'
],
'methods' => [
'<string>'
],
'connection_id' => '<string>',
'priority' => 123,
'fallback_to_default' => true,
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Org-Id: <x-org-id>",
"X-Reevit-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 := "http://localhost:8081/v1/routing-ab-tests/{id}/comparison"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"methods\": [\n \"<string>\"\n ],\n \"connection_id\": \"<string>\",\n \"priority\": 123,\n \"fallback_to_default\": true,\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Org-Id", "<x-org-id>")
req.Header.Add("X-Reevit-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.patch("http://localhost:8081/v1/routing-ab-tests/{id}/comparison")
.header("X-Org-Id", "<x-org-id>")
.header("X-Reevit-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"methods\": [\n \"<string>\"\n ],\n \"connection_id\": \"<string>\",\n \"priority\": 123,\n \"fallback_to_default\": true,\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8081/v1/routing-ab-tests/{id}/comparison")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["X-Org-Id"] = '<x-org-id>'
request["X-Reevit-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"methods\": [\n \"<string>\"\n ],\n \"connection_id\": \"<string>\",\n \"priority\": 123,\n \"fallback_to_default\": true,\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"countries": [
"<string>"
],
"methods": [
"<string>"
],
"connection_id": "<string>",
"priority": 123,
"fallback_to_default": true,
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}Routing Rules
Update a routing rule
PATCH
/
v1
/
routing-ab-tests
/
{id}
/
comparison
Update a routing rule
curl --request PATCH \
--url http://localhost:8081/v1/routing-ab-tests/{id}/comparison \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--header 'X-Reevit-Key: <api-key>' \
--data '
{
"name": "<string>",
"countries": [
"<string>"
],
"methods": [
"<string>"
],
"connection_id": "<string>",
"priority": 123,
"fallback_to_default": true,
"enabled": true
}
'import requests
url = "http://localhost:8081/v1/routing-ab-tests/{id}/comparison"
payload = {
"name": "<string>",
"countries": ["<string>"],
"methods": ["<string>"],
"connection_id": "<string>",
"priority": 123,
"fallback_to_default": True,
"enabled": True
}
headers = {
"X-Org-Id": "<x-org-id>",
"X-Reevit-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Org-Id': '<x-org-id>',
'X-Reevit-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
countries: ['<string>'],
methods: ['<string>'],
connection_id: '<string>',
priority: 123,
fallback_to_default: true,
enabled: true
})
};
fetch('http://localhost:8081/v1/routing-ab-tests/{id}/comparison', 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 => "8081",
CURLOPT_URL => "http://localhost:8081/v1/routing-ab-tests/{id}/comparison",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'countries' => [
'<string>'
],
'methods' => [
'<string>'
],
'connection_id' => '<string>',
'priority' => 123,
'fallback_to_default' => true,
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Org-Id: <x-org-id>",
"X-Reevit-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 := "http://localhost:8081/v1/routing-ab-tests/{id}/comparison"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"methods\": [\n \"<string>\"\n ],\n \"connection_id\": \"<string>\",\n \"priority\": 123,\n \"fallback_to_default\": true,\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Org-Id", "<x-org-id>")
req.Header.Add("X-Reevit-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.patch("http://localhost:8081/v1/routing-ab-tests/{id}/comparison")
.header("X-Org-Id", "<x-org-id>")
.header("X-Reevit-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"methods\": [\n \"<string>\"\n ],\n \"connection_id\": \"<string>\",\n \"priority\": 123,\n \"fallback_to_default\": true,\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8081/v1/routing-ab-tests/{id}/comparison")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["X-Org-Id"] = '<x-org-id>'
request["X-Reevit-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"methods\": [\n \"<string>\"\n ],\n \"connection_id\": \"<string>\",\n \"priority\": 123,\n \"fallback_to_default\": true,\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"countries": [
"<string>"
],
"methods": [
"<string>"
],
"connection_id": "<string>",
"priority": 123,
"fallback_to_default": true,
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}Authorizations
API key for server-to-server authentication
Headers
Organization identifier for multi-tenancy
Path Parameters
Body
application/json
Response
OK
A routing rule that explicitly routes payments from specific countries/methods to a specific connection. Rules are evaluated by priority (highest first). If no rule matches, default routing logic is used.
Human-readable name for the rule
ISO 3166-1 alpha-2 country codes (e.g., US, GB, GH)
Payment methods (e.g., card, mobile_money). Empty means all methods.
The connection to use when this rule matches
Higher priority rules are evaluated first
If true, fall back to default routing if the connection is unavailable

