Skip to main content

Delete Category

Permanently deletes a category together with all of its subcategories. The deleted categories are removed from every product they were assigned to.

HTTP Request​

  • URL: /categories/{id}
  • Method: DELETE
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_WRITE_CATEGORY

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the category to delete.

cURL Example​

curl --location --request DELETE '<BASE_URL>/categories/66acedf2bf8641f96544253b' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The request was processed. Check success to confirm the category was deleted.
  • 400 Bad Request: The access token is missing, invalid or lacks the required scope, or the category ID is not valid.

Sample JSON Response​

{
"success": true,
"message": "Category Cordless Drills deleted successfully"
}

Response Details​

FieldTypeDescription
successBooleantrue when the category was deleted.
messageStringConfirmation message that includes the category name.

Notes​

  • Deleting a category cannot be undone. To hide a category instead, set isShow to false with Update Category.
  • All subcategories under the category are deleted too. To keep a subcategory, move it to another parent with Update Category first.
  • If no category matches the ID, the response has success: false and the message Category not exists!.