Guides › Database reference › Categories and stock
Magento 2 inventory_source_item table
Multi-Source Inventory: the quantity and stock status of each SKU in each source (warehouse or shop).
Key columns
| Column | What it means |
|---|---|
source_code | The source, linking to inventory_source.source_code. The built-in one is default. |
sku | The product's SKU. MSI links by SKU, not by product ID. |
quantity | Quantity at that source. |
status | 1 = in stock, 0 = out of stock at that source. |
Good to know
- Sources are grouped into stocks (
inventory_source_stock_link), and each website sells from one stock (inventory_stock_sales_channel). - Salable quantity = the stock's source quantities minus reservations for orders not yet shipped (
inventory_reservation).
Example: SKUs and total quantity per source
Works on Magento Open Source and Adobe Commerce.
SELECT source_code, COUNT(*) AS skus, SUM(quantity) AS quantity, SUM(status = 0) AS out_of_stock
FROM inventory_source_item
GROUP BY source_code
ORDER BY source_code;
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.
This table has the same 5 columns on Magento Open Source and Adobe Commerce.
Foreign keys
source_code→inventory_source.source_code
All 5 columns (Magento Open Source)
Show all columns
| Column | Type | Can be empty | Magento's description |
|---|---|---|---|
source_item_id | int(10) unsigned | ||
source_code | varchar(255) | ||
sku | varchar(64) | ||
quantity | decimal(12,4) | ||
status | smallint(5) unsigned |