updateInventoryItem - Inventory Module Reference
This documentation provides a reference to the updateInventoryItem method. This belongs to the Inventory Module.
This method is used to update an inventory item.
Example
import {
initialize as initializeInventoryModule,
} from "@medusajs/inventory"
async function updateInventoryItem (
inventoryItemId: string,
sku: string
) {
const inventoryModule = await initializeInventoryModule({})
const inventoryItem = await inventoryModule.updateInventoryItem(
inventoryItemId,
{
sku
}
)
// do something with the inventory item or return it
}
Parameters
inventoryItemIdstringRequiredThe ID of the inventory item.
The attributes to update in the inventory item.
contextSharedContextA context used to share resources, such as transaction manager, between the application and the module.
contextSharedContextReturns
The updated inventory item's details.
Was this section helpful?