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
inventoryItemId
stringRequiredThe ID of the inventory item.
The attributes to update in the inventory item.
context
SharedContextA context used to share resources, such as transaction manager, between the application and the module.
context
SharedContextReturns
The updated inventory item's details.
Was this section helpful?