# Work orders

Find production work orders and review inputs, outputs, lots, quantities, and completion summaries.

Canonical HTML: https://developer.shelfcycle.com/guides/work-orders

Find work orders and review their input and output materials, lots, packaging, warehouses, and recorded quantities.

API v1.66 provides `GET /work-orders` and `GET /work-orders/{id}` for current and earlier work orders. Use [Work-order imports](/guides/work-order-imports) to bring production tickets into ShelfCycle.

## Access

Use `work-orders:read` with the acting person's current Work Order viewing permission. Full-access keys include this scope. `GET /me` reports `effectiveCapabilities.workOrders.read`. Read access is separate from `work-orders:write` and does not require import availability.

## Find work orders

```bash
curl "$SHELFCYCLE_API_BASE_URL/work-orders?completedFrom=2026-11-01&completedTo=2026-11-25&limit=25" \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY"
```

Results are newest first. Use these filters together as needed:

| Filter | Meaning |
| --- | --- |
| `orderNo` | Up to 25 stored work-order numbers, comma-separated, matching the whole number without regard to letter case. |
| `status` | Comma-separated `DRAFT`, `CONFIRMED`, `COMPLETED`, or `VOID`. Omission excludes void work orders. A completion window defaults to completed work orders. |
| `type` | Comma-separated `from_scratch`, `blending`, `repack`, `warehouse_transfer`, `relabeling`, or `legacy`. Imported Formula tickets read as blending. |
| `productId` and `productSide` | Up to 25 product IDs, comma-separated. Select `input`, `output`, or `either` for the side to search. |
| `lotNumber` | Find work orders that made or used a selected lot. |
| `completedFrom` and `completedTo` | Send both as inclusive company-calendar days, covering up to 366 days, using the recorded completion date. |
| `history` | `true` selects imported tickets and `false` selects staff-entered work orders. This is separate from whether a ticket predates the GL start date. |

`limit` defaults to 25 and accepts 1–100. Continue with `meta.nextCursor` as `cursor`, keeping the first page's filters and limit unchanged. Each page observes current records; it is not a fixed snapshot across requests.

## Read one work order

Select a returned UUID, then request `GET /work-orders/{id}`. List rows include the first 20 lines; detail includes the first 500. `lineCount` is the full count, so compare it with the returned lines before describing the detail as complete.

Each line identifies its input or output direction, product code and family, package, quantity, quantity basis, lot, and warehouse. Keep each quantity with its `quantityBasis`. A lot's `link` is `movement` for a recorded consumption or receipt, `chosen` for a selected lot without a movement, or `declared` for an output lot number without a linked lot ID.

The detail also includes notes, `customerLabel`, and `defaultWarehouse`, the work order's own warehouse. Earlier work orders can have null `executedAt` and `customerLabel`. Read completion windows from `completedAt`, rather than substituting execution or scheduled dates.

These reads provide production and quantity information without costs, suppliers, assignees, or linked sales orders. Plant confirmation work orders are excluded. A record from another organization returns `404`.

## Use quantity summaries

The first page's `meta.totalRows` and `meta.summary` cover everything matching the filters, beyond the displayed page. Continuation pages return both as null. Summary groups keep direction, status, product, package, and quantity basis together. Up to 200 groups are returned; check `groupCount` and `complete` before treating them as the whole result.

Keep planned quantities from draft or confirmed work separate from completed production. Add quantities only within matching products, packages, and quantity bases. Do not sum displayed list lines as a substitute for the returned summary.

If a read returns `422 resource_limit`, narrow the product, lot, status, number, or completion window and try the revised request. See [Errors](/guides/errors) for retry guidance.
