Create a new business-logic rule for the authenticated organization
curl --request POST \
--url https://app.solya.app/api/business-logic-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": [
{
"conditionOperator": "LOWER_THAN",
"metricId": "order_total_value",
"periodFilter": null,
"thresholdValue": 500,
"type": "METRIC"
}
]
},
"description": "Warn when a restock item total is below the supplier minimum",
"enforcementMode": "WARN",
"evaluationPoints": [
"PRE_PLAN_ITEM_ADD"
],
"logAllEvaluations": false,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"priority": 1,
"scope": {
"checkLevel": "PLAN_ITEM"
},
"validationHooks": [
"RESTOCK_PRE_ADD_ITEM"
]
}
'import requests
url = "https://app.solya.app/api/business-logic-rules"
payload = {
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": [
{
"conditionOperator": "LOWER_THAN",
"metricId": "order_total_value",
"periodFilter": None,
"thresholdValue": 500,
"type": "METRIC"
}
]
},
"description": "Warn when a restock item total is below the supplier minimum",
"enforcementMode": "WARN",
"evaluationPoints": ["PRE_PLAN_ITEM_ADD"],
"logAllEvaluations": False,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"priority": 1,
"scope": { "checkLevel": "PLAN_ITEM" },
"validationHooks": ["RESTOCK_PRE_ADD_ITEM"]
}
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({
actionFamily: 'RESTOCK_PLAN',
category: 'ORDERING',
conditions: {
operator: 'AND',
rules: [
{
conditionOperator: 'LOWER_THAN',
metricId: 'order_total_value',
periodFilter: null,
thresholdValue: 500,
type: 'METRIC'
}
]
},
description: 'Warn when a restock item total is below the supplier minimum',
enforcementMode: 'WARN',
evaluationPoints: ['PRE_PLAN_ITEM_ADD'],
logAllEvaluations: false,
name: 'Minimum order value',
paradigm: 'VALIDATION',
priority: 1,
scope: {checkLevel: 'PLAN_ITEM'},
validationHooks: ['RESTOCK_PRE_ADD_ITEM']
})
};
fetch('https://app.solya.app/api/business-logic-rules', 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://app.solya.app/api/business-logic-rules",
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([
'actionFamily' => 'RESTOCK_PLAN',
'category' => 'ORDERING',
'conditions' => [
'operator' => 'AND',
'rules' => [
[
'conditionOperator' => 'LOWER_THAN',
'metricId' => 'order_total_value',
'periodFilter' => null,
'thresholdValue' => 500,
'type' => 'METRIC'
]
]
],
'description' => 'Warn when a restock item total is below the supplier minimum',
'enforcementMode' => 'WARN',
'evaluationPoints' => [
'PRE_PLAN_ITEM_ADD'
],
'logAllEvaluations' => false,
'name' => 'Minimum order value',
'paradigm' => 'VALIDATION',
'priority' => 1,
'scope' => [
'checkLevel' => 'PLAN_ITEM'
],
'validationHooks' => [
'RESTOCK_PRE_ADD_ITEM'
]
]),
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://app.solya.app/api/business-logic-rules"
payload := strings.NewReader("{\n \"actionFamily\": \"RESTOCK_PLAN\",\n \"category\": \"ORDERING\",\n \"conditions\": {\n \"operator\": \"AND\",\n \"rules\": [\n {\n \"conditionOperator\": \"LOWER_THAN\",\n \"metricId\": \"order_total_value\",\n \"periodFilter\": null,\n \"thresholdValue\": 500,\n \"type\": \"METRIC\"\n }\n ]\n },\n \"description\": \"Warn when a restock item total is below the supplier minimum\",\n \"enforcementMode\": \"WARN\",\n \"evaluationPoints\": [\n \"PRE_PLAN_ITEM_ADD\"\n ],\n \"logAllEvaluations\": false,\n \"name\": \"Minimum order value\",\n \"paradigm\": \"VALIDATION\",\n \"priority\": 1,\n \"scope\": {\n \"checkLevel\": \"PLAN_ITEM\"\n },\n \"validationHooks\": [\n \"RESTOCK_PRE_ADD_ITEM\"\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://app.solya.app/api/business-logic-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actionFamily\": \"RESTOCK_PLAN\",\n \"category\": \"ORDERING\",\n \"conditions\": {\n \"operator\": \"AND\",\n \"rules\": [\n {\n \"conditionOperator\": \"LOWER_THAN\",\n \"metricId\": \"order_total_value\",\n \"periodFilter\": null,\n \"thresholdValue\": 500,\n \"type\": \"METRIC\"\n }\n ]\n },\n \"description\": \"Warn when a restock item total is below the supplier minimum\",\n \"enforcementMode\": \"WARN\",\n \"evaluationPoints\": [\n \"PRE_PLAN_ITEM_ADD\"\n ],\n \"logAllEvaluations\": false,\n \"name\": \"Minimum order value\",\n \"paradigm\": \"VALIDATION\",\n \"priority\": 1,\n \"scope\": {\n \"checkLevel\": \"PLAN_ITEM\"\n },\n \"validationHooks\": [\n \"RESTOCK_PRE_ADD_ITEM\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.solya.app/api/business-logic-rules")
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 \"actionFamily\": \"RESTOCK_PLAN\",\n \"category\": \"ORDERING\",\n \"conditions\": {\n \"operator\": \"AND\",\n \"rules\": [\n {\n \"conditionOperator\": \"LOWER_THAN\",\n \"metricId\": \"order_total_value\",\n \"periodFilter\": null,\n \"thresholdValue\": 500,\n \"type\": \"METRIC\"\n }\n ]\n },\n \"description\": \"Warn when a restock item total is below the supplier minimum\",\n \"enforcementMode\": \"WARN\",\n \"evaluationPoints\": [\n \"PRE_PLAN_ITEM_ADD\"\n ],\n \"logAllEvaluations\": false,\n \"name\": \"Minimum order value\",\n \"paradigm\": \"VALIDATION\",\n \"priority\": 1,\n \"scope\": {\n \"checkLevel\": \"PLAN_ITEM\"\n },\n \"validationHooks\": [\n \"RESTOCK_PRE_ADD_ITEM\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": [
{
"conditionOperator": "LOWER_THAN",
"metricId": "order_total_value",
"periodFilter": null,
"thresholdValue": 500,
"type": "METRIC"
}
]
},
"createdAt": "2026-06-04T10:00:00.000Z",
"description": "Warn when a restock item total is below the supplier minimum",
"enforcementMode": "WARN",
"evaluationPoints": [
"PRE_PLAN_ITEM_ADD"
],
"id": "rule-uuid-new-1",
"isActive": true,
"logAllEvaluations": false,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"phase": null,
"priority": 1,
"ruleGroupIds": [
"ruleset-uuid-default"
],
"scope": {
"checkLevel": "PLAN_ITEM"
},
"sourceTemplateId": null,
"updatedAt": null,
"validationHooks": [
"RESTOCK_PRE_ADD_ITEM"
],
"violationMessage": null
}Business Logic Rules
Create a new business-logic rule for the authenticated organization
Creates a business-logic rule in the caller’s organization. Validates all scope entity IDs against the organization before persisting. When no ruleGroupIds are provided, the rule is automatically attached to the organization’s default ruleset. Requires intelligenceLayer.configure permission.
POST
/
api
/
business-logic-rules
Create a new business-logic rule for the authenticated organization
curl --request POST \
--url https://app.solya.app/api/business-logic-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": [
{
"conditionOperator": "LOWER_THAN",
"metricId": "order_total_value",
"periodFilter": null,
"thresholdValue": 500,
"type": "METRIC"
}
]
},
"description": "Warn when a restock item total is below the supplier minimum",
"enforcementMode": "WARN",
"evaluationPoints": [
"PRE_PLAN_ITEM_ADD"
],
"logAllEvaluations": false,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"priority": 1,
"scope": {
"checkLevel": "PLAN_ITEM"
},
"validationHooks": [
"RESTOCK_PRE_ADD_ITEM"
]
}
'import requests
url = "https://app.solya.app/api/business-logic-rules"
payload = {
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": [
{
"conditionOperator": "LOWER_THAN",
"metricId": "order_total_value",
"periodFilter": None,
"thresholdValue": 500,
"type": "METRIC"
}
]
},
"description": "Warn when a restock item total is below the supplier minimum",
"enforcementMode": "WARN",
"evaluationPoints": ["PRE_PLAN_ITEM_ADD"],
"logAllEvaluations": False,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"priority": 1,
"scope": { "checkLevel": "PLAN_ITEM" },
"validationHooks": ["RESTOCK_PRE_ADD_ITEM"]
}
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({
actionFamily: 'RESTOCK_PLAN',
category: 'ORDERING',
conditions: {
operator: 'AND',
rules: [
{
conditionOperator: 'LOWER_THAN',
metricId: 'order_total_value',
periodFilter: null,
thresholdValue: 500,
type: 'METRIC'
}
]
},
description: 'Warn when a restock item total is below the supplier minimum',
enforcementMode: 'WARN',
evaluationPoints: ['PRE_PLAN_ITEM_ADD'],
logAllEvaluations: false,
name: 'Minimum order value',
paradigm: 'VALIDATION',
priority: 1,
scope: {checkLevel: 'PLAN_ITEM'},
validationHooks: ['RESTOCK_PRE_ADD_ITEM']
})
};
fetch('https://app.solya.app/api/business-logic-rules', 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://app.solya.app/api/business-logic-rules",
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([
'actionFamily' => 'RESTOCK_PLAN',
'category' => 'ORDERING',
'conditions' => [
'operator' => 'AND',
'rules' => [
[
'conditionOperator' => 'LOWER_THAN',
'metricId' => 'order_total_value',
'periodFilter' => null,
'thresholdValue' => 500,
'type' => 'METRIC'
]
]
],
'description' => 'Warn when a restock item total is below the supplier minimum',
'enforcementMode' => 'WARN',
'evaluationPoints' => [
'PRE_PLAN_ITEM_ADD'
],
'logAllEvaluations' => false,
'name' => 'Minimum order value',
'paradigm' => 'VALIDATION',
'priority' => 1,
'scope' => [
'checkLevel' => 'PLAN_ITEM'
],
'validationHooks' => [
'RESTOCK_PRE_ADD_ITEM'
]
]),
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://app.solya.app/api/business-logic-rules"
payload := strings.NewReader("{\n \"actionFamily\": \"RESTOCK_PLAN\",\n \"category\": \"ORDERING\",\n \"conditions\": {\n \"operator\": \"AND\",\n \"rules\": [\n {\n \"conditionOperator\": \"LOWER_THAN\",\n \"metricId\": \"order_total_value\",\n \"periodFilter\": null,\n \"thresholdValue\": 500,\n \"type\": \"METRIC\"\n }\n ]\n },\n \"description\": \"Warn when a restock item total is below the supplier minimum\",\n \"enforcementMode\": \"WARN\",\n \"evaluationPoints\": [\n \"PRE_PLAN_ITEM_ADD\"\n ],\n \"logAllEvaluations\": false,\n \"name\": \"Minimum order value\",\n \"paradigm\": \"VALIDATION\",\n \"priority\": 1,\n \"scope\": {\n \"checkLevel\": \"PLAN_ITEM\"\n },\n \"validationHooks\": [\n \"RESTOCK_PRE_ADD_ITEM\"\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://app.solya.app/api/business-logic-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actionFamily\": \"RESTOCK_PLAN\",\n \"category\": \"ORDERING\",\n \"conditions\": {\n \"operator\": \"AND\",\n \"rules\": [\n {\n \"conditionOperator\": \"LOWER_THAN\",\n \"metricId\": \"order_total_value\",\n \"periodFilter\": null,\n \"thresholdValue\": 500,\n \"type\": \"METRIC\"\n }\n ]\n },\n \"description\": \"Warn when a restock item total is below the supplier minimum\",\n \"enforcementMode\": \"WARN\",\n \"evaluationPoints\": [\n \"PRE_PLAN_ITEM_ADD\"\n ],\n \"logAllEvaluations\": false,\n \"name\": \"Minimum order value\",\n \"paradigm\": \"VALIDATION\",\n \"priority\": 1,\n \"scope\": {\n \"checkLevel\": \"PLAN_ITEM\"\n },\n \"validationHooks\": [\n \"RESTOCK_PRE_ADD_ITEM\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.solya.app/api/business-logic-rules")
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 \"actionFamily\": \"RESTOCK_PLAN\",\n \"category\": \"ORDERING\",\n \"conditions\": {\n \"operator\": \"AND\",\n \"rules\": [\n {\n \"conditionOperator\": \"LOWER_THAN\",\n \"metricId\": \"order_total_value\",\n \"periodFilter\": null,\n \"thresholdValue\": 500,\n \"type\": \"METRIC\"\n }\n ]\n },\n \"description\": \"Warn when a restock item total is below the supplier minimum\",\n \"enforcementMode\": \"WARN\",\n \"evaluationPoints\": [\n \"PRE_PLAN_ITEM_ADD\"\n ],\n \"logAllEvaluations\": false,\n \"name\": \"Minimum order value\",\n \"paradigm\": \"VALIDATION\",\n \"priority\": 1,\n \"scope\": {\n \"checkLevel\": \"PLAN_ITEM\"\n },\n \"validationHooks\": [\n \"RESTOCK_PRE_ADD_ITEM\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"actionFamily": "RESTOCK_PLAN",
"category": "ORDERING",
"conditions": {
"operator": "AND",
"rules": [
{
"conditionOperator": "LOWER_THAN",
"metricId": "order_total_value",
"periodFilter": null,
"thresholdValue": 500,
"type": "METRIC"
}
]
},
"createdAt": "2026-06-04T10:00:00.000Z",
"description": "Warn when a restock item total is below the supplier minimum",
"enforcementMode": "WARN",
"evaluationPoints": [
"PRE_PLAN_ITEM_ADD"
],
"id": "rule-uuid-new-1",
"isActive": true,
"logAllEvaluations": false,
"name": "Minimum order value",
"paradigm": "VALIDATION",
"phase": null,
"priority": 1,
"ruleGroupIds": [
"ruleset-uuid-default"
],
"scope": {
"checkLevel": "PLAN_ITEM"
},
"sourceTemplateId": null,
"updatedAt": null,
"validationHooks": [
"RESTOCK_PRE_ADD_ITEM"
],
"violationMessage": null
}Authorizations
User session token issued by NextAuth. For human users accessing Solya via the web application.
Body
application/json
Available options:
CAPACITY, ASSORTMENT, ORDERING, TRANSFER, PRICING, DISTRIBUTION, COMPLIANCE - Option 1
- Option 2
Show child attributes
Show child attributes
Required string length:
1 - 255Show child attributes
Show child attributes
Available options:
RESTOCK_PLAN, REBALANCE_PLAN, MARKDOWN_PLAN, PRE_SEASON_PLAN, RECOMMENDATION, WORKFLOW, SUPPLIER_RETURN_PLAN, SUPPLIER_EXCHANGE_PLAN Available options:
BLOCK, WARN, LOG Available options:
PRE_PLAN_ITEM_ADD, PRE_PLAN_VALIDATE, RECOMMENDATION_GENERATION, WORKFLOW_EXECUTION, MANUAL_CHECK Available options:
SCORING, SIZING, SOURCING, APPROVAL Required range:
0 <= x <= 9007199254740991Minimum string length:
1Maximum string length:
100Available options:
RESTOCK_PRE_ADD_ITEM, RESTOCK_PRE_VALIDATE_ITEM, RESTOCK_PRE_CHANGE_STATUS, REBALANCE_PRE_ADD_ITEM, REBALANCE_PRE_VALIDATE_ITEM, REBALANCE_PRE_CHANGE_STATUS, MARKDOWN_PRE_ADD_ITEM, MARKDOWN_PRE_VALIDATE_ITEM, PRE_SEASON_PRE_ADD_ITEM, PRE_SEASON_PRE_VALIDATE_ITEM, PRE_SEASON_PRE_CHANGE_STATUS, RECOMMENDATION_PRE_GENERATE, MANUAL_CHECK, SUPPLIER_RETURN_PRE_ADD_ITEM, SUPPLIER_RETURN_PRE_CHANGE_STATUS, SUPPLIER_EXCHANGE_PRE_ADD_ITEM, SUPPLIER_EXCHANGE_PRE_CHANGE_STATUS Show child attributes
Show child attributes
⌘I

