Update Product Filter
Updates the settings of an existing product filter. Send only the fields you want to change.
HTTP Request
- URL:
/productFilter/{id} - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_PRODUCT
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the product filter to update. |
Request Body
Send a JSON object with the fields to change.
| Field | Type | Required | Description |
|---|---|---|---|
name | String | No | Internal name. Must be unique. |
displayName | String | No | Label shown to shoppers. |
metaFieldId | String | No | ID of the product metafield to filter by. Send null to remove it. |
status | Boolean | No | Whether the filter is shown on the storefront. |
sortOrder | String | No | Display order as a number in a string, for example "2". |
sortBy | String | No | How the filter's values are ordered: alpha or item_count. |
displayProductCount | Boolean | No | Whether the number of products is shown next to each value. |
collapsedDefault | Boolean | No | Whether the filter is collapsed when the page loads. |
cURL Example
curl --location --request PUT '<BASE_URL>/productFilter/6704b8e2c9a1d2e3f4a5b6c7' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Material Type",
"sortOrder": "2",
"displayProductCount": true,
"collapsedDefault": true
}'
Response
- 200 OK: The product filter was updated successfully.
- 400 Bad Request: The access token is missing or invalid, the body is empty, a value is not valid, or another filter already uses the name.
Sample JSON Response
{
"success": true,
"message": "Product Filter updated successfully",
"data": {
"id": "6704b8e2c9a1d2e3f4a5b6c7",
"name": "material",
"displayName": "Material Type",
"type": "filter",
"displayProductCount": true,
"status": true,
"metaFieldId": "66d1f0c2a1b2c3d4e5f60718",
"sortOrder": 2,
"sortBy": "item_count",
"collapsedDefault": true,
"itemsToShow": 0,
"productCounts": 0,
"createdAt": "2025-10-08T07:55:14.392Z",
"updatedAt": "2025-10-09T10:21:47.015Z"
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the product filter was updated. |
message | String | Confirmation message. |
data | Object | The updated product filter. For all fields, see Get All Product Filters. |
Notes
- The filter
typecannot be changed. - To turn a filter on or off, you can also use Update Product Filter Status.
- If no product filter matches the ID,
datais an empty object.