> ## 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.

# Purchasing

> Purchase order lines: spend, units ordered and received, supplier and landed cost. Placed orders only.

Purchase order lines: spend, units ordered and received, supplier and landed cost. Placed orders only.

## Example

```sql theme={null}
FROM purchasing
  SHOW spend, landed_spend
  GROUP BY product
  ORDER BY spend DESC
```

## Metrics

| Metric               | Type     | Description                                                                                                    |
| -------------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `spend`              | Currency | Ordered value at the price paid - units ordered x unit cost, in your currency.                                 |
| `landed_spend`       | Currency | Received value at true landed cost - units received x landed unit cost, so freight and duties are included.    |
| `on_order_value`     | Currency | Value of units ordered but not yet received - cash committed and still to land.                                |
| `units_ordered`      | Number   | Total units ordered across the matching PO lines.                                                              |
| `units_received`     | Number   | Total units accepted into stock.                                                                               |
| `units_rejected`     | Number   | Units refused at receiving - damaged, wrong, or short-shipped.                                                 |
| `units_outstanding`  | Number   | Units ordered that haven't been received yet.                                                                  |
| `po_count`           | Number   | Number of distinct purchase orders.                                                                            |
| `avg_unit_cost`      | Currency | Quantity-weighted average price paid per unit.                                                                 |
| `avg_landed_cost`    | Currency | Quantity-weighted average landed cost per received unit, including allocated freight and duties.               |
| `landed_uplift_pct`  | Percent  | How much more the goods truly cost once freight and duties land, as a % over the quoted price.                 |
| `price_variance`     | Currency | Charged minus the supplier's price-list price, x units ordered. Positive means you paid over the agreed price. |
| `price_variance_pct` | Percent  | Charged vs the supplier's price-list price as a %. Positive means over the agreed price.                       |
| `fill_rate`          | Percent  | Share of ordered units actually received.                                                                      |
| `rejection_rate`     | Percent  | Share of delivered units refused at receiving.                                                                 |
| `first_ordered_date` | Date     | Earliest order date in the range.                                                                              |
| `last_ordered_date`  | Date     | Most recent order date in the range.                                                                           |

## 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. |
| `supplier`       | Who the stock was bought from. Not the same as the brand - see Vendor.                                                                                                                      |
| `vendor`         | Product brand, grouping under a blank value when unset. Not who you bought from.                                                                                                            |
| `product_type`   | Product type, grouping under a blank value when unset.                                                                                                                                      |
| `destination`    | Where the stock was ordered into.                                                                                                                                                           |
| `po_status`      | Purchase order status (ordered, partially received, received, closed, cancelled).                                                                                                           |
| `purchase_order` | The individual purchase order reference.                                                                                                                                                    |
| `cost_source`    | Where the line's price came from (price list, last paid, manual).                                                                                                                           |
| `ordered_date`   | The day the order was placed.                                                                                                                                                               |
| `expected_date`  | The day the stock is due to land. Blank when no arrival date was agreed.                                                                                                                    |
| `ship_date`      | The day the supplier is due to ship. Blank when no ship date was agreed.                                                                                                                    |
| `cancel_date`    | The day the order can be cancelled if it hasn't shipped. Blank when no cancel date was agreed.                                                                                              |

## 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.              |
| `product_title`            | Text   | Product title.                                                              |
| `sku`                      | Text   | Variant SKU.                                                                |
| `supplier_name`            | Text   | Who the stock was bought from.                                              |
| `vendor`                   | Text   | Product brand.                                                              |
| `product_type`             | Text   | Product type.                                                               |
| `po_status`                | Text   | Purchase order status.                                                      |
| `destination_name`         | Text   | Destination location name.                                                  |
| `cost_source`              | Text   | Where the line price came from.                                             |
| `unit_cost_base`           | Number | Price paid per unit.                                                        |
| `fully_paid`               | Text   | Whether the purchase order has been paid in full.                           |
| `expected_at`              | Text   | The day the stock is due to land.                                           |
| `ship_at`                  | Text   | The day the supplier is due to ship.                                        |
| `cancel_at`                | Text   | The day the order can be cancelled if it hasn't shipped.                    |

## Related datasets

* [Cost history](/stockfulql/datasets/cost_history)
* [Purchase costs](/stockfulql/datasets/purchase_costs)
* [Goods receipts](/stockfulql/datasets/receipts)
* [Supplier performance](/stockfulql/datasets/supplier_performance)
