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
| Header | Value | Required |
|---|
| Authorization | Bearer <token> | Yes |
Path parameters
| Parameter | Type | Description |
|---|
| id | number | The transaction ID |
Response
Success (200)
Confirmation message including the deleted transaction’s ID.
Error responses
| Status | Description |
|---|
| 401 | Unauthorized |
| 403 | Forbidden — user does not have the admin role |
| 404 | Transaction 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)"
}