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
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the product filter. |
Request Body
Send a JSON object with the new status.
| Field | Type | Required | Description |
|---|---|---|---|
status | Boolean | Yes | true 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
statusis missing or nottrue/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
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the status was updated. |
message | String | Product filter marked active successfully or Product filter marked inactive successfully. |
data | Object | The updated product filter. For all fields, see Get All Product Filters. |