The Cajas API is the backbone of Kantuta POS’s financial accountability system. It governs the entire lifecycle of a physical cash register — from initial creation and configuration, through the opening and closing of operator shifts (sessions), to the recording of ad-hoc cash movements such as petty cash disbursements. Every sale and agent transaction is tied to an active session, making session management a prerequisite for most POS operations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
All endpoints in this module require a valid
Authorization: Bearer <access_token> header. Most endpoints are accessible to both Administrador and Operador roles unless otherwise noted.Physical Cajas
List All Cajas
Bearer token obtained from the auth endpoint.
Response
Unique identifier of the caja.
Human-readable name for the cash register (e.g.,
"Caja 01 - Ventas").Operational mode:
SOLO_VENTAS, SOLO_AGENTES, or MIXTA.Base balance assigned at creation (immutable reference amount).
Historical list of sessions associated with this caja.
Create a Caja
Request Body
Display name for the caja. Minimum 3 characters (e.g.,
"Caja 02 - Agentes").Operational mode for the caja. One of:
SOLO_VENTAS, SOLO_AGENTES, MIXTA.Base balance assigned to this register (minimum
0). Used as the starting reference amount for reconciliation.ID of the administrator creating this record (for audit trail).
Get a Single Caja
Path Parameters
The numeric ID of the caja.
Update a Caja
Path Parameters
The numeric ID of the caja to update.
Request Body
All fields are optional. Provide only the fields you want to change.New display name for the caja.
New operational mode:
SOLO_VENTAS, SOLO_AGENTES, or MIXTA.ID of the user performing the update (audit trail).
Delete a Caja (Soft Delete)
id_user_update query parameter is required to record who performed the deletion.
Path Parameters
The numeric ID of the caja to delete.
Query Parameters
ID of the administrator performing the soft delete.
Sessions
Open a Session (Abrir Caja)
Accessible by both
Administrador and Operador roles. For Operador users, monto_inicial is optional — it may be set by management policy.Request Body
ID of the physical cash register to open.
Starting cash amount placed in the register for making change. Minimum
0. Optional for Operadores.ID of the user (cashier) who will operate this session.
ID of the user creating this record (for audit trail — often the same as
id_usuario).Response
Returns aSesionCaja object with estado_sesion: "ABIERTA".
Unique session identifier.
Opening cash amount.
Session status. Will be
"ABIERTA" on successful open.ISO 8601 timestamp of when the session was opened.
ID of the associated physical caja.
ID of the operator assigned to this session.
Close a Session (Cerrar Caja)
monto_final_real). The backend automatically calculates the theoretical closing balance (monto_final_teorico) from all recorded transactions and computes the diferencia (overage or shortage).
Path Parameters
The numeric ID of the session to close.
Request Body
The physical cash amount counted by the operator at closing. Minimum
0.ID of the user closing the session (audit trail).
Response
Returns the updatedSesionCaja with estado_sesion: "CERRADA".
"CERRADA" after successful close.Backend-calculated expected closing balance (monto_inicial + all ingresos − all egresos + ventas + agentes).
Physical cash counted by the operator.
monto_final_real − monto_final_teorico. Positive = surplus, negative = shortage.ISO 8601 timestamp of session closure.
Get Active Session for a User
Path Parameters
The user ID to query.
Get Session Balance
Path Parameters
The numeric ID of the session.
Cash Movements
Record a Movement
Request Body
Direction of the cash flow:
INGRESO (cash in) or EGRESO (cash out).Amount of the movement. Minimum
0.10.Reason or description for the movement (e.g.,
"Compra de bolsas para empaque").ID of the active session where this movement is recorded.
ID of the user recording the movement (audit trail).
Response — MovimientoCaja
Unique movement identifier.
"INGRESO" or "EGRESO".Amount of the movement.
Reason recorded for the movement.
ISO 8601 timestamp of when the movement was registered.
ID of the session this movement belongs to.
TypeScript Interfaces
Role Restrictions Summary
| Endpoint | Administrador | Operador |
|---|---|---|
GET /cajas | ✅ | ✅ |
POST /cajas | ✅ | ❌ |
GET /cajas/:id | ✅ | ✅ |
PATCH /cajas/:id | ✅ | ✅ |
DELETE /cajas/:id | ✅ | ✅ |
POST /cajas/abrir | ✅ | ✅ |
PATCH /cajas/sesion/:id/cerrar | ✅ | ✅ |
GET /cajas/sesion-activa/:id | ✅ | ✅ |
GET /cajas/sesion/:id/balance | ✅ | ✅ |
POST /cajas/movimiento | ✅ | ✅ |