# Catalog and discovery

Products, listings, filters, search, merchandising entities, and product history.

These pages list the exact data fields available to hosted Vascula themes. Add a root name such as `product` to a section's `ctx_needs`, then read it directly as `product.title` in the template. The `ctx.` prefix shown here identifies the public contract; do not include that prefix in a Vascula expression. Required fields are present whenever their containing object is present. Optional fields may be absent, and nullable fields may be present as null. `[]` marks an array item and `{key}` marks a key selected at runtime. Named types such as Price and Media are detailed on Shared data shapes.

## ctx.product

The routed product with variants, options, pricing, availability, session state, and storefront-visible metafields. Available on Product routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.product` | Object | Declared root |  |
| `ctx.product.available_for_sale` | Boolean | Required |  |
| `ctx.product.barcode` | String or null | Required; may be null |  |
| `ctx.product.brand` | String or null | Optional; may be null | The brand's name in the shopper's language; null when the product has no brand. |
| `ctx.product.brand_ref` | Entity | Optional | The brand as an entity (url, image, description, product_count, metafields). Absent when the product has no brand. |
| `ctx.product.cart_requirements` | Array of object | Optional |  |
| `ctx.product.cart_requirements[].key` | String | Required |  |
| `ctx.product.cart_requirements[].namespace` | String | Required |  |
| `ctx.product.categories` | Array of object | Required | The categories the product is assigned to, by name in the shopper's language: id, name and slug in that language, and url, the category's page. |
| `ctx.product.categories[].id` | Integer | Required |  |
| `ctx.product.categories[].name` | String | Required |  |
| `ctx.product.categories[].slug` | String | Required |  |
| `ctx.product.categories[].url` | URL | Required |  |
| `ctx.product.collections` | Array of collection ref | Optional |  |
| `ctx.product.condition` | String | Optional |  |
| `ctx.product.country_of_origin` | String or null | Optional; may be null |  |
| `ctx.product.description` | HTML or null | Required; may be null |  |
| `ctx.product.dimension_unit` | String or null | Optional; may be null |  |
| `ctx.product.display_variant` | Variant or null | Required; may be null |  |
| `ctx.product.featured_image` | Media or null | Required; may be null |  |
| `ctx.product.gift_only` | Boolean | Required |  |
| `ctx.product.height` | Number or null | Optional; may be null |  |
| `ctx.product.hs_code` | String or null | Optional; may be null | The product's customs HS code; null when not set. |
| `ctx.product.id` | Integer | Required |  |
| `ctx.product.identifier_status` | String | Optional |  |
| `ctx.product.images` | Array of media or null | Required |  |
| `ctx.product.in_carts` | Integer | Optional | How many shoppers' carts hold the product, measured every ten minutes (0 when none). For a "In 12 carts" line. |
| `ctx.product.inventory_status` | String | Required | in_stock, low_stock or out_of_stock: for a product with options, its best-stocked variant's. low_stock is 1 up to the merchant's Overall Low Stock Threshold available (5 when none is set; in pickup mode the pickup location's own Low Stock Threshold first). Display only: what can be bought is available_for_sale and quantity_max. |
| `ctx.product.is_gift_card` | Boolean | Required |  |
| `ctx.product.length` | Number or null | Optional; may be null |  |
| `ctx.product.max_order_quantity` | Integer or null | Required; may be null |  |
| `ctx.product.metafields` | Metafields | Optional |  |
| `ctx.product.mpn` | String or null | Optional; may be null |  |
| `ctx.product.no_manufacturer_identifiers` | Boolean | Optional |  |
| `ctx.product.notify_me_eligible` | Boolean | Required |  |
| `ctx.product.offers` | Array of product offer | Optional | Product page only. The offers this product qualifies for in the visitor's market (automatic discounts, discount codes and online payment discounts the store chose to show on product pages), in display order, at most 10; empty when none. Print them as given. |
| `ctx.product.options` | Array of option | Required |  |
| `ctx.product.price` | Price or null | Required; may be null |  |
| `ctx.product.price_notes` | Object | Optional | Product page only. The shown price's tax and duty notes from the market's setup for the shopper's country, each on its own (null when it does not apply), so the theme shows the ones the merchant chose. Print each as given. |
| `ctx.product.price_notes.duty` | String or null | Required; may be null | The duty note: who pays import duties (on delivery, at checkout or included; at checkout only where the destination has an enabled duty rule in the shopper's currency, otherwise on delivery), for example "Import duties and taxes may be due on delivery." Null unless a delivered item ships into the shopper's country from another one, or when the merchant emptied it in storefront text. |
| `ctx.product.price_notes.tax` | String or null | Required; may be null | The tax note: what the shown price says about tax (included, estimated, excluded or calculated at checkout), for example "Tax included." Null where no tax is charged on it, or when the merchant emptied it in storefront text. |
| `ctx.product.price_range` | Price range or null | Required; may be null |  |
| `ctx.product.price_tiers` | Array of price tier | Required |  |
| `ctx.product.purchase_state` | String (`in_stock`, `unavailable`, `on_request`) | Required |  |
| `ctx.product.quantity_available` | Integer or null | Optional; may be null |  |
| `ctx.product.quantity_max` | Integer or null | Required; may be null |  |
| `ctx.product.rating` | Rating | Optional |  |
| `ctx.product.related` | Array of product card | Optional |  |
| `ctx.product.requested_options` | Array of selected option | Required |  |
| `ctx.product.requires_shipping` | Boolean | Required | False for items that don't need shipping (services, digital goods, tickets, gift cards). |
| `ctx.product.selected_variant` | Variant or null | Required; may be null |  |
| `ctx.product.selection_complete` | Boolean | Required |  |
| `ctx.product.seo_description` | String or null | Required; may be null |  |
| `ctx.product.seo_title` | String or null | Required; may be null |  |
| `ctx.product.session_state` | Object | Required |  |
| `ctx.product.session_state.cart` | Object | Required |  |
| `ctx.product.session_state.cart.direct_line_count` | Integer | Required |  |
| `ctx.product.session_state.cart.direct_quantity` | Integer | Required |  |
| `ctx.product.session_state.cart.line_count` | Integer | Required |  |
| `ctx.product.session_state.cart.quantity` | Integer | Required |  |
| `ctx.product.session_state.wishlist` | Object | Required |  |
| `ctx.product.session_state.wishlist.direct_item_count` | Integer | Required |  |
| `ctx.product.session_state.wishlist.direct_saved` | Boolean | Required |  |
| `ctx.product.session_state.wishlist.item_count` | Integer | Required |  |
| `ctx.product.session_state.wishlist.saved` | Boolean | Required |  |
| `ctx.product.shipping_price` | Presented money or null | Optional; may be null | Product page only. The per-item shipping price checkout adds to the shipping charge for each unit, on top of the method's rate (free and threshold rates included), in the shopper's currency: The product's own per-item shipping prices (a variant with shipping prices of its own uses those instead: see each variant's shipping_price). The currency's own price when set, else the store currency's converted at the store's rate. Null when the item doesn't need shipping or has no per-item shipping price. It never changes free-shipping or price-tier qualification. For a "+ ₹40 shipping per item" line. |
| `ctx.product.short_description` | String or null | Required; may be null |  |
| `ctx.product.sku` | String or null | Required; may be null |  |
| `ctx.product.slug` | String | Required |  |
| `ctx.product.tag_refs` | Array of object | Required | The product's tags as id, name, slug and url, in name order. |
| `ctx.product.tag_refs[].id` | Integer | Required |  |
| `ctx.product.tag_refs[].name` | String | Required | The tag's name in the shopper's language (the source name when it has no translation). |
| `ctx.product.tag_refs[].slug` | String | Required | The tag's slug: the same in every language, and the value the tags filter takes (filter.tags=<slug>). Tags have no page of their own. |
| `ctx.product.tag_refs[].url` | URL | Required | The shop filtered by this tag while the store's tag filter is on; otherwise search results for the tag's name while search returns products, else the shop. |
| `ctx.product.tags` | Array of string or null | Required; may be null | The product's tag names in the shopper's language, in name order: the names of tag_refs. |
| `ctx.product.title` | String | Required |  |
| `ctx.product.type` | String | Required |  |
| `ctx.product.url` | URL | Required |  |
| `ctx.product.variants` | Array of variant | Required |  |
| `ctx.product.vendor` | String or null | Required; may be null | The vendor's name in the shopper's language. |
| `ctx.product.vendor_ref` | Entity | Optional | The vendor as an entity (url, image, description, product_count, metafields). Absent when the product has no vendor. |
| `ctx.product.weight` | Number or null | Optional; may be null |  |
| `ctx.product.weight_unit` | String or null | Optional; may be null |  |
| `ctx.product.width` | Number or null | Optional; may be null |  |

## ctx.products

A routed product grid with platform search, sort, and pagination state. Available on Shop, Search, Collection, Category, Vendor, Brand routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.products` | Object | Declared root |  |
| `ctx.products.items` | Array of product card | Required |  |
| `ctx.products.pagination` | Pagination | Required |  |
| `ctx.products.search` | Object | Required |  |
| `ctx.products.search.enabled` | Boolean | Required | Whether ?q= searches inside this listing: true while storefront search is on and products are one of the merchant's search result types (Online Store › Search). While false, ?q= is ignored and the grid is the whole listing: hide the listing's search box. |
| `ctx.products.search.query` | String | Required | The search applied to this grid (?q=), "" when there is none or enabled is false. Every word must match the product (its title, description, vendor, brand, categories, tags, option values, SKUs and searchable metafields, in the page's language, with the store's synonyms and other forms of each word); the last word also matches as a prefix. Filters, sort and paging apply on top, and page links keep q. |
| `ctx.products.search.url` | URL | Required | This listing's address in the page's language and country (no query): the action of a GET form with a q field. A page whose grid is searched is noindex,follow and canonical to the plain listing. |
| `ctx.products.sort` | Object | Required |  |
| `ctx.products.sort.current` | String | Required |  |
| `ctx.products.sort.options` | Array of object | Required | The sorts the merchant offers, in the merchant's order (Catalog › Sorting). Hidden sorts are left out; a search page lists relevance first. |
| `ctx.products.sort.options[].key` | String | Required | The ?sort= value: featured, best_selling, created_at, title, price_asc, price_desc, or relevance on a search page. |
| `ctx.products.sort.options[].label` | String | Required | The sort's name for the shopper, in their language: the merchant's own name from Catalog › Sorting, or Tringify's name. Print it as given; never map key to your own words. |
| `ctx.products.sort.options[].selected` | Boolean | Required |  |
| `ctx.products.sort.options[].url` | URL | Required |  |

