Skip to main content

GET /api/caja/actual

Returns the register that is currently open. If no register is open, returns null. Authentication: Bearer JWT required
Required role: admin or cajero

Request

No parameters or body required.

Response

Success (200)

Returns the open caja_turno object, or null if no register is open.
id
number
Auto-incremented register ID
fecha
string
Opening date (YYYY-MM-DD)
hora_apertura
string
Opening timestamp (ISO 8601 with timezone)
hora_cierre
string | null
Closing timestamp — null while the register is open
usuario_id
string | null
ID of the user who opened the register
monto_inicial
number
Cash amount at opening (BOB)
b200
number | null
Count of 200 BOB bills at opening
b100
number | null
Count of 100 BOB bills at opening
b50
number | null
Count of 50 BOB bills at opening
b20
number | null
Count of 20 BOB bills at opening
b10
number | null
Count of 10 BOB bills at opening
b5
number | null
Count of 5 BOB bills at opening
m2
number | null
Count of 2 BOB coins at opening
m1
number | null
Count of 1 BOB coins at opening
m050
number | null
Count of 0.50 BOB coins at opening
m020
number | null
Count of 0.20 BOB coins at opening
m010
number | null
Count of 0.10 BOB coins at opening
ventas_efectivo
number
Total cash sales accumulated in this shift (BOB)
ventas_qr
number
Total QR sales accumulated in this shift (BOB)
total_salidas
number
Total expenses recorded against this register (BOB)
cerrada
boolean
false — the register is open
cierre_obs
string | null
Closing observations — null while open

Error responses

StatusDescription
401Unauthorized — missing or invalid JWT
403Forbidden — role is not admin or cajero

Example

curl http://localhost:3000/api/caja/actual \
  -H "Authorization: Bearer <token>"
{
  "id": 1,
  "fecha": "2026-02-04",
  "hora_apertura": "2026-02-04T08:00:00.000Z",
  "hora_cierre": null,
  "usuario_id": "usr_abc123",
  "monto_inicial": 500.00,
  "b200": 2,
  "b100": 1,
  "b50": 2,
  "b20": 5,
  "b10": 10,
  "b5": 10,
  "m2": 20,
  "m1": 20,
  "m050": 10,
  "m020": 10,
  "m010": 10,
  "ventas_efectivo": 350.00,
  "ventas_qr": 120.00,
  "total_salidas": 50.00,
  "cerrada": false,
  "cierre_obs": null
}
When no register is open:
null

Build docs developers (and LLMs) love