Skip to main content

GET /api/transacciones/:id

Returns a single transaction by its numeric ID. The response includes the calculated monto_pendiente field. Authentication: Required Required role: Any authenticated user

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes

Path parameters

ParameterTypeDescription
idnumberThe transaction ID

Response

Success (200)

id
number
Transaction ID.
nro_reg
number
Sequential registration number.
concepto
string
Transaction description.
tipo
string
Transaction type.
mesa
string | null
Service location.
cliente
string | null
Customer name.
estado
string
Status: pendiente, abierto, or cerrado.
estado_cocina
string
Kitchen status: pendiente or terminado.
monto_total
string
Total amount as a decimal string.
monto_pagado
string
Amount already paid as a decimal string.
monto_pendiente
string
Calculated outstanding amount (monto_total - monto_pagado).
caja_id
number | null
Associated register ID.
usuario_id
string | null
ID of the user who created the transaction.
fecha
string
Creation date (YYYY-MM-DD).
hora
string
Creation timestamp with timezone.
creado_en
string
Full creation timestamp.
actualizado_en
string
Last update timestamp.

Error responses

StatusDescription
401Unauthorized
404Transaction not found

Example

curl http://localhost:3000/api/transacciones/42 \
  -H "Authorization: Bearer $TOKEN"
{
  "id": 42,
  "nro_reg": 1,
  "concepto": "Pedido mesa 5",
  "tipo": "venta",
  "mesa": "Mesa 5",
  "cliente": "Juan Pérez",
  "estado": "abierto",
  "estado_cocina": "pendiente",
  "monto_total": "85.00",
  "monto_pagado": "0.00",
  "monto_pendiente": "85.00",
  "caja_id": 3,
  "usuario_id": "usr_1234567890",
  "fecha": "2026-03-18",
  "hora": "2026-03-18T14:30:00.000Z",
  "creado_en": "2026-03-18T14:30:00.000Z",
  "actualizado_en": "2026-03-18T14:35:00.000Z",
  "borrado_en": null
}

Build docs developers (and LLMs) love