Split Rules
Split rules define how orders are automatically divided into multiple sub-orders based on line item attributes, such as warehouse location, fulfillment type, or product category.
List Split Rules
GET
/api/split-rulesList all split rules for the organization.
Requiredorders:read
Returns a paginated list of split rules with their configuration and priority.
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/split-rules" \
-H "Authorization: Bearer ord_sk_..."Response
{
"data": [
{
"id": "uuid",
"name": "Split by warehouse",
"field": "line_items.warehouse_code",
"strategy": "group_by",
"priority": 10,
"enabled": true,
"created_at": "2026-01-01T00:00:00Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 2, "totalPages": 1, "hasMore": false }
}Create Split Rule
POST
/api/split-rulesCreate a new order split rule.
Requiredorders:write
Creates a new split rule. Rules are evaluated in priority order (lower number runs first).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
field | string | Yes | Dot-notation path to the field to split on |
strategy | string | Yes | Split strategy: group_by, threshold, custom |
config | object | No | Strategy-specific configuration |
priority | number | No | Execution priority (lower runs first, default: 100) |
enabled | boolean | No | Whether the rule is active (default: true) |
curl -X POST "https://api.orderly.dev/api/split-rules" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Split by warehouse",
"field": "line_items.warehouse_code",
"strategy": "group_by",
"priority": 10
}'Update Split Rule
PATCH
/api/split-rules/:idUpdate a split rule's configuration.
Requiredorders:write
Updates a split rule. Changes take effect for new orders processed after the update.
curl -X PATCH "https://api.orderly.dev/api/split-rules/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer ord_sk_..." \
-H "Content-Type: application/json" \
-d '{"priority": 5, "enabled": false}'Delete Split Rule
DELETE
/api/split-rules/:idDelete a split rule.
Requiredorders:write
Permanently deletes a split rule. Orders that were previously split by this rule are not affected.
curl -X DELETE "https://api.orderly.dev/api/split-rules/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer ord_sk_..."