Skip to main content
Skip to main content

createInventoryItems - Inventory Module Reference

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

This method is used to create inventory items.

Example

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

async function createInventoryItems (items: {
sku: string,
requires_shipping: boolean
}[]) {
const inventoryModule = await initializeInventoryModule({})

const inventoryItems = await inventoryModule.createInventoryItems(
items
)

// do something with the inventory items or return them
}

Parameters

The details of the inventory items to create.
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<InventoryItemDTO[]>Required
The created inventory items' details.
Was this section helpful?