Get product filters
POST https://app.ecwid.com/api/v3/{storeId}/products/filters
Required access scopes
Your app must have the following access scopes to make this request: read_catalog
Path params
All path params are required.
storeId
number
Ecwid store ID.
Query params
Request requires one query param.
filterFields
string
Comma-separated list of filters for Ecwid to return.
Supported filters: "price","inventory","onsale","categories", "option_{optionName}", "attribute_{attributeName}". Example: "price,inventory,option_Size,attribute_Brand,categories".
If an option or attribute has a comma or backslash in its name, escape it with a backslash: "\". I.e. option name "Color, size" will transform to "option_Color\, size" when used in query param.
Headers
The Authorization header is required.
Authorization
Bearer secret_ab***cd
Access token of the application.
Request JSON
A JSON object with the following fields:
params
filterFields
string
String that defines all applied filtering params, for example: "price,inventory,option_Size".
Full list of supported filters:
"price"- Filter products by price."inventory"- Filter products by their stock."enabled"- Filter products by their availability on the storefront.
"onsale"- Filter products that are currently on sale."categories"- Filter products by their categories."option_{optionName}"- Filter products by option name and values."attribute_{attributeName}"- Filter products by attribute name and values.
If an option/attribute has a comma or a backslash in its name, escape it with a backslash \.
For example, an option named "Color, size" transforms to "option_Color\, size" in the request.
Response JSON
A JSON object with the following fields:
productCount
number
Total number of products matching any specified filters
filters
attribute_{attrName}
object attribute_{attrName}
Filter for product attributes. Response can contain multiple attribute filters. Field name for each attribute filter includes the attribute name.
option_{optionName}
object option_{optionName}
Filter for product options. Response can contain multiple option filters. Field name for each option filter includes the attribute name.
price
minValue
number
Minimal product price in the store for applying filters.
minValue
number
Maximum product price in the store for applying filters.
status
string
If SUCCESS, the price filter can be applied on the storefront.
inventory
values
array of objects values
Found invontory filters.
success
string
If SUCCESS, found filters can be applied on the storefront.
Objects inside the values array list found inventory filters in the following format:
{
"id": "instock",
"title": "In stock",
"productCount": 2
}onsale
values
array of objects values
Found sale filters.
success
string
If SUCCESS, found filters can be applied on the storefront.
Objects inside the values array list found sale filters in the following format:
{
"id": "notonsale",
"title": "Regular price",
"productCount": 2
}categories
values
array of objects values
Found category filters.
success
string
If SUCCESS, found filters can be applied on the storefront.
Objects inside the values array list found category filters in the following format:
{
"id": 172786255,
"title": "Toys",
"productCount": 1
}attribute_{attrName}
title
string
Title of the found attribute filter.
values
array of objects values
Found attribute filters.
success
string
If SUCCESS, found filters can be applied on the storefront.
sortingOrder
string
Default sorting order for the filter, for example, "FILTER_VALUE_ASC"
Objects inside the values array list found attribute filters in the following format:
"values": [
{
"title": "LIGHTSPEED",
"productCount": 1
},
{
"title": "Test_Brand",
"productCount": 1
}
]option_{optionName}
title
string
Title of the found option filter.
values
array of objects values
Found option filters.
success
string
If SUCCESS, found filters can be applied on the storefront.
sortingOrder
string
Default sorting order for the filter, for example, "FILTER_VALUE_ASC"
Objects inside the values array list found option filters in the following format:
"values": [
{
"title": "24",
"productCount": 1
},
{
"title": "28",
"productCount": 1
},
{
"title": "32",
"productCount": 1
}
]Last updated
Was this helpful?
