Simulate decision
curl --request POST \
--url https://api.example.com/api/projects/{projectId}/decisions/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"published": true,
"releaseId": "<string>",
"context": {
"cart": {
"total": 1500
},
"customer": {
"country": "US",
"tier": "gold"
}
},
"graph": {
"edges": [
{
"id": "1dfbc57d-ad1f-4cf8-978a-e43241856fc8",
"type": "edge",
"sourceId": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"targetId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9"
},
{
"id": "5e2dc187-3b82-4f21-94f5-9c3fd16e12d4",
"type": "edge",
"sourceId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"targetId": "72d52cfc-e866-4c11-bf79-6be9f750e4d7"
}
],
"nodes": [
{
"id": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"name": "Request",
"type": "inputNode",
"position": {
"x": 180,
"y": 280
}
},
{
"id": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"name": "Fees",
"type": "decisionTableNode",
"content": {
"rules": [
{
"_id": "vCqrZGdWjA",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "2",
"jrsT5Wg9F8": "\"gold\"",
"qA7iYc3Wle": ""
},
{
"_id": "CpXx-s78FH",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "3",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "zH-PuRB2aQ",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "25"
},
{
"_id": "HjEp-eQhAP",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "5",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "nq40hJ1nXy",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "50"
},
{
"_id": "G64ltgrVgV",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "10",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "PD3oYgtiDa",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "100"
},
{
"_id": "1BY7iMFoDw",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "15",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "dlwJlbW7ZH",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "150"
}
],
"inputs": [
{
"id": "FD4qBBPv2G",
"name": "Cart Total",
"type": "expression",
"field": "cart.total"
},
{
"id": "DA3Ybo-shA",
"name": "Customer Country",
"type": "expression",
"field": "customer.country"
},
{
"id": "jrsT5Wg9F8",
"name": "Customer Tier",
"type": "expression",
"field": "customer.tier"
}
],
"outputs": [
{
"id": "qA7iYc3Wle",
"name": "Fees Flat ($)",
"type": "expression",
"field": "fees.flat"
},
{
"id": "JuUcECFGe1",
"name": "Fees Percent",
"type": "expression",
"field": "fees.percent"
}
],
"hitPolicy": "first"
},
"position": {
"x": 420,
"y": 280
}
},
{
"id": "72d52cfc-e866-4c11-bf79-6be9f750e4d7",
"name": "Response",
"type": "outputNode",
"position": {
"x": 670,
"y": 280
}
}
]
}
}
'import requests
url = "https://api.example.com/api/projects/{projectId}/decisions/simulate"
payload = {
"published": True,
"releaseId": "<string>",
"context": {
"cart": { "total": 1500 },
"customer": {
"country": "US",
"tier": "gold"
}
},
"graph": {
"edges": [
{
"id": "1dfbc57d-ad1f-4cf8-978a-e43241856fc8",
"type": "edge",
"sourceId": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"targetId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9"
},
{
"id": "5e2dc187-3b82-4f21-94f5-9c3fd16e12d4",
"type": "edge",
"sourceId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"targetId": "72d52cfc-e866-4c11-bf79-6be9f750e4d7"
}
],
"nodes": [
{
"id": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"name": "Request",
"type": "inputNode",
"position": {
"x": 180,
"y": 280
}
},
{
"id": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"name": "Fees",
"type": "decisionTableNode",
"content": {
"rules": [
{
"_id": "vCqrZGdWjA",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "2",
"jrsT5Wg9F8": "\"gold\"",
"qA7iYc3Wle": ""
},
{
"_id": "CpXx-s78FH",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "3",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "zH-PuRB2aQ",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "25"
},
{
"_id": "HjEp-eQhAP",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "5",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "nq40hJ1nXy",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "50"
},
{
"_id": "G64ltgrVgV",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "10",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "PD3oYgtiDa",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "100"
},
{
"_id": "1BY7iMFoDw",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "15",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "dlwJlbW7ZH",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "150"
}
],
"inputs": [
{
"id": "FD4qBBPv2G",
"name": "Cart Total",
"type": "expression",
"field": "cart.total"
},
{
"id": "DA3Ybo-shA",
"name": "Customer Country",
"type": "expression",
"field": "customer.country"
},
{
"id": "jrsT5Wg9F8",
"name": "Customer Tier",
"type": "expression",
"field": "customer.tier"
}
],
"outputs": [
{
"id": "qA7iYc3Wle",
"name": "Fees Flat ($)",
"type": "expression",
"field": "fees.flat"
},
{
"id": "JuUcECFGe1",
"name": "Fees Percent",
"type": "expression",
"field": "fees.percent"
}
],
"hitPolicy": "first"
},
"position": {
"x": 420,
"y": 280
}
},
{
"id": "72d52cfc-e866-4c11-bf79-6be9f750e4d7",
"name": "Response",
"type": "outputNode",
"position": {
"x": 670,
"y": 280
}
}
]
}
}
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({
published: true,
releaseId: '<string>',
context: {cart: {total: 1500}, customer: {country: 'US', tier: 'gold'}},
graph: {
edges: [
{
id: '1dfbc57d-ad1f-4cf8-978a-e43241856fc8',
type: 'edge',
sourceId: 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
targetId: '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9'
},
{
id: '5e2dc187-3b82-4f21-94f5-9c3fd16e12d4',
type: 'edge',
sourceId: '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
targetId: '72d52cfc-e866-4c11-bf79-6be9f750e4d7'
}
],
nodes: [
{
id: 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
name: 'Request',
type: 'inputNode',
position: {x: 180, y: 280}
},
{
id: '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
name: 'Fees',
type: 'decisionTableNode',
content: {
rules: [
{
_id: 'vCqrZGdWjA',
'DA3Ybo-shA': '"US"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '2',
jrsT5Wg9F8: '"gold"',
qA7iYc3Wle: ''
},
{
_id: 'CpXx-s78FH',
'DA3Ybo-shA': '"US"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '3',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'zH-PuRB2aQ',
'DA3Ybo-shA': '"US"',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '25'
},
{
_id: 'HjEp-eQhAP',
'DA3Ybo-shA': '"CA","MX"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '5',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'nq40hJ1nXy',
'DA3Ybo-shA': '"CA","MX"',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '50'
},
{
_id: 'G64ltgrVgV',
'DA3Ybo-shA': '"IE","UK","FR","DE"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '10',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'PD3oYgtiDa',
'DA3Ybo-shA': '"IE","UK","FR","DE"',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '100'
},
{
_id: '1BY7iMFoDw',
'DA3Ybo-shA': '',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '15',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'dlwJlbW7ZH',
'DA3Ybo-shA': '',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '150'
}
],
inputs: [
{id: 'FD4qBBPv2G', name: 'Cart Total', type: 'expression', field: 'cart.total'},
{
id: 'DA3Ybo-shA',
name: 'Customer Country',
type: 'expression',
field: 'customer.country'
},
{
id: 'jrsT5Wg9F8',
name: 'Customer Tier',
type: 'expression',
field: 'customer.tier'
}
],
outputs: [
{
id: 'qA7iYc3Wle',
name: 'Fees Flat ($)',
type: 'expression',
field: 'fees.flat'
},
{
id: 'JuUcECFGe1',
name: 'Fees Percent',
type: 'expression',
field: 'fees.percent'
}
],
hitPolicy: 'first'
},
position: {x: 420, y: 280}
},
{
id: '72d52cfc-e866-4c11-bf79-6be9f750e4d7',
name: 'Response',
type: 'outputNode',
position: {x: 670, y: 280}
}
]
}
})
};
fetch('https://api.example.com/api/projects/{projectId}/decisions/simulate', 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/api/projects/{projectId}/decisions/simulate",
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([
'published' => true,
'releaseId' => '<string>',
'context' => [
'cart' => [
'total' => 1500
],
'customer' => [
'country' => 'US',
'tier' => 'gold'
]
],
'graph' => [
'edges' => [
[
'id' => '1dfbc57d-ad1f-4cf8-978a-e43241856fc8',
'type' => 'edge',
'sourceId' => 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
'targetId' => '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9'
],
[
'id' => '5e2dc187-3b82-4f21-94f5-9c3fd16e12d4',
'type' => 'edge',
'sourceId' => '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
'targetId' => '72d52cfc-e866-4c11-bf79-6be9f750e4d7'
]
],
'nodes' => [
[
'id' => 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
'name' => 'Request',
'type' => 'inputNode',
'position' => [
'x' => 180,
'y' => 280
]
],
[
'id' => '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
'name' => 'Fees',
'type' => 'decisionTableNode',
'content' => [
'rules' => [
[
'_id' => 'vCqrZGdWjA',
'DA3Ybo-shA' => '"US"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '2',
'jrsT5Wg9F8' => '"gold"',
'qA7iYc3Wle' => ''
],
[
'_id' => 'CpXx-s78FH',
'DA3Ybo-shA' => '"US"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '3',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'zH-PuRB2aQ',
'DA3Ybo-shA' => '"US"',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '25'
],
[
'_id' => 'HjEp-eQhAP',
'DA3Ybo-shA' => '"CA","MX"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '5',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'nq40hJ1nXy',
'DA3Ybo-shA' => '"CA","MX"',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '50'
],
[
'_id' => 'G64ltgrVgV',
'DA3Ybo-shA' => '"IE","UK","FR","DE"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '10',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'PD3oYgtiDa',
'DA3Ybo-shA' => '"IE","UK","FR","DE"',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '100'
],
[
'_id' => '1BY7iMFoDw',
'DA3Ybo-shA' => '',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '15',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'dlwJlbW7ZH',
'DA3Ybo-shA' => '',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '150'
]
],
'inputs' => [
[
'id' => 'FD4qBBPv2G',
'name' => 'Cart Total',
'type' => 'expression',
'field' => 'cart.total'
],
[
'id' => 'DA3Ybo-shA',
'name' => 'Customer Country',
'type' => 'expression',
'field' => 'customer.country'
],
[
'id' => 'jrsT5Wg9F8',
'name' => 'Customer Tier',
'type' => 'expression',
'field' => 'customer.tier'
]
],
'outputs' => [
[
'id' => 'qA7iYc3Wle',
'name' => 'Fees Flat ($)',
'type' => 'expression',
'field' => 'fees.flat'
],
[
'id' => 'JuUcECFGe1',
'name' => 'Fees Percent',
'type' => 'expression',
'field' => 'fees.percent'
]
],
'hitPolicy' => 'first'
],
'position' => [
'x' => 420,
'y' => 280
]
],
[
'id' => '72d52cfc-e866-4c11-bf79-6be9f750e4d7',
'name' => 'Response',
'type' => 'outputNode',
'position' => [
'x' => 670,
'y' => 280
]
]
]
]
]),
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 := "https://api.example.com/api/projects/{projectId}/decisions/simulate"
payload := strings.NewReader("{\n \"published\": true,\n \"releaseId\": \"<string>\",\n \"context\": {\n \"cart\": {\n \"total\": 1500\n },\n \"customer\": {\n \"country\": \"US\",\n \"tier\": \"gold\"\n }\n },\n \"graph\": {\n \"edges\": [\n {\n \"id\": \"1dfbc57d-ad1f-4cf8-978a-e43241856fc8\",\n \"type\": \"edge\",\n \"sourceId\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"targetId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\"\n },\n {\n \"id\": \"5e2dc187-3b82-4f21-94f5-9c3fd16e12d4\",\n \"type\": \"edge\",\n \"sourceId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"targetId\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"name\": \"Request\",\n \"type\": \"inputNode\",\n \"position\": {\n \"x\": 180,\n \"y\": 280\n }\n },\n {\n \"id\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"name\": \"Fees\",\n \"type\": \"decisionTableNode\",\n \"content\": {\n \"rules\": [\n {\n \"_id\": \"vCqrZGdWjA\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"2\",\n \"jrsT5Wg9F8\": \"\\\"gold\\\"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"CpXx-s78FH\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"3\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"zH-PuRB2aQ\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"25\"\n },\n {\n \"_id\": \"HjEp-eQhAP\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"5\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"nq40hJ1nXy\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"50\"\n },\n {\n \"_id\": \"G64ltgrVgV\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"10\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"PD3oYgtiDa\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"100\"\n },\n {\n \"_id\": \"1BY7iMFoDw\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"15\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"dlwJlbW7ZH\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"150\"\n }\n ],\n \"inputs\": [\n {\n \"id\": \"FD4qBBPv2G\",\n \"name\": \"Cart Total\",\n \"type\": \"expression\",\n \"field\": \"cart.total\"\n },\n {\n \"id\": \"DA3Ybo-shA\",\n \"name\": \"Customer Country\",\n \"type\": \"expression\",\n \"field\": \"customer.country\"\n },\n {\n \"id\": \"jrsT5Wg9F8\",\n \"name\": \"Customer Tier\",\n \"type\": \"expression\",\n \"field\": \"customer.tier\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"qA7iYc3Wle\",\n \"name\": \"Fees Flat ($)\",\n \"type\": \"expression\",\n \"field\": \"fees.flat\"\n },\n {\n \"id\": \"JuUcECFGe1\",\n \"name\": \"Fees Percent\",\n \"type\": \"expression\",\n \"field\": \"fees.percent\"\n }\n ],\n \"hitPolicy\": \"first\"\n },\n \"position\": {\n \"x\": 420,\n \"y\": 280\n }\n },\n {\n \"id\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\",\n \"name\": \"Response\",\n \"type\": \"outputNode\",\n \"position\": {\n \"x\": 670,\n \"y\": 280\n }\n }\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("https://api.example.com/api/projects/{projectId}/decisions/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"published\": true,\n \"releaseId\": \"<string>\",\n \"context\": {\n \"cart\": {\n \"total\": 1500\n },\n \"customer\": {\n \"country\": \"US\",\n \"tier\": \"gold\"\n }\n },\n \"graph\": {\n \"edges\": [\n {\n \"id\": \"1dfbc57d-ad1f-4cf8-978a-e43241856fc8\",\n \"type\": \"edge\",\n \"sourceId\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"targetId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\"\n },\n {\n \"id\": \"5e2dc187-3b82-4f21-94f5-9c3fd16e12d4\",\n \"type\": \"edge\",\n \"sourceId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"targetId\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"name\": \"Request\",\n \"type\": \"inputNode\",\n \"position\": {\n \"x\": 180,\n \"y\": 280\n }\n },\n {\n \"id\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"name\": \"Fees\",\n \"type\": \"decisionTableNode\",\n \"content\": {\n \"rules\": [\n {\n \"_id\": \"vCqrZGdWjA\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"2\",\n \"jrsT5Wg9F8\": \"\\\"gold\\\"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"CpXx-s78FH\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"3\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"zH-PuRB2aQ\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"25\"\n },\n {\n \"_id\": \"HjEp-eQhAP\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"5\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"nq40hJ1nXy\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"50\"\n },\n {\n \"_id\": \"G64ltgrVgV\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"10\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"PD3oYgtiDa\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"100\"\n },\n {\n \"_id\": \"1BY7iMFoDw\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"15\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"dlwJlbW7ZH\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"150\"\n }\n ],\n \"inputs\": [\n {\n \"id\": \"FD4qBBPv2G\",\n \"name\": \"Cart Total\",\n \"type\": \"expression\",\n \"field\": \"cart.total\"\n },\n {\n \"id\": \"DA3Ybo-shA\",\n \"name\": \"Customer Country\",\n \"type\": \"expression\",\n \"field\": \"customer.country\"\n },\n {\n \"id\": \"jrsT5Wg9F8\",\n \"name\": \"Customer Tier\",\n \"type\": \"expression\",\n \"field\": \"customer.tier\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"qA7iYc3Wle\",\n \"name\": \"Fees Flat ($)\",\n \"type\": \"expression\",\n \"field\": \"fees.flat\"\n },\n {\n \"id\": \"JuUcECFGe1\",\n \"name\": \"Fees Percent\",\n \"type\": \"expression\",\n \"field\": \"fees.percent\"\n }\n ],\n \"hitPolicy\": \"first\"\n },\n \"position\": {\n \"x\": 420,\n \"y\": 280\n }\n },\n {\n \"id\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\",\n \"name\": \"Response\",\n \"type\": \"outputNode\",\n \"position\": {\n \"x\": 670,\n \"y\": 280\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/projects/{projectId}/decisions/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"published\": true,\n \"releaseId\": \"<string>\",\n \"context\": {\n \"cart\": {\n \"total\": 1500\n },\n \"customer\": {\n \"country\": \"US\",\n \"tier\": \"gold\"\n }\n },\n \"graph\": {\n \"edges\": [\n {\n \"id\": \"1dfbc57d-ad1f-4cf8-978a-e43241856fc8\",\n \"type\": \"edge\",\n \"sourceId\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"targetId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\"\n },\n {\n \"id\": \"5e2dc187-3b82-4f21-94f5-9c3fd16e12d4\",\n \"type\": \"edge\",\n \"sourceId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"targetId\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"name\": \"Request\",\n \"type\": \"inputNode\",\n \"position\": {\n \"x\": 180,\n \"y\": 280\n }\n },\n {\n \"id\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"name\": \"Fees\",\n \"type\": \"decisionTableNode\",\n \"content\": {\n \"rules\": [\n {\n \"_id\": \"vCqrZGdWjA\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"2\",\n \"jrsT5Wg9F8\": \"\\\"gold\\\"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"CpXx-s78FH\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"3\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"zH-PuRB2aQ\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"25\"\n },\n {\n \"_id\": \"HjEp-eQhAP\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"5\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"nq40hJ1nXy\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"50\"\n },\n {\n \"_id\": \"G64ltgrVgV\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"10\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"PD3oYgtiDa\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"100\"\n },\n {\n \"_id\": \"1BY7iMFoDw\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"15\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"dlwJlbW7ZH\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"150\"\n }\n ],\n \"inputs\": [\n {\n \"id\": \"FD4qBBPv2G\",\n \"name\": \"Cart Total\",\n \"type\": \"expression\",\n \"field\": \"cart.total\"\n },\n {\n \"id\": \"DA3Ybo-shA\",\n \"name\": \"Customer Country\",\n \"type\": \"expression\",\n \"field\": \"customer.country\"\n },\n {\n \"id\": \"jrsT5Wg9F8\",\n \"name\": \"Customer Tier\",\n \"type\": \"expression\",\n \"field\": \"customer.tier\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"qA7iYc3Wle\",\n \"name\": \"Fees Flat ($)\",\n \"type\": \"expression\",\n \"field\": \"fees.flat\"\n },\n {\n \"id\": \"JuUcECFGe1\",\n \"name\": \"Fees Percent\",\n \"type\": \"expression\",\n \"field\": \"fees.percent\"\n }\n ],\n \"hitPolicy\": \"first\"\n },\n \"position\": {\n \"x\": 420,\n \"y\": 280\n }\n },\n {\n \"id\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\",\n \"name\": \"Response\",\n \"type\": \"outputNode\",\n \"position\": {\n \"x\": 670,\n \"y\": 280\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": "<unknown>",
"performance": "<string>",
"trace": {}
}{
"message": "<string>",
"data": "<unknown>"
}Decision
Simulate decision
Simulates a decision graph evaluation without persisting changes, useful for testing decision logic.
POST
/
api
/
projects
/
{projectId}
/
decisions
/
simulate
Simulate decision
curl --request POST \
--url https://api.example.com/api/projects/{projectId}/decisions/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"published": true,
"releaseId": "<string>",
"context": {
"cart": {
"total": 1500
},
"customer": {
"country": "US",
"tier": "gold"
}
},
"graph": {
"edges": [
{
"id": "1dfbc57d-ad1f-4cf8-978a-e43241856fc8",
"type": "edge",
"sourceId": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"targetId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9"
},
{
"id": "5e2dc187-3b82-4f21-94f5-9c3fd16e12d4",
"type": "edge",
"sourceId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"targetId": "72d52cfc-e866-4c11-bf79-6be9f750e4d7"
}
],
"nodes": [
{
"id": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"name": "Request",
"type": "inputNode",
"position": {
"x": 180,
"y": 280
}
},
{
"id": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"name": "Fees",
"type": "decisionTableNode",
"content": {
"rules": [
{
"_id": "vCqrZGdWjA",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "2",
"jrsT5Wg9F8": "\"gold\"",
"qA7iYc3Wle": ""
},
{
"_id": "CpXx-s78FH",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "3",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "zH-PuRB2aQ",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "25"
},
{
"_id": "HjEp-eQhAP",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "5",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "nq40hJ1nXy",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "50"
},
{
"_id": "G64ltgrVgV",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "10",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "PD3oYgtiDa",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "100"
},
{
"_id": "1BY7iMFoDw",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "15",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "dlwJlbW7ZH",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "150"
}
],
"inputs": [
{
"id": "FD4qBBPv2G",
"name": "Cart Total",
"type": "expression",
"field": "cart.total"
},
{
"id": "DA3Ybo-shA",
"name": "Customer Country",
"type": "expression",
"field": "customer.country"
},
{
"id": "jrsT5Wg9F8",
"name": "Customer Tier",
"type": "expression",
"field": "customer.tier"
}
],
"outputs": [
{
"id": "qA7iYc3Wle",
"name": "Fees Flat ($)",
"type": "expression",
"field": "fees.flat"
},
{
"id": "JuUcECFGe1",
"name": "Fees Percent",
"type": "expression",
"field": "fees.percent"
}
],
"hitPolicy": "first"
},
"position": {
"x": 420,
"y": 280
}
},
{
"id": "72d52cfc-e866-4c11-bf79-6be9f750e4d7",
"name": "Response",
"type": "outputNode",
"position": {
"x": 670,
"y": 280
}
}
]
}
}
'import requests
url = "https://api.example.com/api/projects/{projectId}/decisions/simulate"
payload = {
"published": True,
"releaseId": "<string>",
"context": {
"cart": { "total": 1500 },
"customer": {
"country": "US",
"tier": "gold"
}
},
"graph": {
"edges": [
{
"id": "1dfbc57d-ad1f-4cf8-978a-e43241856fc8",
"type": "edge",
"sourceId": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"targetId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9"
},
{
"id": "5e2dc187-3b82-4f21-94f5-9c3fd16e12d4",
"type": "edge",
"sourceId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"targetId": "72d52cfc-e866-4c11-bf79-6be9f750e4d7"
}
],
"nodes": [
{
"id": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"name": "Request",
"type": "inputNode",
"position": {
"x": 180,
"y": 280
}
},
{
"id": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"name": "Fees",
"type": "decisionTableNode",
"content": {
"rules": [
{
"_id": "vCqrZGdWjA",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "2",
"jrsT5Wg9F8": "\"gold\"",
"qA7iYc3Wle": ""
},
{
"_id": "CpXx-s78FH",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "3",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "zH-PuRB2aQ",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "25"
},
{
"_id": "HjEp-eQhAP",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "5",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "nq40hJ1nXy",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "50"
},
{
"_id": "G64ltgrVgV",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "10",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "PD3oYgtiDa",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "100"
},
{
"_id": "1BY7iMFoDw",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "15",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "dlwJlbW7ZH",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "150"
}
],
"inputs": [
{
"id": "FD4qBBPv2G",
"name": "Cart Total",
"type": "expression",
"field": "cart.total"
},
{
"id": "DA3Ybo-shA",
"name": "Customer Country",
"type": "expression",
"field": "customer.country"
},
{
"id": "jrsT5Wg9F8",
"name": "Customer Tier",
"type": "expression",
"field": "customer.tier"
}
],
"outputs": [
{
"id": "qA7iYc3Wle",
"name": "Fees Flat ($)",
"type": "expression",
"field": "fees.flat"
},
{
"id": "JuUcECFGe1",
"name": "Fees Percent",
"type": "expression",
"field": "fees.percent"
}
],
"hitPolicy": "first"
},
"position": {
"x": 420,
"y": 280
}
},
{
"id": "72d52cfc-e866-4c11-bf79-6be9f750e4d7",
"name": "Response",
"type": "outputNode",
"position": {
"x": 670,
"y": 280
}
}
]
}
}
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({
published: true,
releaseId: '<string>',
context: {cart: {total: 1500}, customer: {country: 'US', tier: 'gold'}},
graph: {
edges: [
{
id: '1dfbc57d-ad1f-4cf8-978a-e43241856fc8',
type: 'edge',
sourceId: 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
targetId: '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9'
},
{
id: '5e2dc187-3b82-4f21-94f5-9c3fd16e12d4',
type: 'edge',
sourceId: '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
targetId: '72d52cfc-e866-4c11-bf79-6be9f750e4d7'
}
],
nodes: [
{
id: 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
name: 'Request',
type: 'inputNode',
position: {x: 180, y: 280}
},
{
id: '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
name: 'Fees',
type: 'decisionTableNode',
content: {
rules: [
{
_id: 'vCqrZGdWjA',
'DA3Ybo-shA': '"US"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '2',
jrsT5Wg9F8: '"gold"',
qA7iYc3Wle: ''
},
{
_id: 'CpXx-s78FH',
'DA3Ybo-shA': '"US"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '3',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'zH-PuRB2aQ',
'DA3Ybo-shA': '"US"',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '25'
},
{
_id: 'HjEp-eQhAP',
'DA3Ybo-shA': '"CA","MX"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '5',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'nq40hJ1nXy',
'DA3Ybo-shA': '"CA","MX"',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '50'
},
{
_id: 'G64ltgrVgV',
'DA3Ybo-shA': '"IE","UK","FR","DE"',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '10',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'PD3oYgtiDa',
'DA3Ybo-shA': '"IE","UK","FR","DE"',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '100'
},
{
_id: '1BY7iMFoDw',
'DA3Ybo-shA': '',
FD4qBBPv2G: '> 1000',
JuUcECFGe1: '15',
jrsT5Wg9F8: '',
qA7iYc3Wle: ''
},
{
_id: 'dlwJlbW7ZH',
'DA3Ybo-shA': '',
FD4qBBPv2G: '',
JuUcECFGe1: '',
jrsT5Wg9F8: '',
qA7iYc3Wle: '150'
}
],
inputs: [
{id: 'FD4qBBPv2G', name: 'Cart Total', type: 'expression', field: 'cart.total'},
{
id: 'DA3Ybo-shA',
name: 'Customer Country',
type: 'expression',
field: 'customer.country'
},
{
id: 'jrsT5Wg9F8',
name: 'Customer Tier',
type: 'expression',
field: 'customer.tier'
}
],
outputs: [
{
id: 'qA7iYc3Wle',
name: 'Fees Flat ($)',
type: 'expression',
field: 'fees.flat'
},
{
id: 'JuUcECFGe1',
name: 'Fees Percent',
type: 'expression',
field: 'fees.percent'
}
],
hitPolicy: 'first'
},
position: {x: 420, y: 280}
},
{
id: '72d52cfc-e866-4c11-bf79-6be9f750e4d7',
name: 'Response',
type: 'outputNode',
position: {x: 670, y: 280}
}
]
}
})
};
fetch('https://api.example.com/api/projects/{projectId}/decisions/simulate', 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/api/projects/{projectId}/decisions/simulate",
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([
'published' => true,
'releaseId' => '<string>',
'context' => [
'cart' => [
'total' => 1500
],
'customer' => [
'country' => 'US',
'tier' => 'gold'
]
],
'graph' => [
'edges' => [
[
'id' => '1dfbc57d-ad1f-4cf8-978a-e43241856fc8',
'type' => 'edge',
'sourceId' => 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
'targetId' => '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9'
],
[
'id' => '5e2dc187-3b82-4f21-94f5-9c3fd16e12d4',
'type' => 'edge',
'sourceId' => '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
'targetId' => '72d52cfc-e866-4c11-bf79-6be9f750e4d7'
]
],
'nodes' => [
[
'id' => 'be0a5c2d-538d-4e50-9843-91b274e1b9d8',
'name' => 'Request',
'type' => 'inputNode',
'position' => [
'x' => 180,
'y' => 280
]
],
[
'id' => '7c07550a-07bc-4ee4-80d6-9ad900e3d6c9',
'name' => 'Fees',
'type' => 'decisionTableNode',
'content' => [
'rules' => [
[
'_id' => 'vCqrZGdWjA',
'DA3Ybo-shA' => '"US"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '2',
'jrsT5Wg9F8' => '"gold"',
'qA7iYc3Wle' => ''
],
[
'_id' => 'CpXx-s78FH',
'DA3Ybo-shA' => '"US"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '3',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'zH-PuRB2aQ',
'DA3Ybo-shA' => '"US"',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '25'
],
[
'_id' => 'HjEp-eQhAP',
'DA3Ybo-shA' => '"CA","MX"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '5',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'nq40hJ1nXy',
'DA3Ybo-shA' => '"CA","MX"',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '50'
],
[
'_id' => 'G64ltgrVgV',
'DA3Ybo-shA' => '"IE","UK","FR","DE"',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '10',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'PD3oYgtiDa',
'DA3Ybo-shA' => '"IE","UK","FR","DE"',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '100'
],
[
'_id' => '1BY7iMFoDw',
'DA3Ybo-shA' => '',
'FD4qBBPv2G' => '> 1000',
'JuUcECFGe1' => '15',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => ''
],
[
'_id' => 'dlwJlbW7ZH',
'DA3Ybo-shA' => '',
'FD4qBBPv2G' => '',
'JuUcECFGe1' => '',
'jrsT5Wg9F8' => '',
'qA7iYc3Wle' => '150'
]
],
'inputs' => [
[
'id' => 'FD4qBBPv2G',
'name' => 'Cart Total',
'type' => 'expression',
'field' => 'cart.total'
],
[
'id' => 'DA3Ybo-shA',
'name' => 'Customer Country',
'type' => 'expression',
'field' => 'customer.country'
],
[
'id' => 'jrsT5Wg9F8',
'name' => 'Customer Tier',
'type' => 'expression',
'field' => 'customer.tier'
]
],
'outputs' => [
[
'id' => 'qA7iYc3Wle',
'name' => 'Fees Flat ($)',
'type' => 'expression',
'field' => 'fees.flat'
],
[
'id' => 'JuUcECFGe1',
'name' => 'Fees Percent',
'type' => 'expression',
'field' => 'fees.percent'
]
],
'hitPolicy' => 'first'
],
'position' => [
'x' => 420,
'y' => 280
]
],
[
'id' => '72d52cfc-e866-4c11-bf79-6be9f750e4d7',
'name' => 'Response',
'type' => 'outputNode',
'position' => [
'x' => 670,
'y' => 280
]
]
]
]
]),
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 := "https://api.example.com/api/projects/{projectId}/decisions/simulate"
payload := strings.NewReader("{\n \"published\": true,\n \"releaseId\": \"<string>\",\n \"context\": {\n \"cart\": {\n \"total\": 1500\n },\n \"customer\": {\n \"country\": \"US\",\n \"tier\": \"gold\"\n }\n },\n \"graph\": {\n \"edges\": [\n {\n \"id\": \"1dfbc57d-ad1f-4cf8-978a-e43241856fc8\",\n \"type\": \"edge\",\n \"sourceId\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"targetId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\"\n },\n {\n \"id\": \"5e2dc187-3b82-4f21-94f5-9c3fd16e12d4\",\n \"type\": \"edge\",\n \"sourceId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"targetId\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"name\": \"Request\",\n \"type\": \"inputNode\",\n \"position\": {\n \"x\": 180,\n \"y\": 280\n }\n },\n {\n \"id\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"name\": \"Fees\",\n \"type\": \"decisionTableNode\",\n \"content\": {\n \"rules\": [\n {\n \"_id\": \"vCqrZGdWjA\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"2\",\n \"jrsT5Wg9F8\": \"\\\"gold\\\"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"CpXx-s78FH\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"3\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"zH-PuRB2aQ\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"25\"\n },\n {\n \"_id\": \"HjEp-eQhAP\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"5\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"nq40hJ1nXy\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"50\"\n },\n {\n \"_id\": \"G64ltgrVgV\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"10\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"PD3oYgtiDa\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"100\"\n },\n {\n \"_id\": \"1BY7iMFoDw\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"15\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"dlwJlbW7ZH\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"150\"\n }\n ],\n \"inputs\": [\n {\n \"id\": \"FD4qBBPv2G\",\n \"name\": \"Cart Total\",\n \"type\": \"expression\",\n \"field\": \"cart.total\"\n },\n {\n \"id\": \"DA3Ybo-shA\",\n \"name\": \"Customer Country\",\n \"type\": \"expression\",\n \"field\": \"customer.country\"\n },\n {\n \"id\": \"jrsT5Wg9F8\",\n \"name\": \"Customer Tier\",\n \"type\": \"expression\",\n \"field\": \"customer.tier\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"qA7iYc3Wle\",\n \"name\": \"Fees Flat ($)\",\n \"type\": \"expression\",\n \"field\": \"fees.flat\"\n },\n {\n \"id\": \"JuUcECFGe1\",\n \"name\": \"Fees Percent\",\n \"type\": \"expression\",\n \"field\": \"fees.percent\"\n }\n ],\n \"hitPolicy\": \"first\"\n },\n \"position\": {\n \"x\": 420,\n \"y\": 280\n }\n },\n {\n \"id\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\",\n \"name\": \"Response\",\n \"type\": \"outputNode\",\n \"position\": {\n \"x\": 670,\n \"y\": 280\n }\n }\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("https://api.example.com/api/projects/{projectId}/decisions/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"published\": true,\n \"releaseId\": \"<string>\",\n \"context\": {\n \"cart\": {\n \"total\": 1500\n },\n \"customer\": {\n \"country\": \"US\",\n \"tier\": \"gold\"\n }\n },\n \"graph\": {\n \"edges\": [\n {\n \"id\": \"1dfbc57d-ad1f-4cf8-978a-e43241856fc8\",\n \"type\": \"edge\",\n \"sourceId\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"targetId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\"\n },\n {\n \"id\": \"5e2dc187-3b82-4f21-94f5-9c3fd16e12d4\",\n \"type\": \"edge\",\n \"sourceId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"targetId\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"name\": \"Request\",\n \"type\": \"inputNode\",\n \"position\": {\n \"x\": 180,\n \"y\": 280\n }\n },\n {\n \"id\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"name\": \"Fees\",\n \"type\": \"decisionTableNode\",\n \"content\": {\n \"rules\": [\n {\n \"_id\": \"vCqrZGdWjA\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"2\",\n \"jrsT5Wg9F8\": \"\\\"gold\\\"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"CpXx-s78FH\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"3\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"zH-PuRB2aQ\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"25\"\n },\n {\n \"_id\": \"HjEp-eQhAP\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"5\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"nq40hJ1nXy\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"50\"\n },\n {\n \"_id\": \"G64ltgrVgV\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"10\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"PD3oYgtiDa\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"100\"\n },\n {\n \"_id\": \"1BY7iMFoDw\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"15\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"dlwJlbW7ZH\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"150\"\n }\n ],\n \"inputs\": [\n {\n \"id\": \"FD4qBBPv2G\",\n \"name\": \"Cart Total\",\n \"type\": \"expression\",\n \"field\": \"cart.total\"\n },\n {\n \"id\": \"DA3Ybo-shA\",\n \"name\": \"Customer Country\",\n \"type\": \"expression\",\n \"field\": \"customer.country\"\n },\n {\n \"id\": \"jrsT5Wg9F8\",\n \"name\": \"Customer Tier\",\n \"type\": \"expression\",\n \"field\": \"customer.tier\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"qA7iYc3Wle\",\n \"name\": \"Fees Flat ($)\",\n \"type\": \"expression\",\n \"field\": \"fees.flat\"\n },\n {\n \"id\": \"JuUcECFGe1\",\n \"name\": \"Fees Percent\",\n \"type\": \"expression\",\n \"field\": \"fees.percent\"\n }\n ],\n \"hitPolicy\": \"first\"\n },\n \"position\": {\n \"x\": 420,\n \"y\": 280\n }\n },\n {\n \"id\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\",\n \"name\": \"Response\",\n \"type\": \"outputNode\",\n \"position\": {\n \"x\": 670,\n \"y\": 280\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/projects/{projectId}/decisions/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"published\": true,\n \"releaseId\": \"<string>\",\n \"context\": {\n \"cart\": {\n \"total\": 1500\n },\n \"customer\": {\n \"country\": \"US\",\n \"tier\": \"gold\"\n }\n },\n \"graph\": {\n \"edges\": [\n {\n \"id\": \"1dfbc57d-ad1f-4cf8-978a-e43241856fc8\",\n \"type\": \"edge\",\n \"sourceId\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"targetId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\"\n },\n {\n \"id\": \"5e2dc187-3b82-4f21-94f5-9c3fd16e12d4\",\n \"type\": \"edge\",\n \"sourceId\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"targetId\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\"\n }\n ],\n \"nodes\": [\n {\n \"id\": \"be0a5c2d-538d-4e50-9843-91b274e1b9d8\",\n \"name\": \"Request\",\n \"type\": \"inputNode\",\n \"position\": {\n \"x\": 180,\n \"y\": 280\n }\n },\n {\n \"id\": \"7c07550a-07bc-4ee4-80d6-9ad900e3d6c9\",\n \"name\": \"Fees\",\n \"type\": \"decisionTableNode\",\n \"content\": {\n \"rules\": [\n {\n \"_id\": \"vCqrZGdWjA\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"2\",\n \"jrsT5Wg9F8\": \"\\\"gold\\\"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"CpXx-s78FH\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"3\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"zH-PuRB2aQ\",\n \"DA3Ybo-shA\": \"\\\"US\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"25\"\n },\n {\n \"_id\": \"HjEp-eQhAP\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"5\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"nq40hJ1nXy\",\n \"DA3Ybo-shA\": \"\\\"CA\\\",\\\"MX\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"50\"\n },\n {\n \"_id\": \"G64ltgrVgV\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"10\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"PD3oYgtiDa\",\n \"DA3Ybo-shA\": \"\\\"IE\\\",\\\"UK\\\",\\\"FR\\\",\\\"DE\\\"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"100\"\n },\n {\n \"_id\": \"1BY7iMFoDw\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"> 1000\",\n \"JuUcECFGe1\": \"15\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"\"\n },\n {\n \"_id\": \"dlwJlbW7ZH\",\n \"DA3Ybo-shA\": \"\",\n \"FD4qBBPv2G\": \"\",\n \"JuUcECFGe1\": \"\",\n \"jrsT5Wg9F8\": \"\",\n \"qA7iYc3Wle\": \"150\"\n }\n ],\n \"inputs\": [\n {\n \"id\": \"FD4qBBPv2G\",\n \"name\": \"Cart Total\",\n \"type\": \"expression\",\n \"field\": \"cart.total\"\n },\n {\n \"id\": \"DA3Ybo-shA\",\n \"name\": \"Customer Country\",\n \"type\": \"expression\",\n \"field\": \"customer.country\"\n },\n {\n \"id\": \"jrsT5Wg9F8\",\n \"name\": \"Customer Tier\",\n \"type\": \"expression\",\n \"field\": \"customer.tier\"\n }\n ],\n \"outputs\": [\n {\n \"id\": \"qA7iYc3Wle\",\n \"name\": \"Fees Flat ($)\",\n \"type\": \"expression\",\n \"field\": \"fees.flat\"\n },\n {\n \"id\": \"JuUcECFGe1\",\n \"name\": \"Fees Percent\",\n \"type\": \"expression\",\n \"field\": \"fees.percent\"\n }\n ],\n \"hitPolicy\": \"first\"\n },\n \"position\": {\n \"x\": 420,\n \"y\": 280\n }\n },\n {\n \"id\": \"72d52cfc-e866-4c11-bf79-6be9f750e4d7\",\n \"name\": \"Response\",\n \"type\": \"outputNode\",\n \"position\": {\n \"x\": 670,\n \"y\": 280\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"result": "<unknown>",
"performance": "<string>",
"trace": {}
}{
"message": "<string>",
"data": "<unknown>"
}Authorizations
personalAccessTokeninternalAuth
Personal access token is obtained through your profile
Path Parameters
Unique identifier of the project
Body
application/json
Indicates if simulation should use published decisions or draft
Optional release ID to use for loading dependent decisions
Evaluation context
Example:
{
"cart": { "total": 1500 },
"customer": { "country": "US", "tier": "gold" }
}Decision graph
Example:
{
"edges": [
{
"id": "1dfbc57d-ad1f-4cf8-978a-e43241856fc8",
"type": "edge",
"sourceId": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"targetId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9"
},
{
"id": "5e2dc187-3b82-4f21-94f5-9c3fd16e12d4",
"type": "edge",
"sourceId": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"targetId": "72d52cfc-e866-4c11-bf79-6be9f750e4d7"
}
],
"nodes": [
{
"id": "be0a5c2d-538d-4e50-9843-91b274e1b9d8",
"name": "Request",
"type": "inputNode",
"position": { "x": 180, "y": 280 }
},
{
"id": "7c07550a-07bc-4ee4-80d6-9ad900e3d6c9",
"name": "Fees",
"type": "decisionTableNode",
"content": {
"rules": [
{
"_id": "vCqrZGdWjA",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "2",
"jrsT5Wg9F8": "\"gold\"",
"qA7iYc3Wle": ""
},
{
"_id": "CpXx-s78FH",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "3",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "zH-PuRB2aQ",
"DA3Ybo-shA": "\"US\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "25"
},
{
"_id": "HjEp-eQhAP",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "5",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "nq40hJ1nXy",
"DA3Ybo-shA": "\"CA\",\"MX\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "50"
},
{
"_id": "G64ltgrVgV",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "10",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "PD3oYgtiDa",
"DA3Ybo-shA": "\"IE\",\"UK\",\"FR\",\"DE\"",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "100"
},
{
"_id": "1BY7iMFoDw",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "> 1000",
"JuUcECFGe1": "15",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": ""
},
{
"_id": "dlwJlbW7ZH",
"DA3Ybo-shA": "",
"FD4qBBPv2G": "",
"JuUcECFGe1": "",
"jrsT5Wg9F8": "",
"qA7iYc3Wle": "150"
}
],
"inputs": [
{
"id": "FD4qBBPv2G",
"name": "Cart Total",
"type": "expression",
"field": "cart.total"
},
{
"id": "DA3Ybo-shA",
"name": "Customer Country",
"type": "expression",
"field": "customer.country"
},
{
"id": "jrsT5Wg9F8",
"name": "Customer Tier",
"type": "expression",
"field": "customer.tier"
}
],
"outputs": [
{
"id": "qA7iYc3Wle",
"name": "Fees Flat ($)",
"type": "expression",
"field": "fees.flat"
},
{
"id": "JuUcECFGe1",
"name": "Fees Percent",
"type": "expression",
"field": "fees.percent"
}
],
"hitPolicy": "first"
},
"position": { "x": 420, "y": 280 }
},
{
"id": "72d52cfc-e866-4c11-bf79-6be9f750e4d7",
"name": "Response",
"type": "outputNode",
"position": { "x": 670, "y": 280 }
}
]
}Response
Successful simulation result with trace data
Was this page helpful?
⌘I