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
inventoryItemId
stringRequiredThe ID of the inventory item.
locationId
stringRequiredThe ID of the location.
context
SharedContextA context used to share resources, such as transaction manager, between the application and the module.
context
SharedContextReturns
The retrieved inventory level.
Was this section helpful?