Skip to main content
Skip to main content

deleteInventoryItem - Inventory Module Reference

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

This method is used to delete an inventory item or multiple inventory items. The inventory items are only soft deleted and can be restored using the restoreInventoryItem method.

Example

import { 
initialize as initializeInventoryModule,
} from "@medusajs/inventory"

async function deleteInventoryItem (
inventoryItems: string[]
) {
const inventoryModule = await initializeInventoryModule({})

await inventoryModule.deleteInventoryItem(
inventoryItems
)
}

Parameters

inventoryItemIdstring | string[]Required
The ID(s) of the inventory item(s) to delete.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when the inventory item(s) are successfully deleted.
Was this section helpful?