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
inventoryItemId
stringRequiredThe ID of the inventory item to check its availability.
locationIds
string[]RequiredThe IDs of the locations to check the quantity availability in.
quantity
numberRequiredThe quantity to check if available for the inventory item in the specified locations.
context
SharedContextA context used to share resources, such as transaction manager, between the application and the module.
context
SharedContextReturns
Promise
Promise<boolean>RequiredWhether the specified quantity is available for the inventory item in the specified locations.
Promise
Promise<boolean>RequiredWas this section helpful?