Skip to main content

PATCH /api/transacciones/:id

Updates one or more fields on an existing transaction. All body fields are optional — only send the fields you want to change. The actualizado_en timestamp is set automatically. Authentication: Required Required role: Any authenticated user

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes
Content-Typeapplication/jsonYes

Path parameters

ParameterTypeDescription
idnumberThe transaction ID

Body

concepto
string
Updated description of the order.
mesa
string
Updated service location.
cliente
string
Updated customer name.
estado
string
Updated status. One of pendiente, abierto, or cerrado.

Response

Success (200)

Returns the full updated transaction object (same shape as Get transaction).

Error responses

StatusDescription
401Unauthorized
404Transaction not found

Example

curl -X PATCH http://localhost:3000/api/transacciones/42 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"concepto": "Pedido mesa 5 - Actualizado", "mesa": "Mesa 10"}'
{
  "id": 42,
  "concepto": "Pedido mesa 5 - Actualizado",
  "mesa": "Mesa 10",
  "estado": "abierto",
  "actualizado_en": "2026-03-18T15:00:00.000Z"
}

Build docs developers (and LLMs) love