Skip to main content

inventory

The inventory schema captures point-in-time snapshots across all your inventory items and products, totaled across locations. Use it for stock, inventory value, sell-through, movement, and availability views when you don't need a per-location breakdown.

Examples

ShopifyQL

FROM inventory
SHOW ending_inventory_value, ending_inventory_units, inventory_units_sold,
sell_through_rate, days_out_of_stock
TIMESERIES month WITH PERCENT_CHANGE, TOTALS
DURING this_quarter
COMPARE TO previous_period
ORDER BY month ASC
VISUALIZE sell_through_rate TYPE stacked_area

Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.

Metrics you can use when querying FROM inventory.

Anchor to days_in_inventory
days_in_inventory

The number of days from the item's first inventory snapshot in your selected period through its last.

Anchor to days_in_stock
days_in_stock

The number of days in your selected period when ending stock was above zero.

Anchor to days_of_inventory_remaining
days_of_inventory_remaining

A forecast of how many days your ending stock could last at the current sales pace. If no units sold in the selected period, then no forecast is returned.

Days of inventory remaining = ending inventory units / inventory units sold per day

Anchor to days_out_of_stock
days_out_of_stock

The number of days in your selected period when ending stock was zero or below.

Anchor to ending_inventory_retail_value
ending_inventory_retail_value

The retail value of stock on hand at the end of your selected period, in your store's currency. It uses each variant's price and the ending unit count. Untracked items, items without a price, and items with zero or negative ending stock contribute 0.

Ending inventory retail value = ending inventory units * product variant price

Anchor to ending_inventory_units
ending_inventory_units

Inventory units at the end of the given period

Anchor to ending_inventory_value
ending_inventory_value

The cost value of stock on hand at the end of your selected period, in your store's currency. It uses the item's recorded cost and ending unit count. Untracked items, items without a recorded cost, and items with zero or negative ending stock contribute 0.

Ending inventory value = ending inventory units * inventory item cost

Anchor to first_day_in_inventory
first_day_in_inventory

The first day in your selected period when the item appears in inventory snapshots.

Anchor to inventory_units_sold
inventory_units_sold

Quantity of inventory units sold in a given period

Anchor to inventory_units_sold_per_day
inventory_units_sold_per_day

Inventory units sold per day in the given period with a record of the inventory item

Inventory units sold per day = inventory units sold / days in inventory

Anchor to last_day_in_inventory
last_day_in_inventory

The last day in your selected period when the item appears in inventory snapshots.

Anchor to percent_of_inventory_sold
percent_of_inventory_sold

The share of starting stock sold during your selected period, shown as a percentage. If starting stock is zero or below, then no percentage is returned.

Percent of inventory sold = inventory units sold / starting inventory units

Anchor to sell_through_rate
sell_through_rate

The share of available units that sold during your selected period, shown as a percentage.

Sell-through rate = inventory units sold / (inventory units sold + ending inventory units)

Anchor to starting_inventory_units
starting_inventory_units

Inventory units at the start of the given period


Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.

Dimensions you can use when querying FROM inventory.

The day an inventory snapshot applies to.

Anchor to inventory_item_id
inventory_item_id

The unique Shopify identifier for the inventory item. Use inventory_item_id with product_title or product_variant_sku to show readable labels.

Anchor to month
month

The month an inventory snapshot applies to.

Anchor to product_id
product_id

The unique Shopify identifier for the product, which might have multiple variants. Use product_id with product_title to show readable labels.

Anchor to product_variant_id
product_variant_id

The unique Shopify identifier for the product variant. Use product_variant_id with product_variant_title or product_variant_sku to show readable labels.

Anchor to quarter
quarter

The quarter an inventory snapshot applies to.

Anchor to shop_id
shop_id

The unique Shopify identifier for your store. Use shop_id with shop_name to show readable store labels.

The week an inventory snapshot applies to.

The year an inventory snapshot applies to.

Anchor to inventory_cost_is_recorded
inventory_cost_is_recorded

Whether the inventory item has a cost saved in Shopify, with values true and false.

Anchor to inventory_is_tracked
inventory_is_tracked

Whether Shopify tracks inventory adjustments for the inventory item, with values true and false.

Anchor to inventory_item_cost
inventory_item_cost

The cost recorded for one unit of the inventory item, in your store's currency.

Anchor to shop_name
shop_name

Name of your store

Anchor to product_status
product_status

The product's current publishing state, with values Active, Archived, Draft, Suspended, and Unlisted.

Anchor to product_title
product_title

Display name of the product that your customers see

Anchor to product_type
product_type

Type (category) that you've assigned to the product

Anchor to product_vendor
product_vendor

Vendor of the product

Anchor to product_collection
product_collection

Collection associated with the product

Anchor to product_collections
product_collections
<>

Set of collections associated with the product

Anchor to app_product_creation
app_product_creation

The app that created the product, shown as an app name.

Anchor to product_tag
product_tag

Tag associated with the product

Anchor to product_tags
product_tags
<>

Set of tags associated with the product

Anchor to product_variant_abc_grade
product_variant_abc_grade

The ABC grade assigned to the product variant based on its share of revenue. A-grade variants account for about 80% of revenue, B-grade for 15%, and C-grade for 5%.

Anchor to product_variant_sku
product_variant_sku

SKU of the product variant

Anchor to product_variant_title
product_variant_title

Display name of the product variant



Was this page helpful?