Trace Lot Genealogy
GET/api/manufacturing/lot-genealogy
Returns a genealogy tree for a batch/lot. batch_number is required; product_id is optional and auto-resolved from the batch number when it uniquely identifies a FIFO layer. When the same batch number is used across multiple products, the API responds 409 with a candidates array so a UI can prompt for product disambiguation. Direction backward traces from finished good back to raw material inputs (recall use case); forward traces from raw material to all downstream produced lots (recall impact analysis).
manufacturing:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Every node names its source documents: manufacturing_order_id plus manufacturing_order_number when the lot was produced on a manufacturing order (including outsourced finished goods, which are bridged to the run through their production iteration), and purchase_order_id / supplier_id / supplier_name when the lot was received against a purchase order. An outsourced finished good carries both.
Batches received more than once. A batch number can be received across several receipts (one inventory lot per receipt). Every receipt is traced:
- A batch with a single receipt is rooted on that receipt's lot, exactly as before.
- A batch with several receipts returns one synthetic root node with
entity_type: "lot",id=lot-{product_id}-{batch_number},fifo_layer_id: null,quantity= the total received across all receipts,date= the earliest receipt date,receipt_count= the number of receipts, and one child per receipt (oldest first), each child being that receipt's own trace in the requested direction.
resolved_product_id is the product the batch belongs to.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not Found
Response Headers
Conflict
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.