---
displayed_sidebar: inventoryReference
slug: /references/inventory/deleteInventoryItem
sidebar_label: deleteInventoryItem
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# 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](inventory.IInventoryService.restoreInventoryItem.mdx) method.

## Example

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

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

  await inventoryModule.deleteInventoryItem(
    inventoryItems
  )
}
```

## Parameters

<ParameterTypes parameters={[
  {
    "name": "inventoryItemId",
    "type": "`string` \\| `string`[]",
    "description": "The ID(s) of the inventory item(s) to delete.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "context",
    "type": "[SharedContext](../../inventory/interfaces/inventory.SharedContext.mdx)",
    "description": "A context used to share resources, such as transaction manager, between the application and the module.",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "manager",
        "type": "`EntityManager`",
        "description": "An instance of an entity manager.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "transactionManager",
        "type": "`EntityManager`",
        "description": "An instance of a transaction manager.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

## Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;void&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves when the inventory item(s) are successfully deleted.",
    "expandable": false,
    "children": []
  }
]} />
