POST
Break bundles back into items
Company space For: Manager, Stock keeper · Permission: bundles.detach Conditions
  • The bundle must not be archived.
  • asset_id and each component asset_id must be locations of the organization.
  • components must list exactly the bundle’s components, each once, with the location it returns to.
  • The bundle must hold stock at asset_id; a shortfall is refused.
  • Every component unit must be active.
  • Each component cost, when sent, is in major units, at least 0, with at most the currency’s decimals; when omitted the returned stock is booked at cost 0.
What else happens
  • Withdraws the given quantity of bundles from stock at asset_id.
  • Stocks the components back in at their listed locations (recipe quantity times the bundle quantity each), at the given cost, with the matching inventory movements and entries in the books.
Part of Sell bundles and kits.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

bundle
string
required

Identifier of the bundle (27-character KSUID string).

Body

application/json
asset_id
string
required

Location holding the bundles to take apart. It must be a location of the organization and hold bundle stock.

quantity
integer
required

Number of bundles to take apart, at least 1.

Required range: x >= 1
components
object[]
required

One entry for each component of the bundle, no more and no fewer, telling where it is returned.

Minimum array length: 1

Response

BundleStockOperationResource

bundle_id
string
required

Identifier of the bundle that was assembled or detached.

asset_id
string
required

Location where the bundles were stocked in (assembly) or taken out (detach).

quantity_assembled
integer | null
required

Number of bundles assembled. Null on a detach.

quantity_disassembled
integer | null
required

Number of bundles taken apart. Null on an assembly.

component_deductions
array | null
required

On an assembly, one entry per recipe component with stockable_id, stockable_unit_id, quantity_deducted (what was withdrawn, in the recipe unit; 0 for an untracked component) and base_quantity_deducted. Null on a detach.

component_returns
array | null
required

On a detach, one entry per component with stockable_id, stockable_unit_id, quantity_returned and base_quantity_returned. Null on an assembly.