## ctx.filters

Platform-resolved filters and active filter state for the current product listing. Available on Shop, Search, Collection, Category, Vendor, Brand routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.filters` | Object | Declared root |  |
| `ctx.filters.applied_count` | Integer | Required |  |
| `ctx.filters.clear_url` | URL | Required |  |
| `ctx.filters.count_label` | String | Optional | "20,000+" when counts_estimated, else "". |
| `ctx.filters.counts_estimated` | Boolean | Optional | True when the listing holds more than 20,000 products: every value's count is then a lower bound over its first 20,001 products, and no filter is hidden for failing to narrow the results. |
| `ctx.filters.inputs` | Array of object | Required |  |
| `ctx.filters.inputs[].name` | String | Required |  |
| `ctx.filters.inputs[].value` | String | Required |  |
| `ctx.filters.items` | Array of object | Required |  |
| `ctx.filters.items[].allow_multiple` | Boolean | Required |  |
| `ctx.filters.items[].applied_count` | Integer | Required |  |
| `ctx.filters.items[].clear_url` | URL | Required |  |
| `ctx.filters.items[].display_type` | String | Required |  |
| `ctx.filters.items[].filter_type` | String | Required |  |
| `ctx.filters.items[].key` | String | Required | The filter's key in links: attribute:<attribute slug>, metafield:<namespace.key>, or a built-in key (price, availability, on_sale, vendor, brand, tags, categories, rating, discount). The same in every language. The built-in range filters are price (money in the shopper's currency), rating (the average approved review rating, 1 to 5) and discount (whole percent off the regular price while a sale runs, 0 without one): show rating as stars or a number and discount with a percent sign. |
| `ctx.filters.items[].label` | String | Required | The filter's name in the shopper's language: the merchant's translation of the filter; for an attribute or metafield filter still named as its source, the attribute's or definition's translated name; for a built-in filter the platform's label; else the name as the merchant wrote it. |
| `ctx.filters.items[].range` | Object or null | Required; may be null |  |
| `ctx.filters.items[].range.action` | URL | Required |  |
| `ctx.filters.items[].range.applied_max` | String | Required |  |
| `ctx.filters.items[].range.applied_min` | String | Required |  |
| `ctx.filters.items[].range.clear_url` | URL | Required |  |
| `ctx.filters.items[].range.inputs` | Array of object | Required |  |
| `ctx.filters.items[].range.inputs[].name` | String | Required |  |
| `ctx.filters.items[].range.inputs[].value` | String | Required |  |
| `ctx.filters.items[].range.integer` | Boolean | Required | True when the filter takes whole numbers only (discount, integer metafields): step the inputs by 1. |
| `ctx.filters.items[].range.max` | Decimal string or null | Required; may be null |  |
| `ctx.filters.items[].range.max_input` | String | Required |  |
| `ctx.filters.items[].range.min` | Decimal string or null | Required; may be null | The lowest value among the results; max the highest. A whole-number range (integer) has the minimum rounded down and the maximum rounded up, so steps of one reach every product. Price bounds are whole units of the shopper's currency, rounded the same way. |
| `ctx.filters.items[].range.min_input` | String | Required |  |
| `ctx.filters.items[].range.unit` | String (`money`, `percent`, `rating`) or null | Required; may be null | What the numbers measure: money (the shopper's currency; print with the money filter, or the price object's min_money and max_money), percent (print with a percent sign), rating (average review rating, 1 to 5); null for a plain number such as a metafield's. |
| `ctx.filters.items[].values` | Array of object | Required |  |
| `ctx.filters.items[].values[].color` | String or null | Required; may be null |  |
| `ctx.filters.items[].values[].count` | Integer | Required |  |
| `ctx.filters.items[].values[].count_estimated` | Boolean | Optional | True when the listing holds more than 20,000 products: counts are then taken over its first 20,001 products and are lower bounds. |
| `ctx.filters.items[].values[].count_label` | String | Optional | count to print: "12", or "12+" when count_estimated. |
| `ctx.filters.items[].values[].image` | Media or null | Required; may be null | The value's image as media (url, alt_text, width, height), for an image attribute's option: a swatch can carry alt text and reserve the photo's own shape. Null when it has none. |
| `ctx.filters.items[].values[].image_url` | String or null | Required; may be null | The value's image (an image attribute's option); null when it has none. The same file as image.url. |
| `ctx.filters.items[].values[].key` | String | Required | The value's token in links (filter.<key>=<token>). An attribute option's value (its stable key, the same in every language). A vendor, brand or category value is its slug in the shopper's language; those filters take a slug in any language (or an old one whose change kept its redirect) and every link the platform builds carries this one, so a filter state has one URL. |
| `ctx.filters.items[].values[].label` | String | Required | The value's name in the shopper's language: an attribute option's translated label, a vendor, brand, category or tag's translated name, a metafield choice's translated label. |
| `ctx.filters.items[].values[].selectable` | Boolean | Required |  |
| `ctx.filters.items[].values[].selected` | Boolean | Required |  |
| `ctx.filters.items[].values[].url` | URL | Required |  |
| `ctx.filters.items[].values_page` | Object or null | Required; may be null |  |
| `ctx.filters.items[].values_page.action` | URL | Required |  |
| `ctx.filters.items[].values_page.clear_url` | URL | Required |  |
| `ctx.filters.items[].values_page.has_next` | Boolean | Required |  |
| `ctx.filters.items[].values_page.has_previous` | Boolean | Required |  |
| `ctx.filters.items[].values_page.inputs` | Array of object | Required |  |
| `ctx.filters.items[].values_page.inputs[].name` | String | Required |  |
| `ctx.filters.items[].values_page.inputs[].value` | String | Required |  |
| `ctx.filters.items[].values_page.limit` | Integer | Required |  |
| `ctx.filters.items[].values_page.next_url` | URL | Required |  |
| `ctx.filters.items[].values_page.offset` | Integer | Required |  |
| `ctx.filters.items[].values_page.previous_url` | URL | Required |  |
| `ctx.filters.items[].values_page.search` | String | Required |  |
| `ctx.filters.items[].values_page.search_input` | String | Required |  |
| `ctx.filters.items[].values_page.total` | Integer | Required |  |
| `ctx.filters.price` | Object | Optional |  |
| `ctx.filters.price.action` | URL | Required |  |
| `ctx.filters.price.applied_max` | String | Required |  |
| `ctx.filters.price.applied_max_money` | Money input or null | Required; may be null |  |
| `ctx.filters.price.applied_min` | String | Required |  |
| `ctx.filters.price.applied_min_money` | Money input or null | Required; may be null |  |
| `ctx.filters.price.clear_url` | URL | Required |  |
| `ctx.filters.price.currency_code` | String | Required |  |
| `ctx.filters.price.inputs` | Array of object | Required |  |
| `ctx.filters.price.inputs[].name` | String | Required |  |
| `ctx.filters.price.inputs[].value` | String | Required |  |
| `ctx.filters.price.integer` | Boolean | Required | True when the filter takes whole numbers only (discount, integer metafields): step the inputs by 1. |
| `ctx.filters.price.label` | String | Required |  |
| `ctx.filters.price.max` | Decimal string or null | Required; may be null |  |
| `ctx.filters.price.max_input` | String | Required |  |
| `ctx.filters.price.max_money` | Money input or null | Required; may be null |  |
| `ctx.filters.price.min` | Decimal string or null | Required; may be null | The lowest value among the results; max the highest. A whole-number range (integer) has the minimum rounded down and the maximum rounded up, so steps of one reach every product. Price bounds are whole units of the shopper's currency, rounded the same way. |
| `ctx.filters.price.min_input` | String | Required |  |
| `ctx.filters.price.min_money` | Money input or null | Required; may be null |  |
| `ctx.filters.price.unit` | String (`money`, `percent`, `rating`) or null | Required; may be null | What the numbers measure: money (the shopper's currency; print with the money filter, or the price object's min_money and max_money), percent (print with a percent sign), rating (average review rating, 1 to 5); null for a plain number such as a metafield's. |

Use `filters` in a section’s `ctx_needs`. Iterate `filters.items` to render enabled choice, numeric, and price filters in merchant order. `filters.price` also provides the price currency and money objects; do not render a second price control from it. The same contract is available on shop, search, collection, category, vendor, and brand product listings.

`filters.items` holds only filters that can narrow the current results, which include every applied filter. A range (price included) is left out when its results share one value (`min` equals `max`); a choice or toggle filter is left out when every returned choice matches all the results, as when every product is in stock or on sale. An applied filter is always kept so the shopper can remove it. Over a sampled listing (`counts_estimated`) choice and toggle filters, and custom ranges, are kept, since their counts and bounds are a sample's. `filters.price` is present only while the price item is. When nothing can narrow, `items` is empty: hide the filter button and panel rather than render them empty.

Use each choice’s `url` for navigation. `selected` identifies active choices and `selectable` tells you whether toggling the choice stays within the query limits. A selected value can have a count of zero. Keep it visible so the shopper can remove it. `allow_multiple` controls whether another choice is added or replaces the current one; use it to distinguish multiple-choice and single-choice controls.

Render numeric and price controls from `item.range`. For the item whose key is `price`, `filters.price` adds currency and money-formatting fields. The available `min` and `max` are decimal strings or null when no products provide a range. `applied_min` and `applied_max` preserve the current bounds even when the results are empty. Integer sources require whole-number bounds. Price bounds use the resolved storefront currency; custom numeric ranges may be negative. Format the numbers by `unit`: `money` in the shopper’s currency, `percent` with a percent sign, `rating` as an average review rating from 1 to 5, and null as a plain number.

For a range form, use GET with the supplied `action`, render every `inputs` entry as a hidden name/value input, and use `min_input` and `max_input` as the editable field names. Display editable amounts left-to-right with a period as the decimal separator and no grouping. An empty bound removes that boundary. Use the supplied `clear_url` to remove the range.

`values_page` describes the current window of choices: search text, offset, limit, total and previous/next links. Pages default to 50 choices and allow up to 100. Selected choices are returned as well, including selections outside the current page or search. Render each value once; do not treat the returned array length as the page size. For value search, use GET with the page’s `action`, `inputs`, and `search_input`.

Use `filters.inputs` to preserve filter selections in a product-search form. These pairs include all applied choice and range inputs. Preserve the listing sort separately. Selection or range changes reset product pagination; paging the choices does not change the selected products. Use `filters.clear_url` for clear all and each item’s `clear_url` for that filter.

Direct URL input uses repeated `filter.<key>=<value>` for choices and `filter.<key>.min` / `.max` for ranges. Attribute keys are `attribute:<slug>`; metafield keys are `metafield:<owner_type>:<namespace>.<key>`. For example, `filter.metafield:variant:specs.length.min=10.5`. Choice paging uses `facet.<key>.search`, `.offset`, and `.limit`. Prefer generated controls so URL encoding and preservation remain correct.

Requests accept at most 50 selected filter keys, 100 values per key, 256 choice values overall, and 8,192 URL-encoded filter bytes. Choice values are limited to 255 characters. Disabled or unknown keys, unsupported multiple choices, malformed bounds, and exceeded limits are rejected with `STOREFRONT_FILTER_INVALID`. Counts apply every other selected filter, while variant-level choices and ranges must match the same variant.

## ctx.search

The search query, grouped result totals, and canonical result projections. results and totals are keyed by the result types the merchant shows in search (Online Store › Search in Store Admin): products, collections, categories, vendors, brands, pages, blog_posts, blog_categories, policies and custom_content (the web pages of custom content entries, found by their display name, searchable fields and SEO text). Available on Search routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.search` | Object | Declared root |  |
| `ctx.search.query` | String | Required |  |
| `ctx.search.results` | Object | Required |  |
| `ctx.search.results.products` | Object | Optional |  |
| `ctx.search.results.products.items` | Array of product card | Required |  |
| `ctx.search.results.products.pagination` | Object | Required |  |
| `ctx.search.results.products.pagination.count_label` | String | Optional |  |
| `ctx.search.results.products.pagination.current_page` | Integer | Required |  |
| `ctx.search.results.products.pagination.has_next` | Boolean | Required |  |
| `ctx.search.results.products.pagination.has_prev` | Boolean | Required |  |
| `ctx.search.results.products.pagination.next_cursor` | String | Optional |  |
| `ctx.search.results.products.pagination.next_url` | String | Optional |  |
| `ctx.search.results.products.pagination.prev_url` | String | Optional |  |
| `ctx.search.results.products.pagination.total_count` | Integer | Required |  |
| `ctx.search.results.products.pagination.total_estimated` | Boolean | Optional |  |
| `ctx.search.results.products.pagination.total_pages` | Integer | Required |  |
| `ctx.search.results.{key}` | Array of object | Dynamic key |  |
| `ctx.search.results.{key}[].excerpt` | String | Required | A line of the result's text in the shopper's language, plain text. Vendors, brands, categories and collections: the first sentence of the description (at most 200 characters, cut at a word with …), empty when it has none. Blog posts, pages, policies and custom content: the start of their text. |
| `ctx.search.results.{key}[].handle` | String | Optional | The result's slug in the shopper's language, as in its url: what a headless storefront routes by. |
| `ctx.search.results.{key}[].id` | String | Optional | The result's id. |
| `ctx.search.results.{key}[].image` | Media or null | Optional; may be null |  |
| `ctx.search.results.{key}[].metafields` | Metafields | Optional | The item's storefront-visible metafields, the same values its own page carries. Read only when a template uses them, together for every card of the page. Absent on results whose type has no metafields (policies, custom content). |
| `ctx.search.results.{key}[].title` | String | Required |  |
| `ctx.search.results.{key}[].url` | URL | Required |  |
| `ctx.search.totals` | Object keyed by name | Required |  |
| `ctx.search.totals.{key}` | Integer | Dynamic key |  |

