Delete Product
The DELETE endpoint removes an existing product specified by the product_id.
Endpoint
- URL:
/products/{product_id} - Method:
DELETE
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
product_id | string | The unique identifier of the product to delete. |
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Sample Request
curl --location --request DELETE '<BASE-URL>/products/632a9c5f6db22d3324dd80dc' \
--header 'accessToken: <ACCESS-TOKEN>'
Response
- Status Code: 200 OK
Success Response Body
When the product is successfully deleted, the response might include:
{
"success": true,
"message": "Product deleted successfully"
}
Success Response Body
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request, typically true for a successful operation. |
message | string | A message conveying the outcome of the operation, e.g., "Product deleted s uccessfully". |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure you replace
{product_id}in the URL with the actual unique identifier of the product you wish to delete. - Ensure a valid and active access token is included in the request header for authentication.