BigblueDevelopers

List bundle inventories

Get the number of available bundles, calculated from their components.

POST/bigblue.storeapi.v1.PublicAPI/ListBundleInventories

Returns one row per bundle and warehouse. Bundles have no stock of their own, so the counts are calculated from the components:

available    = min(floor(component.available / component.quantity))
in_warehouse = min(floor(component.in_warehouse / component.quantity))

Only these two counts are returned. For damaged, expired and backordered units, check the components with ListInventories.

Request body

warehousestring
Only return this warehouse.
Pattern^([A-Za-z]{2}-[A-Za-z]{3}-[0-9]{3}|)$
page_sizeintegerdefault 1000
Rows per page.
page_tokenstring
The next_page_token from the previous response.

You can't filter by bundle.

Responses

200A page of bundle inventory rows.
bundle_inventoriesBundleInventory[]
One row per bundle and warehouse.
next_page_tokenstring
Token for the next page. Missing on the last page.

BundleInventory

bundlestring
Bundle ID.
Pattern^[A-Za-z0-9]{4}BU-[A-Za-z0-9]{6}-[A-Za-z0-9]{4}$
warehousestring
Warehouse ID.
Pattern^[A-Za-z]{2}-[A-Za-z]{3}-[0-9]{3}$
availableinteger
Bundles you can sell now.
in_warehouseinteger

Bundles that could be made from good stock, including reserved units.

POST/bigblue.storeapi.v1.PublicAPI/ListBundleInventories
Request
{ "warehouse": "FR-CDG-001", "page_size": 100 }
200
{
  "bundle_inventories": [
    {
      "bundle": "BGBLBU-KITSTA-2024",
      "warehouse": "FR-CDG-001",
      "available": 3,
      "in_warehouse": 5
    }
  ]
}
Find the limiting component
const { bundle } = await call('GetBundle', { id: 'BGBLBU-KITSTA-2024' });

const rows = await Promise.all(
  bundle.components.map(async (c) => {
    const inv = await call('ListInventories', {
      product: c.product,
      warehouse: 'FR-CDG-001',
    });
    const available = inv.inventories?.[0]?.available ?? 0;
    return { product: c.product, bundles: Math.floor(available / c.quantity) };
  }),
);

rows.sort((a, b) => a.bundles - b.bundles);
// rows[0] is the component that limits the bundle.