retrieveInventoryLevel - Inventory Module Reference
This documentation provides a reference to the retrieveInventoryLevel method. This belongs to the Inventory Module.
This method is used to retrieve an inventory level for an inventory item and a location.
Example
import {
initialize as initializeInventoryModule,
} from "@medusajs/inventory"
async function retrieveInventoryLevel (
inventoryItemId: string,
locationId: string
) {
const inventoryModule = await initializeInventoryModule({})
const inventoryLevel = await inventoryModule.retrieveInventoryLevel(
inventoryItemId,
locationId
)
// do something with the inventory level or return it
}
Parameters
inventoryItemIdstringRequiredThe ID of the inventory item.
locationIdstringRequiredThe ID of the location.
contextSharedContextA context used to share resources, such as transaction manager, between the application and the module.
contextSharedContextReturns
The retrieved inventory level.
Was this section helpful?