XentrDeveloper Docs
Guides

Work orders

Create, schedule, and track production orders programmatically.

Production orders are the unit of work in Factory OS. Each order references a product, a target quantity, and a planned schedule.

Create a production order

curl -X POST https://api.xentr.ai/api/factories/biocare-main/production-orders \
  -H "Authorization: Bearer $XENTR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "a1b2c3d4-...",
    "quantityTarget": 1000,
    "plannedStart": "2026-04-20T08:00:00Z",
    "plannedEnd": "2026-04-20T16:00:00Z"
  }'

Lifecycle

draft → scheduled → running → completed

                     cancelled
  • draft — created, not yet scheduled
  • scheduled — assigned a machine + time window
  • running — production in progress, consuming telemetry
  • completed — quantity met, order closed
  • cancelled — explicitly stopped

Transitions happen via dedicated endpoints (/start, /complete, /cancel) — not by PATCH status.

Splits

A single order can be split across machines or shifts:

{
  "splits": [
    { "machineCode": "CNC-001", "quantity": 600 },
    { "machineCode": "CNC-002", "quantity": 400 }
  ]
}

Tracking progress

OEE metrics and produced-part counts roll up automatically from machine telemetry linked to the order's machine(s). Query the Production Orders API for live counts.

Audit trail

Every state change is audit-logged with the user, timestamp, and before/after values. See Audit API.

On this page