In Kantuta POS, every financial transaction — whether a sale, a purchase paid from the drawer, or a cash movement — must be linked to an active cash register session (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.
SesionCaja). A session represents a single operator shift: it opens with a counted starting float, accumulates all activity during the shift, and closes with a physical cash count that the backend reconciles against the theoretical balance. This lifecycle ensures full auditability and eliminates any end-of-day discrepancies going unexplained.
Caja Types
Each physical cash register (Caja) is created with a especialidad field that restricts the types of operations it can process:
SOLO_VENTAS
Dedicated to retail sales only. Sessions on this caja record product sales (
POST /ventas) but not agent recharge transactions.SOLO_AGENTES
Dedicated to agent operations exclusively. Sales cannot be posted against this caja’s sessions.
MIXTA
The default. Accepts both retail sales and agent transactions in the same session — ideal for small stores with a single counter.
Only users with the Administrador role can create new physical cajas via
POST /cajas. Assigning the wrong especialidad at creation time will cause validation errors downstream when operators try to post mismatched transaction types.Session Lifecycle
Check for an Existing Active Session
Before opening a new session, query whether the operator already has an open one. This prevents duplicates and lets your frontend inject the Example:Response — session exists (If no session is open the endpoint returns
id_sesion_caja automatically.200 OK):null or a 404. In that case, redirect the operator to the open-session screen.Open a Session
Post to Request body:
Example:Response (Store the returned
/cajas/abrir with the physical caja ID, the starting float amount, and the operator’s user ID.| Field | Type | Required | Description |
|---|---|---|---|
id_caja | integer | ✅ | ID of the physical cash register |
monto_inicial | number | Optional | Starting float (min 0). Optional for Operadores |
id_usuario | integer | ✅ | ID of the operator opening the session |
id_user_create | integer | ✅ | Audit field — usually the same as id_usuario |
201 Created):id as id_sesion_caja in your application context — every subsequent transaction on this shift must reference it.Process Sales and Agent Transactions
With an open session, post sales and agent operations referencing the active See the Sales Workflow guide for full details on creating sales.
id_sesion_caja. Stock and session balances are updated automatically.Record Cash Movements (Ingresos & Egresos)
Track any manual cash-in or cash-out that is not a direct sale — for example, petty cash withdrawals, change fund top-ups, or supplier payments made from the drawer.Request body:
Example:
| Field | Type | Required | Description |
|---|---|---|---|
tipo | INGRESO | EGRESO | ✅ | Direction of cash flow |
monto | number | ✅ | Amount (minimum 0.10) |
motivo | string | ✅ | Reason for the movement |
id_sesion_caja | integer | ✅ | Active session to attach this movement to |
id_user_create | integer | ✅ | Audit field |
Check the Live Balance
At any point during the shift, fetch the running balance for the session. This is the theoretical total before close.Example:The response includes accumulated sales totals, agent totals, cash movements, and the theoretical final balance.
Close the Session (End-of-Shift Reconciliation)
At shift end, the operator physically counts the cash in the drawer and submits the real amount. The backend automatically calculates:Request body:
Example:Response (Once closed, the session transitions to
monto_final_teorico— starting float + all sales + ingresos − egresosdiferencia—monto_final_real−monto_final_teorico(negative = shortage, positive = surplus)
| Field | Type | Required | Description |
|---|---|---|---|
monto_final_real | number | ✅ | Physical cash counted by operator (min 0) |
id_user_update | number | ✅ | Audit field |
200 OK):estado_sesion: CERRADA and no further transactions can be posted against it.Quick Reference: Session Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /cajas | List all physical cajas |
POST | /cajas | Create a physical caja (Administrador only) |
GET | /cajas/:id | Get caja by ID |
PATCH | /cajas/:id | Update a caja |
DELETE | /cajas/:id?id_user_update= | Soft-delete a caja |
POST | /cajas/abrir | Open a new session |
GET | /cajas/sesion-activa/:id_usuario | Get operator’s active session |
GET | /cajas/sesion/:id/balance | Get running session balance |
PATCH | /cajas/sesion/:id/cerrar | Close session with reconciliation |
POST | /cajas/movimiento | Record a cash in/out movement |
Role Permissions
Administrador
- Create physical cajas (
POST /cajas) - Open sessions (
POST /cajas/abrir) - Close sessions, view balances, and manage movements
Operador
- Open sessions (
POST /cajas/abrir) - Record movements and process transactions against their own active session
- Cannot create physical cajas