Skip to main content
Skip to main content

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

inventoryItemIdstringRequired
The ID of the inventory item.
inputPartial<CreateInventoryItemInput>Required
The attributes to update in the inventory item.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<InventoryItemDTO>Required
The updated inventory item's details.
Was this section helpful?