Beta — subject to change. This endpoint is publicly available, but its request/response shape may evolve before General Availability as we incorporate early feedback.
Follows batches (lots) and serial numbers through every document in both
directions: back to the suppliers and purchase orders they came from, and forward through manufacturing orders and
outsourced purchase orders to everything made from them, with the stock adjustments that added or removed them
and the stock left of everything reached. The sales orders that shipped them are counted here and listed, with
their customers, by GET /traceability/sales_orders. Several batches and serial numbers given together
are traced as one combined trace.
Where each answer is
- Who received it, for a recall ("our supplier says flour batch FL-0815 is bad, who got bread made from it?"):
GET /traceability/sales_orderslists each sales order with the customer's email, phone and ship-to address
and the batches or serial numbers it shipped, page by page at any size. The trace counts those orders:
summary.shipped_sales_order_countin all,shipped_sales_order_counton each node.recall.open_orderslists the orders that have traced stock assigned and can
still be stopped.recall.stock_on_handlists what is left to quarantine, per location and bin. - Where it came from, for a complaint ("where did the motor in this e-bike come from?"): trace the e-bike's serial
number.recall.purchase_orderslists the purchase orders and suppliers of everything it was made from. For one
component, find its node (direction: upstream):issued_byon the node'straceabilitynames its
supplier, and the edges into the node lead to its purchase order. - One step back and one step forward: pass
max_depth=0. It returns the documents the starts themselves moved
on: the purchase orders that received them and the manufacturing orders that used or made them, but not what
those manufacturing orders made. - Everything made or received in a period ("every batch of this bread made last week"): list them per variant with
GET /traceability/added_to_stockand trace them together here. To narrow to one production line or machine, keep
those whose manufacturing order ran on it (GET /manufacturing_order_operation_rowsgives each order's
resource_id). - Mock recall or audit:
summaryhas the counts and the stock at risk, and each node its massbalance.
GET /traceability/movementslists the completed movements behind the trace page by page, for a timeline at any
size.
How to read it
- Every output of a manufacturing order or outsourced purchase order counts as containing every input the order
used, so a recall can include more units than were really affected. The exception is a manufacturing order that
links its ingredients to the output serial numbers they went into: by default (trace_by=unit) each of those
serial numbers counts as containing only the ingredients linked to it and those linked to none ("which bikes have
battery C1" gives only the bike it went into; "what is in bike S2" gives only its own parts). When the trace followed
only some of the order's serial numbers, the order names them inunit_trace. An ingredient partly used without
a link counts in every output.trace_by=ordercounts every output as containing every input, e.g. to recall the
whole order for a process issue. Orders without links trace the same either way. Several starts are traced as one,
sounit_traceand the edges show the combined set, not which start led to which serial number: trace a serial
number on its own for its own parts. - A trace can miss units only where
incomplete_tracesnames an order, wheresummary.is_partialis true, or,
when tracing by unit, where an ingredient was linked to the wrong serial number. - A trace follows at most 2000 batches and serial numbers, counted together, and at most 10 orders deep. When it
stops at either limit,summary.is_partialis true. In Katana, the Traceability explorer exports the trace, its
customers and its genealogy as files; the export follows the trace to its end. recallandsummaryanswer most questions directly. The graph behind them isnodes(batches, serial
numbers and serial groups) anddocuments(orders and stock adjustments, linked byedgesin the direction
the stock flowed; stock transfers are listed without edges).- Each node carries its mass
balance: what came in, was used, shipped, adjusted and is on hand, totalled over
every completed movement of the batch or serial numbers, also those the trace does not follow. - Quantities are decimal strings in the unit of measure of their variant.
Finding the ids: a batch id is the batch_id from
GET /batch_stocks?batch_number={exact batch number}&include_empty=true (one row per location; the same number
can exist on several variants, so check variant_id). A serial number id is the id from
GET /serial_numbers?resource_type={type}&resource_id={id} for a document it is on, e.g.
resource_type=SalesOrderRow with the sales order row id.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||