Guides › Database reference › Categories and stock
Magento 2 cataloginventory_stock_item table
Stock settings and quantity per product for the default stock. With Multi-Source Inventory (MSI), Magento keeps it in sync with the default source.
Key columns
| Column | What it means |
|---|---|
product_id | The product's ID. |
stock_id | 1 = the default stock. |
qty | Quantity in stock. |
is_in_stock | 1 = in stock, 0 = out of stock. |
manage_stock / use_config_manage_stock | Whether stock is tracked, or follows the store setting. |
backorders | 0 = no backorders, 1 = allow below zero, 2 = allow and notify the customer. |
min_sale_qty / max_sale_qty | Smallest and largest quantity per order. |
Good to know
- Many columns come in pairs with
use_config_…: when that flag is 1, the store-wide setting applies, not this row's value. - With several sources, the real stock is per source in
inventory_source_item, and what can still be sold also subtracts open orders (reservations).
Example: In-stock products with fewer than 5 units
Works on Magento Open Source and Adobe Commerce.
SELECT (SELECT p.sku FROM catalog_product_entity p WHERE p.entity_id = si.product_id LIMIT 1) AS sku,
si.qty
FROM cataloginventory_stock_item si
WHERE si.stock_id = 1
AND si.is_in_stock = 1
AND si.qty < 5
ORDER BY si.qty;
Tested on Magento Open Source and Adobe Commerce 2.4.8. Read-only. If your tables have a prefix, add it to each table name.
Extra columns on Adobe Commerce
Adobe Commerce has 28 columns here instead of 26. The extra ones come from these Commerce features:
- Scalable Inventory:
deferred_stock_update,use_config_deferred_stock_update
Foreign keys
product_id→ catalog_product_entity.entity_idstock_id→cataloginventory_stock.stock_idproduct_id→sequence_product.sequence_valueAdobe Commerce
All 26 columns (Magento Open Source)
Show all columns
| Column | Type | Can be empty | Magento's description |
|---|---|---|---|
item_id | int(10) unsigned | Item ID | |
product_id | int(10) unsigned | Product ID | |
stock_id | smallint(5) unsigned | Stock ID | |
qty | decimal(12,4) | yes | Qty |
min_qty | decimal(12,4) | Min Qty | |
use_config_min_qty | smallint(5) unsigned | Use Config Min Qty | |
is_qty_decimal | smallint(5) unsigned | Is Qty Decimal | |
backorders | smallint(5) unsigned | Backorders | |
use_config_backorders | smallint(5) unsigned | Use Config Backorders | |
min_sale_qty | decimal(12,4) | Min Sale Qty | |
use_config_min_sale_qty | smallint(5) unsigned | Use Config Min Sale Qty | |
max_sale_qty | decimal(12,4) | Max Sale Qty | |
use_config_max_sale_qty | smallint(5) unsigned | Use Config Max Sale Qty | |
is_in_stock | smallint(5) unsigned | Is In Stock | |
low_stock_date | timestamp | yes | Low Stock Date |
notify_stock_qty | decimal(12,4) | yes | Notify Stock Qty |
use_config_notify_stock_qty | smallint(5) unsigned | Use Config Notify Stock Qty | |
manage_stock | smallint(5) unsigned | Manage Stock | |
use_config_manage_stock | smallint(5) unsigned | Use Config Manage Stock | |
stock_status_changed_auto | smallint(5) unsigned | Stock Status Changed Automatically | |
use_config_qty_increments | smallint(5) unsigned | Use Config Qty Increments | |
qty_increments | decimal(12,4) | Qty Increments | |
use_config_enable_qty_inc | smallint(5) unsigned | Use Config Enable Qty Increments | |
enable_qty_increments | smallint(5) unsigned | Enable Qty Increments | |
is_decimal_divided | smallint(5) unsigned | Is Divided into Multiple Boxes for Shipping | |
website_id | smallint(5) unsigned | Website ID |