Delete Brand
Deletes an existing brand permanently. This action cannot be undone.
HTTP Request
DELETE/api/products/brands/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the brand to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Delete a brand
4response = requests.delete('http://www.example.com/api/products/brands/123',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.status_code) # Should be 204 for successful deletion
8
9# Check if deletion was successful
10if response.status_code == 204:
11 print("Brand deleted successfully")
12else:
13 print(f"Deletion failed with status code: {response.status_code}")1# Delete a brand
2curl -X DELETE "http://www.example.com/api/products/brands/123" \
3-H "Authorization: Token <your_api_key>"
4
5# The response will have status 204 with no body if successfulStatus Codes
| Code | Description |
|---|---|
| 204 | Brand deleted successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — brand does not exist |
| 409 | Conflict — brand has associated products |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| None | None | No response body returned for successful deletion |