Skip to main content
Skip to main content

adjustInventory - Inventory Module Reference

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

This method is used to adjust the inventory level's stocked quantity. The inventory level is identified by the IDs of its associated inventory item and location.

Example

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

async function adjustInventory (
inventoryItemId: string,
locationId: string,
adjustment: number
) {
const inventoryModule = await initializeInventoryModule({})

const inventoryLevel = await inventoryModule.adjustInventory(
inventoryItemId,
locationId,
adjustment
)

// do something with the inventory level or return it.
}

Parameters

inventoryItemIdstringRequired
The ID of the associated inventory item.
locationIdstringRequired
The ID of the associated location.
adjustmentnumberRequired
A positive or negative number used to adjust the inventory level's stocked quantity.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<InventoryLevelDTO>Required
The inventory level's details.
Was this section helpful?