## ctx.collection

The routed collection metadata and storefront-visible metafields. Available on Collection routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.collection` | Object | Declared root |  |
| `ctx.collection.ancestors` | Array of catalog entity ref | Optional | A category's ancestors from the top-level category down to its parent, each with its image and product_count. Empty for a top-level category and for a collection. |
| `ctx.collection.children` | Array of catalog entity ref | Optional | A category's direct sub-categories in name order, at most 500, each with its image, product_count and has_children for sub-category tiles. Empty for a collection. |
| `ctx.collection.description` | String or null | Required; may be null |  |
| `ctx.collection.id` | String | Required |  |
| `ctx.collection.image` | Media or null | Required; may be null | The image as media: url, alt_text (in the shopper's language), and width and height, its stored pixel size (null when unknown), so a banner or tile can take the photo's own ratio instead of cropping it. Null when there is none. |
| `ctx.collection.metafields` | Metafields | Optional |  |
| `ctx.collection.name` | String | Required |  |
| `ctx.collection.parent` | Catalog entity ref or null | Optional; may be null | A category's parent category (with its image and product_count); null for a top-level category and for a collection. |
| `ctx.collection.product_count` | Integer | Required | Products listed on this storefront: what the page grid shows before shopper filters. A category lists the products assigned to it, not those only in its sub-categories. |
| `ctx.collection.seo_description` | String or null | Optional; may be null |  |
| `ctx.collection.seo_title` | String or null | Optional; may be null |  |
| `ctx.collection.slug` | String | Required |  |
| `ctx.collection.url` | URL | Optional |  |

## ctx.collections

Route-free index of the store's active collections for any page (story rows, collection walls, footer lists): the first 50 by name, and whether there are more. Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.collections` | Object | Declared root |  |
| `ctx.collections.has_more` | Boolean | Required | True when the store has more active collections than items holds. Link the rest with routes.collections_url or a menu. |
| `ctx.collections.items` | Array of entity | Required | Active collections (id, name, slug, url, description, image, product_count, metafields) in the shopper's language, sorted by name, then id, the same order as the collection list page: at most 50. product_count and metafields are read only when a template uses them, for every listed collection at once. Show fewer with a limit (for item in ctx.collections.items limit: 6). |

