Skip to main content
Version: v1.0.0(int)

E090: Update BOM

PATCH /api/boms/:id

Replaces the full set of items for an output SKU's BOM. :id is the output SKU id. Triggered from BOM Detail. The replacement is atomic; partial intermediate states are never visible.

Authentication

Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.

Request

{
"outputSkuId": "uuid",
"items": [
{ "materialId": "uuid", "quantity": 2.0 },
{ "inputSkuId": "uuid", "quantity": 1 }
]
}

Replaces the BOM's items (delete-then-insert under the hood). Each item is a material input (materialId) or a sub-assembly SKU input (inputSkuId) — exactly one — with quantity > 0. The L3 workflow snapshots a NEW BOM at the next work-order create; existing WOs keep their original recipe snapshot.

Response — 200 OK

{
"outputSkuId": "uuid",
"items": [ BomItem ]
}

Each BomItem is { "id", "orgId", "skuId", "materialId", "inputSkuId", "quantity", "createdAt" } (one of materialId / inputSkuId is null).

Errors

HTTPcodeCondition
404not_foundOutput SKU has no existing BOM, or an item references an unknown material/SKU.
422validation_failedShape invalid (item not exactly one of materialId / inputSkuId, quantity <= 0, self-reference, or a duplicate input).

Workflow

Calls W090 Update BOM.