updateInventoryLevels - Inventory Next Module Reference

This documentation provides a reference to the updateInventoryLevels 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.

updateInventoryLevels(updates, context?): Promise<InventoryLevelDTO[]>#

This method updates existing inventory levels.

Example#

Code
1const inventoryLevels =2  await inventoryModuleService.updateInventoryLevels([3    {4      inventory_item_id: "iitem_123",5      location_id: "loc_123",6      id: "ilev_123",7      stocked_quantity: 20,8    },9  ])

Parameters#

The list of The attributes to update in an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
contextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<InventoryLevelDTO[]>
The updated inventory levels.

updateInventoryLevels(updates, context?): Promise<InventoryLevelDTO>#

This method updates an existing inventory level.

Example#

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

Parameters#

The attributes to update in an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
contextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<InventoryLevelDTO>
The updated 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