Create Assembly
POST/api/assemblies
Creates a new inventory assembly or disassembly record, adjusting inventory accordingly.
inventory:writeGrant 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 (underenforce, 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
- 200
- 400
- 401
- 403
- 422
- 429
OK
Response Headers
Bad Request
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.
Unprocessable Entity
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.