## ctx.category

The routed category metadata and storefront-visible metafields. Available on Category routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.category` | Object | Declared root |  |
| `ctx.category.ancestors` | Array of catalog entity ref | Optional | A category's ancestors from the top-level category down to its parent, each with its image and product_count. Empty for a top-level category and for a collection. |
| `ctx.category.children` | Array of catalog entity ref | Optional | A category's direct sub-categories in name order, at most 500, each with its image, product_count and has_children for sub-category tiles. Empty for a collection. |
| `ctx.category.description` | String or null | Required; may be null |  |
| `ctx.category.id` | Integer | Required |  |
| `ctx.category.image` | Media or null | Required; may be null | The image as media: url, alt_text (in the shopper's language), and width and height, its stored pixel size (null when unknown), so a banner or tile can take the photo's own ratio instead of cropping it. Null when there is none. |
| `ctx.category.metafields` | Metafields | Optional |  |
| `ctx.category.name` | String | Required |  |
| `ctx.category.parent` | Catalog entity ref or null | Optional; may be null | A category's parent category (with its image and product_count); null for a top-level category and for a collection. |
| `ctx.category.product_count` | Integer | Required | Products listed on this storefront: what the page grid shows before shopper filters. A category lists the products assigned to it, not those only in its sub-categories. |
| `ctx.category.seo_description` | String or null | Optional; may be null |  |
| `ctx.category.seo_title` | String or null | Optional; may be null |  |
| `ctx.category.slug` | String | Required |  |
| `ctx.category.url` | URL | Optional |  |

## ctx.vendor

The routed vendor metadata and storefront-visible metafields. Available on Vendor routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.vendor` | Entity | Declared root |  |

