AI Reports

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

ColumnWhat it means
product_idThe product's ID.
stock_id1 = the default stock.
qtyQuantity in stock.
is_in_stock1 = in stock, 0 = out of stock.
manage_stock / use_config_manage_stockWhether stock is tracked, or follows the store setting.
backorders0 = no backorders, 1 = allow below zero, 2 = allow and notify the customer.
min_sale_qty / max_sale_qtySmallest and largest quantity per order.

Good to know

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:

Foreign keys

All 26 columns (Magento Open Source)

Show all columns
ColumnTypeCan be emptyMagento's description
item_idint(10) unsignedItem ID
product_idint(10) unsignedProduct ID
stock_idsmallint(5) unsignedStock ID
qtydecimal(12,4)yesQty
min_qtydecimal(12,4)Min Qty
use_config_min_qtysmallint(5) unsignedUse Config Min Qty
is_qty_decimalsmallint(5) unsignedIs Qty Decimal
backorderssmallint(5) unsignedBackorders
use_config_backorderssmallint(5) unsignedUse Config Backorders
min_sale_qtydecimal(12,4)Min Sale Qty
use_config_min_sale_qtysmallint(5) unsignedUse Config Min Sale Qty
max_sale_qtydecimal(12,4)Max Sale Qty
use_config_max_sale_qtysmallint(5) unsignedUse Config Max Sale Qty
is_in_stocksmallint(5) unsignedIs In Stock
low_stock_datetimestampyesLow Stock Date
notify_stock_qtydecimal(12,4)yesNotify Stock Qty
use_config_notify_stock_qtysmallint(5) unsignedUse Config Notify Stock Qty
manage_stocksmallint(5) unsignedManage Stock
use_config_manage_stocksmallint(5) unsignedUse Config Manage Stock
stock_status_changed_autosmallint(5) unsignedStock Status Changed Automatically
use_config_qty_incrementssmallint(5) unsignedUse Config Qty Increments
qty_incrementsdecimal(12,4)Qty Increments
use_config_enable_qty_incsmallint(5) unsignedUse Config Enable Qty Increments
enable_qty_incrementssmallint(5) unsignedEnable Qty Increments
is_decimal_dividedsmallint(5) unsignedIs Divided into Multiple Boxes for Shipping
website_idsmallint(5) unsignedWebsite ID

Related tables

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn