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

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

# confirmInventory - Inventory Module Reference

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

This method is used to confirm whether the specified quantity of an inventory item is available in the specified locations.

## Example

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

async function confirmInventory (
  inventoryItemId: string,
  locationIds: string[],
  quantity: number
) {
  const inventoryModule = await initializeInventoryModule({})

  return await inventoryModule.confirmInventory(
    inventoryItemId,
    locationIds,
    quantity
  )
}
```

## Parameters

<ParameterTypes parameters={[
  {
    "name": "inventoryItemId",
    "type": "`string`",
    "description": "The ID of the inventory item to check its availability.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "locationIds",
    "type": "`string`[]",
    "description": "The IDs of the locations to check the quantity availability in.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "quantity",
    "type": "`number`",
    "description": "The quantity to check if available for the inventory item in the specified locations.",
    "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;boolean&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Whether the specified quantity is available for the inventory item in the specified locations.",
    "expandable": false,
    "children": [
      {
        "name": "boolean",
        "type": "`boolean`",
        "optional": true,
        "defaultValue": "",
        "description": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />
