Skip to main content

DELETE /api/transacciones/:id

Soft-deletes a transaction by setting its borrado_en timestamp. The record is not removed from the database and will no longer appear in list or get queries. Authentication: Required Required role: admin
This action requires the admin role. Users with the cajero role will receive a 403 Forbidden response.

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes

Path parameters

ParameterTypeDescription
idnumberThe transaction ID

Response

Success (200)

message
string
Confirmation message including the deleted transaction’s ID.

Error responses

StatusDescription
401Unauthorized
403Forbidden — user does not have the admin role
404Transaction not found

Example

curl -X DELETE http://localhost:3000/api/transacciones/42 \
  -H "Authorization: Bearer $TOKEN"
{
  "message": "Transacción con ID 42 eliminada exitosamente (soft delete)"
}

Build docs developers (and LLMs) love