createInventoryLevels - Inventory Next Module Reference

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

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

createInventoryLevels(data, context?): Promise<InventoryLevelDTO[]>#

This method creates inventory levels.

Example#

Code
1const inventoryLevels =2  await inventoryModuleService.createInventoryLevels([3    {4      inventory_item_id: "iitem_123",5      location_id: "loc_123",6      stocked_quantity: 10,7    },8    {9      inventory_item_id: "iitem_321",10      location_id: "loc_321",11      stocked_quantity: 20,12      reserved_quantity: 10,13    },14  ])

Parameters#

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

Returns#

PromisePromise<InventoryLevelDTO[]>
The created inventory levels.

createInventoryLevels(data, context?): Promise<InventoryLevelDTO>#

This method creates an inventory level.

Example#

Code
1const inventoryLevels =2  await inventoryModuleService.createInventoryLevels({3    inventory_item_id: "iitem_123",4    location_id: "loc_123",5    stocked_quantity: 10,6  })

Parameters#

The details of the inventory level to be created.
contextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<InventoryLevelDTO>
The created inventory level.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break