Skip to main content

Assemble Kits for Inventory Debt Claims

POST 

/api/inventory/debt/claims/assemble

Assemble kits from the component stock on hand, then settle the selected inventory debt claims from the new kits.

Required scope: inventory:write

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

Runs the same plan Preview Kit Assembly for Inventory Debt Claims returns, re-checked at the moment of the call: one inventory assembly per kit and warehouse, building the smaller of the current plan and the quantity you confirmed for that pool, so stock that arrives after the preview can never make it build more. Only one run per account at a time. The components leave at their FIFO cost, the kits land at that cost, and the claims settle oldest first within each kit's pool; the difference from each claim's estimate posts as the usual settlement variance. A pool whose assembly fails (for example, component stock moved since the preview) is reported in failures and does not stop the others.

Authentication: Requires Bearer token.

Request body:

  • claim_ids (array of integer, required, 1-200) - the claims to settle
  • pools (array, required, 1-200) - the quantities confirmed from the preview; a pool left out builds nothing
    • product_id (integer, required) - the kit
    • warehouse_id (integer, required)
    • quantity (integer, required, min 0) - the most kits to build for this pool, normally the preview's will_assemble

Response 200:

  • data.assemblies[] (array) - the assemblies created
    • id (integer) - the inventory assembly
    • product_id (integer) - the kit
    • kit_sku (string, nullable)
    • warehouse_id (integer)
    • warehouse_name (string, nullable)
    • quantity (integer) - kits built
  • data.kits_assembled (integer)
  • data.claims_settled (integer) - selected claims that are now settled
  • data.claims_still_outstanding (integer) - selected claims still owed
  • data.continuing_in_background (boolean) - true when the rest of a long pool is settling in the background
  • data.failures[] (array) - pools that could not be assembled
    • product_id (integer)
    • kit_sku (string, nullable)
    • warehouse_id (integer)
    • message (string)
  • data.pools_not_started (integer) - pools skipped to keep one call short; call again to build them
  • data.message (string) - human summary

Response 422 when pools is missing, when nothing in the selection can be assembled (no outstanding claims, no kits, no components set up, no component stock, a locked period or a lifecycle state that blocks assemblies), with the reasons in message, or when another run is in progress.

Request​

Responses​

OK

Response Headers
    Content-Type