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.

Example

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(
items
)

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

Parameters

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

Returns

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