This endpoint permanently deletes a product from the productossae table based on its product key.
Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header (raw token, no “Bearer” prefix).
JWT token for authentication (raw token without Bearer prefix)
Request Body
Unique product key/identifier of the product to delete
Response
Success message: “Usuario eliminado” (Note: message says “Usuario” but refers to product deletion)
curl --location 'http://localhost:8080/secured/deleteProducto' \
--header 'Authorization: YOUR_JWT_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"claveProducto": "PROD001"
}'
{
"msg": "Usuario eliminado"
}
Error Codes
Product deleted successfully
Unauthorized - Invalid or missing authentication token
Implementation Notes
- The deletion is performed using the
claveProducto field (line 205 in cliente.js:205)
- This is a permanent deletion operation
- If the product doesn’t exist, the operation will complete but affect 0 rows
- The success message incorrectly says “Usuario eliminado” (user deleted) but this endpoint deletes products