Skip to main content

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

ParameterTypeDescription
product_idstringThe unique identifier of the product to delete.

Request Headers

HeaderTypeDescription
accessTokenstringAccess 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

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true for a successful operation.
messagestringA message conveying the outcome of the operation, e.g., "Product deleted s uccessfully".

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal 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.