Condition Sets
Condition sets define groups of rules that dispatchers use to determine which orders or shipments to act on. Each condition set contains one or more conditions combined with AND/OR logic.
List Condition Sets
/api/condition-setsList all condition sets for the organization.
Returns a paginated list of condition sets with their conditions and usage counts.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | number | Page number (default: 1) |
limit | number | Items per page (default: 20, max: 100) |
curl -X GET "https://api.orderly.dev/api/condition-sets" \
-H "Authorization: Bearer ord_sk_..."Response
{
"data": [
{
"id": "uuid",
"name": "Domestic Ground Eligible",
"logic": "AND",
"conditions": [
{ "field": "shipping_address.country", "operator": "equals", "value": "US" },
{ "field": "total", "operator": "less_than", "value": 150 }
],
"dispatcher_count": 2,
"created_at": "2026-01-01T00:00:00Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 4, "totalPages": 1, "hasMore": false }
}Create Condition Set
/api/condition-setsCreate a new condition set.
Creates a new condition set with one or more conditions. Conditions are evaluated against order or shipment fields.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
logic | string | No | Combination logic: AND or OR (default: AND) |
conditions | object[] | Yes | Array of condition rules |
Condition Object
| Field | Type | Required | Description |
|---|---|---|---|
field | string | Yes | Dot-notation field path (e.g., shipping_address.state) |
operator | string | Yes | Comparison operator: equals, not_equals, contains, greater_than, less_than, in, not_in |
value | any | Yes | Value to compare against |
curl -X POST "https://api.orderly.dev/api/condition-sets" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Heavy Freight Orders",
"logic": "AND",
"conditions": [
{ "field": "total_weight", "operator": "greater_than", "value": 70 },
{ "field": "shipping_address.country", "operator": "equals", "value": "US" }
]
}'Update Condition Set
/api/condition-sets/:idUpdate a condition set's name, logic, or conditions.
Updates a condition set. Changes take effect immediately for all dispatchers using this condition set.
curl -X PATCH "https://api.orderly.dev/api/condition-sets/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Heavy Freight Orders (Updated)",
"conditions": [
{ "field": "total_weight", "operator": "greater_than", "value": 100 },
{ "field": "shipping_address.country", "operator": "in", "value": ["US", "CA"] }
]
}'Delete Condition Set
/api/condition-sets/:idDelete a condition set.
Permanently deletes a condition set. This will fail if any dispatchers are still referencing it. Remove or reassign dispatchers first.
curl -X DELETE "https://api.orderly.dev/api/condition-sets/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer ord_sk_..."