Skip to main content
Skip to main content

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

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

inventoryItemIdstringRequired
The ID of the inventory item to check its availability.
locationIdsstring[]Required
The IDs of the locations to check the quantity availability in.
quantitynumberRequired
The quantity to check if available for the inventory item in the specified locations.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<boolean>Required
Whether the specified quantity is available for the inventory item in the specified locations.
Was this section helpful?