Skip to main content
Skip to main content

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

inventoryItemIdstringRequired
The ID of the inventory item.
locationIdstringRequired
The ID of the location.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<InventoryLevelDTO>Required
The retrieved inventory level.
Was this section helpful?