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

# Restocks

> Refunded units and whether their stock went back on sale: restocked quantity, rate and value, by location and product.

Refunded units and whether their stock went back on sale: restocked quantity, rate and value, by location and product.

## Example

```sql theme={null}
FROM refund_lines
  SHOW refunded_quantity, restocked_quantity
  GROUP BY product_title
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY refunded_quantity DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `refunded_quantity` | Number | Units refunded. |
| `restocked_quantity` | Number | Refunded units whose stock went back on sale. |
| `restock_rate` | Percent | Restocked units as a share of refunded units. |
| `restocked_value` | Currency | Restocked units at each item's cost: stock recovered. |
| `refunded_value` | Currency | What was refunded for the units, before tax. |

## Dimensions

| Dimension | Description |
| - | - |
| `restock_type` | return, cancel, legacy\_restock or no\_restock. |
| `restock_location_name` | The location the stock went back to. |
| `refund_note` | The note left on the refund. |
| `refund_processed_date` | The day the refund was processed, in the store's timezone. |
| `product_title` | Product title (variants roll up). |
| `product_variant_title` | Product variant: splits a product into its variants. |
| `product_variant_sku` | Variant SKU. |
| `product_vendor` | Product vendor. |
| `product_type` | Shopify product type. |
| `product_title_at_time_of_sale` | The product's title when it was sold. |
| `product_variant_title_at_time_of_sale` | The variant's title when it was sold. |
| `product_variant_option_1` | The variant's first option with its name, such as Size: S. |
| `product_variant_option_2` | The variant's second option with its name, such as Colour: Blue. |
| `product_variant_option_3` | The variant's third option with its name. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `restock_type` | Text | return, cancel, legacy\_restock or no\_restock. |
| `refund_note` | Text | The note left on the refund. |
| `refund_processed_date` | Text | The day the refund was processed, in the store's timezone. |
| `product_variant_sku` | Text | Variant SKU. |
| `product_vendor` | Text | Product vendor. |
| `product_type` | Text | Shopify product type. |
| `product_title_at_time_of_sale` | Text | The product's title when it was sold. |
| `product_variant_title_at_time_of_sale` | Text | The variant's title when it was sold. |
| `product_variant_option_1` | Text | The variant's first option with its name, such as Size: S. |
| `product_variant_option_2` | Text | The variant's second option with its name, such as Colour: Blue. |
| `product_variant_option_3` | Text | The variant's third option with its name. |
| `product_title` | Text | Product title. |
| `restock_location_name` | Text | The location the stock went back to. |

## Linked records

Fields of the records this dataset reaches can be shown, grouped by and filtered on, written with a dot after the record (for example `order.name`). Each record's page lists its fields.

| Write | Record | Reached through |
| - | - | - |
| `order.<field>` | [Order](https://docs.queryful.app/queryfulql/records/order.md) | Order |
| `order.customer.<field>` | [Customer](https://docs.queryful.app/queryfulql/records/customer.md) | Order › Customer |
| `order.customer.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Order › Customer › Company |
| `order.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Order › Company |
| `order.company_location.<field>` | [Company location](https://docs.queryful.app/queryfulql/records/company_location.md) | Order › Company location |
| `order.company_location.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Order › Company location › Company |
| `order.location.<field>` | [Location](https://docs.queryful.app/queryfulql/records/location.md) | Order › Location |
| `order.market.<field>` | [Market](https://docs.queryful.app/queryfulql/records/market.md) | Order › Market |
| `product.<field>` | [Product](https://docs.queryful.app/queryfulql/records/product.md) | Product |
| `variant.<field>` | [Variant](https://docs.queryful.app/queryfulql/records/variant.md) | Variant |
| `variant.product.<field>` | [Product](https://docs.queryful.app/queryfulql/records/product.md) | Variant › Product |
| `location.<field>` | [Location](https://docs.queryful.app/queryfulql/records/location.md) | Location |
| `shop.<field>` | [Store](https://docs.queryful.app/queryfulql/records/shop.md) | Store |

## Related datasets

* [Sales](https://docs.queryful.app/queryfulql/datasets/sales.md)
* [Orders](https://docs.queryful.app/queryfulql/datasets/orders.md)
* [Order line items](https://docs.queryful.app/queryfulql/datasets/order_lines.md)
* [Returns](https://docs.queryful.app/queryfulql/datasets/returns.md)
* [Refunds](https://docs.queryful.app/queryfulql/datasets/refunds.md)
* [Sales taxes](https://docs.queryful.app/queryfulql/datasets/sales_taxes.md)
* [Write-offs](https://docs.queryful.app/queryfulql/datasets/sale_write_offs.md)
* [Profitability](https://docs.queryful.app/queryfulql/datasets/profitability.md)
* [Agentic sales](https://docs.queryful.app/queryfulql/datasets/agentic_sales.md)
* [Products bought together](https://docs.queryful.app/queryfulql/datasets/product_pairs.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.