Skip to main content

Create Assembly

POST 

/api/assemblies

Creates a new inventory assembly or disassembly record, adjusting inventory accordingly.

Required scope: inventory:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token

Request body:

  • action_date (date, required): Date of the assembly/disassembly action (e.g. '2024-01-15')
  • product_id (integer, required): ID of the kit product to assemble/disassemble
  • warehouse_id (integer, required): ID of the warehouse where the action takes place. Warehouse must have a default location unless warehouse_location_id is provided.
  • warehouse_location_id (integer, optional): ID of the warehouse location. If omitted, uses the warehouse's default location.
  • quantity (numeric, required): Quantity to assemble or disassemble. Must be non-zero.
  • action (string, required): Type of action — 'assemble' (build kits from components) or 'disassemble' (break kits into components)
  • component_lot_allocations (array, optional, ASSEMBLE only): FEFO suggest-with-override for lot-tracked components. Each entry is { product_id, lot_allocation: [{ fifo_layer_id, quantity }] }. Omit to consume components by automatic FEFO/FIFO. When supplied, the allocation for each component must reconcile to that component's total consumption (its per-kit quantity × assembly quantity), reference active FIFO layers of that component product + the selected warehouse, and respect the tenant's lot-override policy (under enforce, expired or later-expiry FEFO picks are hard-blocked). Validation errors are returned per row, e.g. component_lot_allocations.0.lot_allocation.1.fifo_layer_id.

Request

Responses

OK

Response Headers
    Content-Type