Skip to main content

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:
  1. Opening: Cashier declares initial cash amount (fondo de caja)
  2. Operations: System tracks all cash sales during the session
  3. Closing: Cashier counts physical cash without seeing system calculations
  4. Reconciliation: System compares declared amount vs. expected amount and reports differences
This approach helps detect cash handling discrepancies and ensures accountability.

Open Cash Session

Starts a new cash register session for the current user. Registers the initial cash amount (fondo de caja).

Request Body

start_amount
number
required
Initial cash amount in the register (e.g., starting fund for change)
user_id
integer
required
ID of the user opening the cash session
force_close_previous
boolean
default:"false"
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

id
integer
Unique identifier for the cash session
user_id
integer
ID of the cashier user
start_time
datetime
Timestamp when the session was opened
end_time
datetime
Timestamp when the session was closed (null while open)
start_amount
number
Initial cash amount declared at opening
final_cash_system
number
System-calculated expected cash amount (start_amount + cash sales)
final_cash_declared
number
Cash amount declared by cashier at closing
difference
number
Difference between declared and system amounts (declared - system). Positive = surplus, Negative = shortage
status
string
Current status: OPEN, CLOSED, or CLOSED_SYSTEM
curl -X POST https://api.torn.com/cash/open \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 5,
    "start_amount": 50000,
    "force_close_previous": false
  }'

Error 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.
curl -X GET https://api.torn.com/cash/status \
  -H "Authorization: Bearer YOUR_TOKEN"

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

final_cash_declared
number
required
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:
id
integer
Session identifier
user_id
integer
Cashier user ID
start_time
datetime
Session start timestamp
end_time
datetime
Session end timestamp
start_amount
number
Initial cash amount
final_cash_system
number
Expected cash amount calculated by system: start_amount + total_cash_sales
final_cash_declared
number
Cash amount declared by cashier
difference
number
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
status
string
Session status: CLOSED
curl -X POST https://api.torn.com/cash/close \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "final_cash_declared": 245800
  }'
In this example, there’s a shortage of 200(negativedifference),meaningthecashiercounted200 (negative difference), meaning the cashier counted 200 less than the system expected.

Calculation Details

The system calculates final_cash_system as follows:
final_cash_system = start_amount + sum(cash_sales_during_session)
Where 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:
sessions
array
Array of cash session objects with the following fields:
id
integer
Session identifier
user_id
integer
Cashier user ID
user
object
Embedded user object with fields: id, name, email, rut, role, is_active, is_owner
start_time
datetime
Session start timestamp
end_time
datetime
Session end timestamp (null if still open)
start_amount
number
Initial cash amount
final_cash_system
number
System-calculated expected amount
final_cash_declared
number
Cashier-declared amount
difference
number
Discrepancy (declared - system)
status
string
Status: OPEN, CLOSED, or CLOSED_SYSTEM
curl -X GET https://api.torn.com/cash/sessions \
  -H "Authorization: Bearer YOUR_TOKEN"

Best Practices

Blind Count Process: To maintain the integrity of the blind cash count:
  1. Cashier opens the session and declares starting cash
  2. Throughout the day, all sales are recorded in the system
  3. At closing time, the cashier counts physical cash without checking the system
  4. Only after entering the declared amount should the cashier see the comparison
  5. Any discrepancies should be investigated and documented
One Session Per User: Each user can only have one open cash session at a time. Attempting to open a second session will fail unless you use force_close_previous: true or manually close the existing session.

Build docs developers (and LLMs) love