Get All Product Filters
Retrieves a paginated list of product filters. Product filters are the filter options shoppers see on product listing and search pages, such as Price, Color or Material.
HTTP Request
- URL:
/productFilter - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_PRODUCTorREAD_WRITE_PRODUCT
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to retrieve. Default is 1. |
limit | Integer | Number of product filters per page. Default is 10. |
status | Boolean | true for active filters, false for inactive filters. |
search | String | Search by name or display name (not case-sensitive). |
cURL Example
curl --location '<BASE_URL>/productFilter?page=1&limit=10&status=true&search=color' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The list of product filters was returned successfully.
- 400 Bad Request: The access token is missing or invalid, or a query parameter is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"_id": "66d220c8f57178681728212e",
"id": "66d220c8f57178681728212e",
"name": "Color",
"displayName": "Color",
"type": "variant",
"status": true,
"displayProductCount": true,
"productCounts": 0,
"itemsToShow": 5,
"sortOrder": 1,
"sortBy": "alpha",
"collapsedDefault": false,
"createdAt": "2024-08-30T19:43:04.216Z",
"updatedAt": "2024-08-31T18:18:28.191Z"
}
],
"pagination": {
"page": 1,
"total": 1,
"count": 1
}
}
Response Details
Product Filter Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the product filter. |
name | String | Internal name. For variant filters this is the product option name, for example Color. |
displayName | String | Label shown to shoppers. |
type | String | price, rating, other, variant (product option) or filter (metafield). |
status | Boolean | Whether the filter is shown on the storefront. |
metaFieldId | String | ID of the metafield the filter uses, if any. See Metafields. |
sortOrder | Number | Display order. Lower numbers appear first. |
sortBy | String | How the filter's values are ordered: alpha or item_count. |
displayProductCount | Boolean | Whether the number of products is shown next to each value. |
collapsedDefault | Boolean | Whether the filter is collapsed when the page loads. |
itemsToShow | Number | Number of values shown before "show more". |
productCounts | Number | Number of products for the filter. |
createdAt | String | Date and time the filter was created (ISO 8601). |
updatedAt | String | Date and time the filter was last updated (ISO 8601). |
Pagination Details
| Field | Type | Description |
|---|---|---|
page | Number | Current page number. |
total | Number | Total number of product filters matching the query. |
count | Number | Number of product filters returned on this page. |
Notes
- Only filters with
statusset totrueappear on the storefront, insortOrderorder.