Skip to main content
Skip to main content

updateInventoryLevels - Inventory Module Reference

This documentation provides a reference to the updateInventoryLevels method. This belongs to the Inventory Module.

This method is used to update inventory levels. Each inventory level is identified by the IDs of its associated inventory item and location.

Example

import {
initialize as initializeInventoryModule,
} from "@medusajs/inventory"

async function updateInventoryLevels (items: {
inventory_item_id: string,
location_id: string,
stocked_quantity: number
}[]) {
const inventoryModule = await initializeInventoryModule({})

const inventoryLevels = await inventoryModule.updateInventoryLevels(
items
)

// do something with the inventory levels or return them
}

Parameters

The attributes to update in each inventory level.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<InventoryLevelDTO[]>Required
The updated inventory levels' details.
Was this section helpful?