Skip to main content
Skip to main content

createInventoryLevels - Inventory Module Reference

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

This method is used to create inventory levels.


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

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

const inventoryLevels = await inventoryModule.createInventoryLevels(

// do something with the inventory levels or return them


The details of the inventory levels to create.
A context used to share resources, such as transaction manager, between the application and the module.


The created inventory levels' details.
Was this section helpful?