Overview
The Cash Sessions API allows you to manage cash register operations including opening sessions, closing sessions with blind cash counts (arqueos), and viewing session history.Blind Cash Count System
Torn implements a blind cash count (arqueo ciego) system:- Opening: Cashier declares initial cash amount (fondo de caja)
- Operations: System tracks all cash sales during the session
- Closing: Cashier counts physical cash without seeing system calculations
- Reconciliation: System compares declared amount vs. expected amount and reports differences
Open Cash Session
Starts a new cash register session for the current user. Registers the initial cash amount (fondo de caja).Request Body
Initial cash amount in the register (e.g., starting fund for change)
ID of the user opening the cash session
If true, automatically closes any previous open session for this user. The previous session will be marked as
CLOSED_SYSTEM with zero declared amount.Response
Unique identifier for the cash session
ID of the cashier user
Timestamp when the session was opened
Timestamp when the session was closed (null while open)
Initial cash amount declared at opening
System-calculated expected cash amount (start_amount + cash sales)
Cash amount declared by cashier at closing
Difference between declared and system amounts (declared - system). Positive = surplus, Negative = shortage
Current status:
OPEN, CLOSED, or CLOSED_SYSTEMError Responses
409 Conflict
User already has an open cash session. Use
force_close_previous: true to close it automatically or close it manually first.Get Cash Session Status
Retrieves the current status of the active cash session for the authenticated user.Response
Returns the same fields as the Open Cash Session endpoint.Error Responses
404 Not Found
No active cash session found for the current user
Close Cash Session
Closes the current cash session and performs a blind cash count reconciliation (arqueo). The system calculates the expected cash amount based on sales and compares it with the cashier’s declared count.Request Body
Total cash amount counted by the cashier at closing time. This should be entered without seeing the system’s calculated amount to ensure a true blind count.
Response
Returns the closed session with all calculated fields populated:Session identifier
Cashier user ID
Session start timestamp
Session end timestamp
Initial cash amount
Expected cash amount calculated by system:
start_amount + total_cash_salesCash amount declared by cashier
Discrepancy amount:
final_cash_declared - final_cash_system- Positive value: Cash surplus (more than expected)
- Negative value: Cash shortage (less than expected)
- Zero: Perfect match
Session status:
CLOSEDIn this example, there’s a shortage of 200 less than the system expected.
Calculation Details
The system calculatesfinal_cash_system as follows:
cash_sales_during_session includes all sale payments with payment method code EFECTIVO (cash) created by the cashier after the session start time.
Error Responses
404 Not Found
No active cash session found for the current user
List Cash Sessions
Retrieves the complete history of all cash sessions with user information, ordered by most recent first.Response
Returns an array of session objects with embedded user information:Array of cash session objects with the following fields:
Session identifier
Cashier user ID
Embedded user object with fields:
id, name, email, rut, role, is_active, is_ownerSession start timestamp
Session end timestamp (null if still open)
Initial cash amount
System-calculated expected amount
Cashier-declared amount
Discrepancy (declared - system)
Status:
OPEN, CLOSED, or CLOSED_SYSTEM