Create a routing A/B test
curl --request POST \
--url http://localhost:8081/v1/routing-ab-tests \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--header 'X-Reevit-Key: <api-key>' \
--data '
{
"name": "<string>",
"variants": [
{
"name": "<string>",
"routing_rule_id": "<string>",
"weight": 123
}
],
"description": "<string>",
"traffic_percentage": 123,
"target_currencies": [
"<string>"
],
"target_countries": [
"<string>"
],
"target_methods": [
"<string>"
],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost:8081/v1/routing-ab-tests"
payload = {
"name": "<string>",
"variants": [
{
"name": "<string>",
"routing_rule_id": "<string>",
"weight": 123
}
],
"description": "<string>",
"traffic_percentage": 123,
"target_currencies": ["<string>"],
"target_countries": ["<string>"],
"target_methods": ["<string>"],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-Org-Id": "<x-org-id>",
"X-Reevit-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Org-Id': '<x-org-id>',
'X-Reevit-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
variants: [{name: '<string>', routing_rule_id: '<string>', weight: 123}],
description: '<string>',
traffic_percentage: 123,
target_currencies: ['<string>'],
target_countries: ['<string>'],
target_methods: ['<string>'],
start_at: '2023-11-07T05:31:56Z',
end_at: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost:8081/v1/routing-ab-tests', 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",
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([
'name' => '<string>',
'variants' => [
[
'name' => '<string>',
'routing_rule_id' => '<string>',
'weight' => 123
]
],
'description' => '<string>',
'traffic_percentage' => 123,
'target_currencies' => [
'<string>'
],
'target_countries' => [
'<string>'
],
'target_methods' => [
'<string>'
],
'start_at' => '2023-11-07T05:31:56Z',
'end_at' => '2023-11-07T05:31:56Z'
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"routing_rule_id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"description\": \"<string>\",\n \"traffic_percentage\": 123,\n \"target_currencies\": [\n \"<string>\"\n ],\n \"target_countries\": [\n \"<string>\"\n ],\n \"target_methods\": [\n \"<string>\"\n ],\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost:8081/v1/routing-ab-tests")
.header("X-Org-Id", "<x-org-id>")
.header("X-Reevit-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"routing_rule_id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"description\": \"<string>\",\n \"traffic_percentage\": 123,\n \"target_currencies\": [\n \"<string>\"\n ],\n \"target_countries\": [\n \"<string>\"\n ],\n \"target_methods\": [\n \"<string>\"\n ],\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8081/v1/routing-ab-tests")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.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 \"variants\": [\n {\n \"name\": \"<string>\",\n \"routing_rule_id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"description\": \"<string>\",\n \"traffic_percentage\": 123,\n \"target_currencies\": [\n \"<string>\"\n ],\n \"target_countries\": [\n \"<string>\"\n ],\n \"target_methods\": [\n \"<string>\"\n ],\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"mode": "<string>",
"name": "<string>",
"description": "<string>",
"status": "draft",
"variants": [
{
"name": "<string>",
"routing_rule_id": "<string>",
"weight": 123
}
],
"traffic_percentage": 123,
"target_currencies": [
"<string>"
],
"target_countries": [
"<string>"
],
"target_methods": [
"<string>"
],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"total_transactions": 123,
"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"
}
}Routing
Create a routing A/B test
POST
/
v1
/
routing-ab-tests
Create a routing A/B test
curl --request POST \
--url http://localhost:8081/v1/routing-ab-tests \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--header 'X-Reevit-Key: <api-key>' \
--data '
{
"name": "<string>",
"variants": [
{
"name": "<string>",
"routing_rule_id": "<string>",
"weight": 123
}
],
"description": "<string>",
"traffic_percentage": 123,
"target_currencies": [
"<string>"
],
"target_countries": [
"<string>"
],
"target_methods": [
"<string>"
],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://localhost:8081/v1/routing-ab-tests"
payload = {
"name": "<string>",
"variants": [
{
"name": "<string>",
"routing_rule_id": "<string>",
"weight": 123
}
],
"description": "<string>",
"traffic_percentage": 123,
"target_currencies": ["<string>"],
"target_countries": ["<string>"],
"target_methods": ["<string>"],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-Org-Id": "<x-org-id>",
"X-Reevit-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Org-Id': '<x-org-id>',
'X-Reevit-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
variants: [{name: '<string>', routing_rule_id: '<string>', weight: 123}],
description: '<string>',
traffic_percentage: 123,
target_currencies: ['<string>'],
target_countries: ['<string>'],
target_methods: ['<string>'],
start_at: '2023-11-07T05:31:56Z',
end_at: '2023-11-07T05:31:56Z'
})
};
fetch('http://localhost:8081/v1/routing-ab-tests', 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",
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([
'name' => '<string>',
'variants' => [
[
'name' => '<string>',
'routing_rule_id' => '<string>',
'weight' => 123
]
],
'description' => '<string>',
'traffic_percentage' => 123,
'target_currencies' => [
'<string>'
],
'target_countries' => [
'<string>'
],
'target_methods' => [
'<string>'
],
'start_at' => '2023-11-07T05:31:56Z',
'end_at' => '2023-11-07T05:31:56Z'
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"routing_rule_id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"description\": \"<string>\",\n \"traffic_percentage\": 123,\n \"target_currencies\": [\n \"<string>\"\n ],\n \"target_countries\": [\n \"<string>\"\n ],\n \"target_methods\": [\n \"<string>\"\n ],\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost:8081/v1/routing-ab-tests")
.header("X-Org-Id", "<x-org-id>")
.header("X-Reevit-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"routing_rule_id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"description\": \"<string>\",\n \"traffic_percentage\": 123,\n \"target_currencies\": [\n \"<string>\"\n ],\n \"target_countries\": [\n \"<string>\"\n ],\n \"target_methods\": [\n \"<string>\"\n ],\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8081/v1/routing-ab-tests")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.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 \"variants\": [\n {\n \"name\": \"<string>\",\n \"routing_rule_id\": \"<string>\",\n \"weight\": 123\n }\n ],\n \"description\": \"<string>\",\n \"traffic_percentage\": 123,\n \"target_currencies\": [\n \"<string>\"\n ],\n \"target_countries\": [\n \"<string>\"\n ],\n \"target_methods\": [\n \"<string>\"\n ],\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"mode": "<string>",
"name": "<string>",
"description": "<string>",
"status": "draft",
"variants": [
{
"name": "<string>",
"routing_rule_id": "<string>",
"weight": 123
}
],
"traffic_percentage": 123,
"target_currencies": [
"<string>"
],
"target_countries": [
"<string>"
],
"target_methods": [
"<string>"
],
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"total_transactions": 123,
"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"
}
}Authorizations
API key for server-to-server authentication
Headers
Organization identifier for multi-tenancy
Idempotency key for safe retries
Body
application/json
Response
Created
Available options:
draft, running, paused, completed Show child attributes
Show child attributes

