Skip to main content
POST
/
secured
/
deleteProducto
curl --location 'http://localhost:8080/secured/deleteProducto' \
--header 'Authorization: YOUR_JWT_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "claveProducto": "PROD001"
}'
{
  "msg": "Usuario eliminado"
}
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).
Authorization
string
required
JWT token for authentication (raw token without Bearer prefix)

Request Body

claveProducto
string
required
Unique product key/identifier of the product to delete

Response

msg
string
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

200
success
Product deleted successfully
401
error
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

Build docs developers (and LLMs) love