Documentation Index
Fetch the complete documentation index at: https://docs.uselayers.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorization
X-Storefront-Access-Token
Token-based authentication header in the form of <YOUR_LAYERS_TOKEN>.
Content-Type
string
default:"application/json"
required
Accept
string
default:"application/json"
required
Path parameters
The handle of the collection to retrieve facets for.
Body
Facets to be included. Accepts both exact facet codes (e.g., "vendor", "options.Size") and wildcard patterns (e.g., "options.*", "metafields.product.*").Wildcard patterns expand to all matching attribute codes. For example, "options.*" expands to all option facets like "options.Size" and "options.Color". Wildcards must match at least one attribute code to be valid.Examples:// Exact facet codes
"facets": ["vendor", "options.Size", "options.Color"]
// Wildcard pattern
"facets": ["options.*"]
// Mixed exact and wildcard
"facets": ["vendor", "options.*", "metafields.product.*"]
If the count of each facet value should be calculated
If you want a min/max range for numeric facets such as price.
Response
An object where each key is a facet attribute code and the value is an object of facet values with their counts. Only returned when retrieveFacetCount is true.
An object where each key is a facet attribute code and the value is an object with min and max properties. Only returned when includeFacetRanges is true.
When to use
Use this endpoint when you need facet data without fetching product results. Common scenarios include:
- Pre-loading filter options: Fetch available filter values before the user starts browsing
- Sidebar filters: Build filter UIs that show available options and counts independently of the product grid
- Reducing payload size: Avoid fetching full product data when you only need facet information
For combined product results and facets in a single request, use the Browse API with retrieveFacetCount enabled instead.
POST /storefront/v1/summer-collection/facets
{
"facets": ["vendor", "product_type", "price_range"],
"retrieveFacetCount": true,
"includeFacetRanges": true
}