Skip to main content

Delete Product

DELETE /api/v1/products/{productId}

Description

Deletes a specific product from the system. This endpoint is used to remove outdated or no longer needed product entries, helping to maintain the cleanliness and relevance of data within the product catalog.

URL Parameters:

  • productId (required): The unique identifier of the product to be deleted. This must be included in the URL path.

Headers:

  • tenantId (required): The tenant ID under which the product is registered. This header identifies the specific tenant environment and should be included.
  • userId (required): The user ID of the individual responsible for deleting the product. This header is used for authentication and authorization.

Example Request:

curl -X DELETE "http://[base_url]/api/v1/products/{productId}" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456"

Responses:

  • 200 OK: Successfully deleted the product. The response typically includes a confirmation message stating that the product has been removed.

Example Response:

{
"message": "Product deleted successfully."
}

Error Responses:

  • 400 Bad Request: Incorrect parameters provided.
  • 404 Not Found: No product found with the provided productId.
  • 403 Forbidden: The user does not have permission to delete the product.

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request DELETE \ 
--url /api/v1/products/{productId} \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!