Skip to main content
Skip to main content

createInventoryLevel - Inventory Module Reference

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

This method is used to create inventory level.

Example

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

async function createInventoryLevel (item: {
inventory_item_id: string
location_id: string
stocked_quantity: number
}) {
const inventoryModule = await initializeInventoryModule({})

const inventoryLevel = await inventoryModule.createInventoryLevel(
item
)

// do something with the inventory level or return it
}

Parameters

The details of the inventory level 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 level's details.
Was this section helpful?