Skip to main content

Update Product Filter Status

Turns a product filter on or off. Only the status changes; all other settings stay the same.

HTTP Request​

  • URL: /productFilter/{id}/status
  • 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.

Request Body​

Send a JSON object with the new status.

FieldTypeRequiredDescription
statusBooleanYestrue to show the filter, false to hide it.

cURL Example​

curl --location --request PUT '<BASE_URL>/productFilter/66d220c8f57178681728212e/status' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"status": false
}'

Response​

  • 200 OK: The status was updated successfully.
  • 400 Bad Request: The access token is missing or invalid, or status is missing or not true/false.
  • 404 Not Found: No product filter matches the ID.

Sample JSON Response​

{
"success": true,
"message": "Product filter marked inactive successfully",
"data": {
"id": "66d220c8f57178681728212e",
"name": "Color",
"displayName": "Color",
"type": "variant",
"status": false,
"displayProductCount": true,
"productCounts": 0,
"itemsToShow": 5,
"sortOrder": 1,
"sortBy": "alpha",
"collapsedDefault": false,
"createdAt": "2024-08-30T19:43:04.216Z",
"updatedAt": "2024-08-31T18:20:11.001Z"
}
}

Response Details​

FieldTypeDescription
successBooleantrue when the status was updated.
messageStringProduct filter marked active successfully or Product filter marked inactive successfully.
dataObjectThe updated product filter. For all fields, see Get All Product Filters.