Delete Attribute
Delete an existing attribute.
HTTP Request
DELETE/api/products/attributes/: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 attribute to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Delete an existing attribute
4response = requests.delete('http://www.example.com/api/products/attributes/123',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.status_code)
8
9# Delete another attribute
10response = requests.delete('http://www.example.com/api/products/attributes/456',
11 headers={'Authorization': 'Token <your_api_key>'}
12)
13print(response.status_code)1# Delete an existing attribute
2
3curl -X DELETE "http://www.example.com/api/products/attributes/123" -H "Authorization: Token <your_api_key>"
4
5# Delete another attribute
6
7curl -X DELETE "http://www.example.com/api/products/attributes/456" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 204 | Product deleted successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — product does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| None | None | No response body returned |