> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stockful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Pricing

> Recorded price changes per variant over time.

Recorded price changes per variant over time.

## Example

```sql theme={null}
FROM price_history
  SHOW avg_price, avg_compare_at
  GROUP BY product
  ORDER BY avg_price DESC
```

## Metrics

| Metric           | Type     | Description                                                               |
| ---------------- | -------- | ------------------------------------------------------------------------- |
| `avg_price`      | Currency | Average observed price in the period.                                     |
| `avg_compare_at` | Currency | Average observed compare-at price in the period.                          |
| `avg_cost`       | Currency | Average observed unit cost in the period (from cost-change captures).     |
| `discount_depth` | Percent  | Average markdown vs compare-at price ((compare-at − price) ÷ compare-at). |
| `price_changes`  | Number   | Number of logged price/cost changes in the period.                        |

## Dimensions

| Dimension      | Description                                                                                                                                                                                 |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `product`      | Product with image, rendered as a single cell (variants roll up).                                                                                                                           |
| `sku`          | Variant SKU - splits a product-grain report into variant rows.                                                                                                                              |
| `variant`      | Variant title (e.g. "Small / Blue"), shown as a dash for products without options. Group by product too - on its own, variants sharing a title across different products fall into one row. |
| `vendor`       | Product vendor.                                                                                                                                                                             |
| `product_type` | Shopify product type.                                                                                                                                                                       |
| `source`       | Where the change was observed (webhook or sync).                                                                                                                                            |

## Filters

| Filter                     | Type   | Description                                                                 |
| -------------------------- | ------ | --------------------------------------------------------------------------- |
| `collection`               | Number | Restrict to products in the selected collection(s).                         |
| `category`                 | Text   | Restrict to products in the selected category (matches sub-categories too). |
| `sales_channel`            | Number | Restrict to products published to the selected sales channel.               |
| `region_catalog`           | Number | Restrict to products in the selected region (market) catalog.               |
| `b2b_catalog`              | Number | Restrict to products in the selected B2B (market) catalog.                  |
| `company_location_catalog` | Number | Restrict to products in the selected company-location catalog.              |
| `vendor`                   | Text   | Product vendor.                                                             |
| `product_type`             | Text   | Shopify product type.                                                       |
| `sku`                      | Text   | Variant SKU.                                                                |
| `source`                   | Text   | What logged the price/cost change (e.g. product update, cost capture).      |
| `price`                    | Number | Observed selling price.                                                     |
| `compare_at_price`         | Number | Observed compare-at price.                                                  |
| `cost`                     | Number | Observed unit cost.                                                         |

## Related datasets

* [Forecast accuracy](/stockfulql/datasets/forecast_runs)
* [Stock adjustments](/stockfulql/datasets/adjustments)
