Simple Assemble / Disassemble
POST/api/manufacturing/simple-assemble
Light-manufacturing mode: one-shot assemble/disassemble of a kit product. Creates a Completed Manufacturing Order (is_simple_mode=true) in a single call. Use action: disassemble to break a kit back into components; the resulting MO is additionally flagged with is_disassemble=true so it can be filtered out of the standard MO list.
Body fields:
kit_product_id(int, required) — product to assemble or disassemblequantity(numeric, required, >0) — units to produce (assemble) or consume (disassemble)warehouse_id(int, required)warehouse_location_id(int, optional)action_date(date, required, m/d/Y or Y-m-d)action(string, optional) —assemble(default) ordisassemble
Response (201 Created): Flat ManufacturingOrderResource for the newly-created Completed MO. The frontend uses the returned id to deep-link the success toast to the MO detail page.
Response (422 Unprocessable Entity — code: component_shortage): Returned when there is not enough on-hand stock to fully allocate the components (assemble) or the kit (disassemble). The atomic run is rolled back, so no partial MO is left behind. The body carries a human-readable message/error listing the shortfalling lines plus a structured shortages array. Use GET /simple-assemble/preview first to warn before submit.
Request
Responses
- 201
- 422
Created
Response Headers
Unprocessable Entity