Skip to main content

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​

ParameterTypeDescription
idStringRequired. The ID of the product filter to update.

Request Body​

Send a JSON object with the fields to change.

FieldTypeRequiredDescription
nameStringNoInternal name. Must be unique.
displayNameStringNoLabel shown to shoppers.
metaFieldIdStringNoID of the product metafield to filter by. Send null to remove it.
statusBooleanNoWhether the filter is shown on the storefront.
sortOrderStringNoDisplay order as a number in a string, for example "2".
sortByStringNoHow the filter's values are ordered: alpha or item_count.
displayProductCountBooleanNoWhether the number of products is shown next to each value.
collapsedDefaultBooleanNoWhether 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​

FieldTypeDescription
successBooleantrue when the product filter was updated.
messageStringConfirmation message.
dataObjectThe updated product filter. For all fields, see Get All Product Filters.

Notes​

  • The filter type cannot be changed.
  • To turn a filter on or off, you can also use Update Product Filter Status.
  • If no product filter matches the ID, data is an empty object.