Skip to main content

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_PRODUCT or READ_WRITE_PRODUCT

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of product filters per page. Default is 10.
statusBooleantrue for active filters, false for inactive filters.
searchStringSearch 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​

FieldTypeDescription
idStringUnique identifier of the product filter.
nameStringInternal name. For variant filters this is the product option name, for example Color.
displayNameStringLabel shown to shoppers.
typeStringprice, rating, other, variant (product option) or filter (metafield).
statusBooleanWhether the filter is shown on the storefront.
metaFieldIdStringID of the metafield the filter uses, if any. See Metafields.
sortOrderNumberDisplay order. Lower numbers appear first.
sortByStringHow the filter's values are ordered: alpha or item_count.
displayProductCountBooleanWhether the number of products is shown next to each value.
collapsedDefaultBooleanWhether the filter is collapsed when the page loads.
itemsToShowNumberNumber of values shown before "show more".
productCountsNumberNumber of products for the filter.
createdAtStringDate and time the filter was created (ISO 8601).
updatedAtStringDate and time the filter was last updated (ISO 8601).

Pagination Details​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of product filters matching the query.
countNumberNumber of product filters returned on this page.

Notes​

  • Only filters with status set to true appear on the storefront, in sortOrder order.