Skip to main content

seedInventory

Requires permission inventory:stock_level:create.

Creates a zero-quantity stock line for every active product variant that has none in a warehouse, so all products appear in stock levels. Without warehouseId it uses the default warehouse. Running it again skips lines that already exist. Needs the stock level create permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation SeedInventory {
seedInventory {
warehouseName
created
skipped
total
warehouseId
}
}

Response:

{
"data": {
"seedInventory": {
"warehouseName": "string",
"created": 0,
"skipped": 0,
"total": 0,
"warehouseId": "string"
}
}
}
seedInventory(
warehouseId: ID
): SeedInventoryResponse!

Arguments​

seedInventory.warehouseId ● ID scalar​

Only this warehouse. Omit for all warehouses.

Type​

SeedInventoryResponse object​

The result of creating empty stock rows for a warehouse.