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
inventoryItemIdstringRequiredThe ID of the inventory item to check its availability.
locationIdsstring[]RequiredThe IDs of the locations to check the quantity availability in.
quantitynumberRequiredThe quantity to check if available for the inventory item in the specified locations.
contextSharedContextA context used to share resources, such as transaction manager, between the application and the module.
contextSharedContextReturns
PromisePromise<boolean>RequiredWhether the specified quantity is available for the inventory item in the specified locations.
PromisePromise<boolean>RequiredWas this section helpful?