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
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the product filter. |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to retrieve. Default is 1. |
limit | Integer | Number of products per page. Default is 10. |
value | String | Return 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
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the product. |
sku | String | SKU of the product. |
name | String | Name of the product. |
Pagination
| Field | Type | Description |
|---|---|---|
page | Integer | The current page number. |
total | Integer | Total number of products that match. |
count | Integer | Number 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.
valueis matched against the option value. - Metafield filters (
filtertype) match products that have the linked product metafield.valueis matched against the metafield value. - Built-in filters, such as Price and Rating, match products using their own product fields.
- Variant filters match products that have a product option with the same name as the filter.
- 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
400with the messageProducts cannot be listed for this product filter.