Skip to main content

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

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the brand to delete

Example Requests

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}")

Status Codes

CodeDescription
204Brand deleted successfully
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Not found — brand does not exist
409Conflict — brand has associated products
500Internal server error

Response Fields

FieldTypeDescription
NoneNoneNo response body returned for successful deletion