## ctx.brand

The routed brand metadata and storefront-visible metafields. Available on Brand routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.brand` | Entity | Declared root |  |

## ctx.list

The generic vendor, brand, collection, or category index for the routed list page. Available on Vendor list, Brand list, Collection list, Category list routes when declared in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.list` | Object | Declared root |  |
| `ctx.list.items` | Array of entity | Required | This page's items by name in the shopper's language. On the category list, the top-level categories only, each with has_children; a category page's children, parent and ancestors walk the rest of the tree. |
| `ctx.list.pagination` | Object | Required |  |
| `ctx.list.pagination.current_page` | Integer | Required |  |
| `ctx.list.pagination.has_next` | Boolean | Required |  |
| `ctx.list.pagination.has_prev` | Boolean | Required |  |
| `ctx.list.pagination.next_url` | String | Required | The next page's address; "" on the last page. |
| `ctx.list.pagination.prev_url` | String | Required | The previous page's address; "" on the first page. |
| `ctx.list.pagination.total_count` | Integer | Required |  |
| `ctx.list.pagination.total_count_capped` | Boolean | Required |  |
| `ctx.list.pagination.total_pages` | Integer | Required |  |
| `ctx.list.title` | String | Required |  |

## ctx.recently_viewed

Visibility-gated product cards recently viewed on this device. Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.recently_viewed` | Object | Declared root |  |
| `ctx.recently_viewed.items` | Array of product card | Required |  |

## ctx.picked_for_you

Products picked for this visitor from the brands and categories they viewed and bought, best sellers first, leaving out what they bought and the products in Recently viewed. Only for visitors who allow personalization; the rest of the list, or all of it without a personal pick, is the store's best sellers. personal is true when at least one item is a personal pick. placement is the recommendation placement to send with a click (picked_for_you, or picked_for_you_best_sellers without a personal pick). Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.picked_for_you` | Object | Declared root |  |
| `ctx.picked_for_you.items` | Array of product card | Required |  |
| `ctx.picked_for_you.personal` | Boolean | Required |  |
| `ctx.picked_for_you.placement` | String | Required |  |

