Delete Related Product
Delete an existing product image.
HTTP Request
DELETE/api/products/:product_id/related/:related_product_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 | The unique identifier of the product |
| related_product_id | integer | Yes | The unique identifier of the related product to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3url = "/api/products/{product_id}/related/{related_product_id}"
4headers = {
5 "Authorization": "Token <your_token>"
6}
7response = requests.delete(url, headers=headers)
8print(response.status_code) # Should be 204 for successful deletion1curl -X DELETE "http://www.example.com/api/products/123/related/456" -H "Authorization: Token <your_token>"Status Codes
| Code | Description |
|---|---|
| 204 | Related product deleted successfully |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Access denied |
| 404 | Not Found - Product or related product not found |
| 500 | Internal Server Error |
Response Fields
| Field | Type | Description |
|---|---|---|
| No Content | empty | No response body returned for successful deletion |