Facet counts of a storefront product listing
The filter sidebar of a listing: accepts EXACTLY the filters of GET /products (category / categoryId / categorySlug — an unknown or conflicting category is the same 400, vendor_id, q, indexable, brandId, attr[...], attributeName/attributeValue, minPrice/maxPrice, onSale, stockStatus; page/limit/sort are accepted and ignored) and counts on exactly the set GET /products lists for them — same visibility rules (active listing, hidden group offers, hidden out-of-stock products, X-Channel display mode). total equals the /products total.
Standard facet semantics: a group's counts ignore that group's OWN selection and apply every other one — with brandId=nike the other brands keep their counts so a second brand can be added; with attr[color]=noir the other colours keep theirs. price ignores minPrice/maxPrice, stockStatus/inStock ignore stockStatus, onSale ignores onSale.
Attribute values are grouped by normalised slug (Noir / noir / NOIR = one value noir, labelled with its most frequent spelling); the brand axis, metadata axes and empty values are left out. At most 100 values per attribute (most frequent first, selected values always kept).
Cacheable: Cache-Control: public, max-age=300, Vary: X-Channel.
Auth: Public (no authentication).
Use /public/products/facets; this path stays until the storefront and the mobile app have moved.
Parameters
Header Parameters
Distribution channel (display config). Absent header defaults to web.
"web""mobile""web"Query Parameters
Category id or slug (its whole subtree). Same resolution and 400s as GET /products.
Alias of category taking an id only.
Alias of category taking a slug only.
Free-text title match
1 / true keeps only « made in Tunisia » products (product override ?? vendor default ?? false). 0 / false / absent = no filter (it never selects the non-Tunisian products).
"1""0""true""false"Brand id or comma-separated ids (OR). At most 20.
Attribute filters attr[color]=noir,blanc&attr[size]=M (OR inside, AND across; normalised values).
"instock""outofstock""onbackorder"Responses
Facet counts