## ctx.back_in_stock_for_you

Products this visitor viewed while they were sold out that can be bought again, the ones on their wishlist first, leaving out what they bought. Only for visitors who allow personalization; empty for everyone else. Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.back_in_stock_for_you` | Object | Declared root |  |
| `ctx.back_in_stock_for_you.items` | Array of product card | Required |  |

## ctx.new_in_your_brands

The newest products of the brands this visitor viewed, bought and saved, leaving out those products. Only for visitors who allow personalization; the rest of the list, or all of it without a brand, is the store's newest products. personal is true when at least one item comes from the visitor's brands. placement is the recommendation placement to send with a click (new_in_your_brands, or new_in_your_brands_newest without a personal item). Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.new_in_your_brands` | Object | Declared root |  |
| `ctx.new_in_your_brands.items` | Array of product card | Required |  |
| `ctx.new_in_your_brands.personal` | Boolean | Required |  |
| `ctx.new_in_your_brands.placement` | String | Required |  |

## ctx.still_thinking

Products this visitor viewed and did not add to their cart or buy since, most recently viewed first, leaving out the product on the page: the browse-recovery reminder shown on the site. Only for visitors who allow personalization; empty for everyone else. Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.still_thinking` | Object | Declared root |  |
| `ctx.still_thinking.items` | Array of product card | Required |  |

## ctx.restock_notifications

Availability and channel rules for a product restock request form. Loaded when a section declares it in `ctx_needs`.

| Field | Type | Requirement | Description |
| --- | --- | --- | --- |
| `ctx.restock_notifications` | Object | Declared root |  |
| `ctx.restock_notifications.email_available` | Boolean | Required | The store can send the Restock Notification email now: the email is on and the store can send email. Only then is contact_type email accepted. |
| `ctx.restock_notifications.email_input_required` | Boolean | Required | True in email_input mode: the form needs an email address. |
| `ctx.restock_notifications.enabled` | Boolean | Required | True when a shopper can ask: Notify Me is on and the store can send the notice by email or by text. False hides the form. |
| `ctx.restock_notifications.login_required` | Boolean | Required |  |
| `ctx.restock_notifications.mode` | String (`disabled`, `account_email`, `account_phone`, `email_input`, `phone_input`) | Required | How the form asks. account_email: a signed-in customer is notified at their account email (no input). account_phone: a signed-in customer whose account email cannot be used (none, or email not available) is texted at their account phone (no input; post contact_type sms). email_input: ask for an email. phone_input: ask for a phone number (post contact_type sms). disabled: no form. |
| `ctx.restock_notifications.phone_available` | Boolean | Required | The store can text the notice now: a messaging app sends Restock Notification texts. Only then is contact_type sms accepted; a signed-in customer's account phone is used when they have one. |
| `ctx.restock_notifications.phone_channels` | Array of string (`sms`, `whatsapp`) | Required | The channels a text goes out on, as the store's Restock Notification text route sends it: sms, whatsapp or both. Empty when phone_available is false. |
| `ctx.restock_notifications.phone_input_required` | Boolean | Required | True in phone_input mode: the form needs a phone number with its country calling code. |
| `ctx.restock_notifications.sms_available` | Boolean | Required | Same as phone_available: contact_type sms is a text, sent on phone_channels. |

