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

# Product Demand

> How fast each variant sells and how long the stock lasts — the demand engine's per-variant output.

## What it is

How fast each variant sells, and how long the stock lasts. **Sold 30/90/180d** are raw units. **Sales/day (weighted)** blends those windows — recent weeks count more. **Sales/day (season removed)** is the same rate with the seasonal swing taken out, so periods are comparable. **Planned demand/day** is what procurement actually plans with: the weighted rate times the season factor of the period a purchase placed today would cover, times lifecycle and any manual factor. **Days of Stock** is stock divided by planned demand.

Every factor is exposed as its own column, so an agent can cite the exact calculation path for any number it reports. `demand_status` (`READY` / `LOW_HISTORY` / `NO_SALES_HISTORY` / `MANUAL_FORECAST` / `INSUFFICIENT_DATA`) and `demand_confidence` (`high` / `medium` / `low`) say how much history backs the rate: under 180 days of history the windows shrink and the weights renormalize (`READY`); under 30 days the rate is measured since launch (`LOW_HISTORY`); no sales plus a manual target becomes `MANUAL_FORECAST`.

## How it gets data

**Computed view** — derived automatically from [Orders](/api/data-model/orders) / [Order Line Items](/api/data-model/order-line-items), [Products](/api/data-model/products), and [Procurement Config](/api/data-model/procurement-config). Read-only; no ingest endpoint. To change the numbers, change the inputs (sales data, product master data, config).

Sales are counted per variant on `orders.placed_at`, with refunded/expired/voided orders excluded via `financial_status`. Both shops are summed when several feed one workspace.

## Fields

### Identity & stock

| Field                  | Label              | Type     | Description                                                               |
| ---------------------- | ------------------ | -------- | ------------------------------------------------------------------------- |
| `sku`                  | SKU                | text     | Variant SKU                                                               |
| `product_name`         | Product            | text     | Variant title                                                             |
| `product_family_label` | Family             | text     | Human-readable model family                                               |
| `product_family`       | —                  | text     | Source product-group id (API only — not a registered app column)          |
| `product_id`           | Product (internal) | text     | Joins to `products.id`                                                    |
| `stock_on_hand`        | Stock              | number   | Current stock from the shop sync                                          |
| `inventory_synced_at`  | Inventory synced   | datetime | When stock was last synced                                                |
| `days_of_stock`        | Days of Stock      | number   | Stock ÷ planned demand/day — how long the shelf lasts at the planned rate |
| `lifecycle_status`     | Lifecycle          | text     | Lifecycle stage from the product master                                   |
| `seasonality_profile`  | Season Profile     | text     | Seasonality profile assigned to the variant                               |
| `calculated_at`        | Calculated         | datetime | When the view was computed                                                |

### Raw sales windows

| Field                | Label          | Type   | Description                                                                                            |
| -------------------- | -------------- | ------ | ------------------------------------------------------------------------------------------------------ |
| `units_sold_14d`     | Units 14d      | number | Raw units sold, last 14 days                                                                           |
| `units_sold_28d`     | Sold 28d       | number | Raw units sold, last 28 days (trend window)                                                            |
| `units_sold_30d`     | Sold 30d       | number | Raw units sold, last 30 days                                                                           |
| `units_sold_90d`     | Sold 90d       | number | Raw units sold, last 90 days                                                                           |
| `units_sold_180d`    | Sold 180d      | number | Raw units sold, last 180 days                                                                          |
| `units_sold_365d`    | Units 365d     | number | Raw units sold, last 365 days                                                                          |
| `sales_history_days` | History (days) | number | Days of sales history backing the rates — windows shrink and weights renormalize when shorter than 180 |

### Demand rates & blend weights

| Field                         | Label                      | Type   | Description                                                                                                                                                         |
| ----------------------------- | -------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `daily_sales_28d`             | Rate 28d                   | number | Units/day over the last 28 days                                                                                                                                     |
| `daily_sales_30d`             | Rate 30d                   | number | Units/day over the last 30 days                                                                                                                                     |
| `daily_sales_90d`             | Rate 90d                   | number | Units/day over the last 90 days                                                                                                                                     |
| `daily_sales_180d`            | Rate 180d                  | number | Units/day over the last 180 days                                                                                                                                    |
| `w30` / `w90` / `w180`        | —                          | number | The actual blend weights applied to the 30/90/180-day rates (API only). Renormalized when history is shorter — the visible proof of how the weighted rate was mixed |
| `weighted_daily_demand`       | Sales/day (weighted)       | number | Blend of the window rates; recent windows weighted higher                                                                                                           |
| `deseasonalized_daily_demand` | Sales/day (season removed) | number | Weighted rate with the seasonal swing taken out — comparable across months                                                                                          |

### Seasonality & coverage window

| Field                    | Label                        | Type   | Description                                                                                               |
| ------------------------ | ---------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| `seasonal_multiplier`    | Season factor (order window) | number | Season factor of the period a purchase placed today would cover                                           |
| `seasonal_source`        | Seasonal basis               | text   | Where the factor comes from: measured from own sales, manual override, or profile                         |
| `coverage_window_start`  | Window from                  | date   | Start of the coverage window: today + lead time (an order placed now arrives here)                        |
| `coverage_window_end`    | Window to                    | date   | End of that window: arrival + target stock days                                                           |
| `coverage_window_factor` | Season factor (order window) | number | Season factor averaged over the coverage window — the factor that actually multiplies into planned demand |

### Planned demand & its factors

| Field                      | Label              | Type   | Description                                                                                                                                                                                                                    |
| -------------------------- | ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `forecast_daily_demand`    | Planned demand/day | number | The rate procurement plans with: weighted rate × season factor of the coverage window × lifecycle × manual factor                                                                                                              |
| `lifecycle_multiplier`     | Lifecycle factor   | number | Demand factor from the lifecycle stage (launch boosts, declining damps)                                                                                                                                                        |
| `manual_demand_multiplier` | Manual factor      | number | Manual factor from the product master                                                                                                                                                                                          |
| `manual_target_quantity`   | Manual target      | number | Manual forecast from the product master — used when there is no sales history                                                                                                                                                  |
| `demand_status`            | Demand status      | text   | `READY` / `LOW_HISTORY` / `NO_SALES_HISTORY` / `MANUAL_FORECAST` / `INSUFFICIENT_DATA` — how the rate was derived. Zero sales during a stockout still reads as zero demand; the status makes that visible instead of hiding it |
| `demand_confidence`        | Demand confidence  | text   | `high` / `medium` / `low` — how much history backs the rate                                                                                                                                                                    |

### Family trend (joined in)

| Field              | Label            | Type   | Description                                                                    |
| ------------------ | ---------------- | ------ | ------------------------------------------------------------------------------ |
| `trend_label`      | Trend            | status | Family trend classification (see [Family Trend](/api/data-model/family-trend)) |
| `momentum_pct`     | Momentum %       | number | Family 28-day rate vs. 90-day rate, seasonally adjusted                        |
| `trend_confidence` | Trend confidence | text   | Confidence of the trend classification                                         |

All columns are read-only. The view also carries `tenant_id` / `workspace_id` for tenant isolation — filtered automatically, never selected.

## Query it

```json theme={null}
{
  "method": "tools/call",
  "params": {
    "name": "data_query",
    "arguments": {
      "view_slug": "v_product_demand",
      "filters": { "demand_status": "READY" },
      "select_fields": ["sku", "product_name", "forecast_daily_demand", "days_of_stock", "stock_on_hand"],
      "sort_by": "days_of_stock",
      "sort_desc": false,
      "limit": 25
    }
  }
}
```
