Deletes a category of materials, products or resources.
v1/categories/delete.php
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Whose category: "materials", "products" or "resources" |
| category_id | int | Yes | Category ID |
Deletion cannot be undone. The items stay, but the category is removed from them. A category selected in a storage location's settings cannot be deleted: remove it from the storage location settings first.
Example request
{
"type": "materials",
"category_id": 14
}
Example response
{
"success": true
}
Errors
| Error | Reason |
|---|---|
| No type in input | type is missing |
| Invalid type value. Must be one of: materials, products, resources | Invalid type |
| No category_id in input | category_id is missing |
| Category not found or access denied | There is no category with that ID among the categories of this type, or it is already deleted |
| The category is used in storage location settings and cannot be deleted | The category is selected in a storage location's settings |