Skip to Content
API ReferenceCondition Sets

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

GET/api/condition-sets

List all condition sets for the organization.

Requireddispatchers:read

Returns a paginated list of condition sets with their conditions and usage counts.

Query Parameters

ParameterTypeDescription
pagenumberPage number (default: 1)
limitnumberItems 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

POST/api/condition-sets

Create a new condition set.

Requireddispatchers:write

Creates a new condition set with one or more conditions. Conditions are evaluated against order or shipment fields.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name
logicstringNoCombination logic: AND or OR (default: AND)
conditionsobject[]YesArray of condition rules

Condition Object

FieldTypeRequiredDescription
fieldstringYesDot-notation field path (e.g., shipping_address.state)
operatorstringYesComparison operator: equals, not_equals, contains, greater_than, less_than, in, not_in
valueanyYesValue 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

PATCH/api/condition-sets/:id

Update a condition set's name, logic, or conditions.

Requireddispatchers:write

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

DELETE/api/condition-sets/:id

Delete a condition set.

Requireddispatchers:write

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_..."