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.
context
SharedContextA context used to share resources, such as transaction manager, between the application and the module.
context
SharedContextReturns
The created inventory level's details.
Was this section helpful?