Condition Sets
Condition sets let you combine multiple conditions with logical operators to create complex rules.
Structure
A condition set groups conditions with a logical operator:
{
"operator": "and",
"conditions": [
{ "field": "totalPrice", "operator": "gte", "value": 100 },
{ "field": "shippingAddress.state", "operator": "eq", "value": "CA" }
]
}Logical Operators
| Operator | Description |
|---|---|
and | All conditions must match |
or | At least one condition must match |
Nesting
Condition sets can be nested for complex logic:
{
"operator": "and",
"conditions": [
{ "field": "status", "operator": "eq", "value": "pending" },
{
"operator": "or",
"conditions": [
{ "field": "totalPrice", "operator": "gte", "value": 500 },
{ "field": "tags", "operator": "contains", "value": "vip" }
]
}
]
}This matches: orders that are pending AND (have totalPrice >= 500 OR are tagged vip).
Managing Condition Sets
Condition sets can be saved and reused across dispatchers:
POST /api/condition-sets
GET /api/condition-sets
PATCH /api/condition-sets/:id
DELETE /api/condition-sets/:idThis lets you define complex conditions once and reference them in multiple dispatchers.