Method signature
client.inventory.getInventoryLevels(params)
Retrieves current inventory levels for a specified product. This method queries the supplier’s Inventory service to get real-time stock availability.
Parameters
The unique identifier for the product. This is the supplier’s product ID.
The type of product identifier being used. Only applicable for version 1.2.1.
Optional filters to narrow down inventory results by specific parts, sizes, or colors.
Array of part IDs to filter inventory results. Only inventory for these specific parts will be returned.
body.filters.LabelSizeArray
Array of label sizes to filter inventory results. Only inventory for these specific sizes will be returned.
body.filters.PartColorArray
Array of part colors to filter inventory results. Only inventory for these specific colors will be returned.
Return value
Returns a Promise that resolves to the inventory levels data. The response format depends on the client’s configured format option (JSON or XML).
Indicates whether the request was successful.
Array of inventory level records for the requested product.
The unique identifier for the product part.
Available quantity in stock.
Color attribute of the part.
Code example
const inventoryData = await client.inventory.getInventoryLevels({
productId: 'item_id'
});
console.log(inventoryData);
Get filter values
Retrieve available filter values for a product