Delete Product Attribute
Deletes an existing product attribute.
HTTP Request
DELETE/api/products/:product_id/attributes/:product_attribute_id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_id | Integer | Yes | Unique ID of the product |
| product_attribute_id | Integer | Yes | Unique ID of the product attribute |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3url = "/api/products/{product_id}/attributes/{product_attribute_id}"
4headers = {
5 "Authorization": "Token <your_api_key>"
6}
7
8response = requests.delete(url, headers=headers)
9print(response.status_code)
10
11# Specific example
12response = requests.delete('http://www.example.com/api/products/123/attributes/456',
13 headers={'Authorization': 'Token <your_api_key>'}
14)
15print(response.status_code) # Should be 200 for successful deletion1# Delete a specific product attribute
2curl -X DELETE "http://www.example.com/api/products/123/attributes/456" \
3-H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Product attribute deleted successfully |
| 400 | Bad request — invalid input |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — product or attribute does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| No content | None | No content returned on successful deletion |