Skip to main content

Get Products by Product Filter

Retrieves a paginated list of the products that match a product filter. You can narrow the list to a single filter value, for example only the products where the Material filter is Cotton.

HTTP Request​

  • URL: /productFilter/{id}/products
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_WRITE_PRODUCT

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the product filter.

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of products per page. Default is 10.
valueStringReturn only the products that have this filter value, for example Cotton. If omitted, all products that use the filter are returned.

cURL Example​

curl --location '<BASE_URL>/productFilter/66d220c8f57178681728212e/products?page=1&limit=10&value=Cotton' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The list of products was returned successfully.
  • 400 Bad Request: The access token is missing or invalid, or products cannot be listed for this product filter.
  • 404 Not Found: No product filter matches the ID.

Sample JSON Response​

{
"success": true,
"data": [
{
"_id": "66d2a1b4f57178681728301a",
"id": "66d2a1b4f57178681728301a",
"sku": "TSHIRT-001",
"name": "Classic Cotton T-Shirt"
},
{
"_id": "66d2a1b4f57178681728301b",
"id": "66d2a1b4f57178681728301b",
"sku": "TSHIRT-002",
"name": "Premium Cotton Polo"
}
],
"pagination": {
"page": 1,
"total": 2,
"count": 2
}
}

Response Details​

Product Data​

FieldTypeDescription
idStringUnique identifier of the product.
skuStringSKU of the product.
nameStringName of the product.

Pagination​

FieldTypeDescription
pageIntegerThe current page number.
totalIntegerTotal number of products that match.
countIntegerNumber of products returned on this page.

Notes​

  • How products are matched depends on the type of the product filter:
    • Variant filters match products that have a product option with the same name as the filter. value is matched against the option value.
    • Metafield filters (filter type) match products that have the linked product metafield. value is matched against the metafield value.
    • Built-in filters, such as Price and Rating, match products using their own product fields.
  • If the filter is not linked to a product metafield and no product metafield has the same code as the filter name, the request returns 400 with the message Products cannot be listed for this product filter.