Skip to Content
OperationsCreating

Creating Operations

Defining an Operation

Every operation has three parts:

  1. Target type — What you’re acting on (orders or shipments)
  2. Selection criteria — Which records to include (filters or explicit IDs)
  3. Action — What to do with each selected record

Selection Methods

Filter-based Selection

Select records that match conditions:

{ "targetType": "orders", "filters": { "status": "pending", "bridgeId": "uuid-of-bridge", "tags": ["wholesale"], "createdAfter": "2026-03-01", "createdBefore": "2026-03-15" } }

Explicit Selection

Select specific records by ID:

{ "targetType": "orders", "itemIds": ["uuid-1", "uuid-2", "uuid-3"] }

Preview

Before executing, preview the operation to see how many records will be affected:

Portal

The operation creation wizard shows a preview count and a sample of affected records before you confirm.

API

POST /api/operations/preview Content-Type: application/json { "targetType": "orders", "filters": { "status": "pending" }, "action": { "type": "add_tag", "value": "priority" } }

Returns:

{ "affectedCount": 42, "sample": [...] }

Creating via API

POST /api/operations Content-Type: application/json { "name": "Tag high-value orders as priority", "targetType": "orders", "filters": { "status": "pending", "totalPrice": { "gte": 500 } }, "action": { "type": "add_tag", "value": "priority" } }