Required role:
admin or cajero
POST /api/caja/gastos
Records an expense against the currently open register. Cash expenses (efectivo) reduce the physical cash on hand; QR expenses do not affect the cash drawer balance.
Request
Body
Description of the expense, e.g.
"Compra de gas para cocina". Maximum 200 characters.Payment method. Allowed values:
efectivo, qrExpense amount in BOB (min: 0.01)
Response
Success (201)
Auto-incremented expense ID
ID of the register this expense is linked to
ID of the user who recorded the expense
Expense description
Payment method:
efectivo or qrExpense amount (BOB)
Timestamp when the expense was created (ISO 8601)
Timestamp of last update
Soft-delete timestamp —
null for active recordsError responses
| Status | Description |
|---|---|
| 400 | No register is currently open |
| 401 | Unauthorized — missing or invalid JWT |
| 403 | Forbidden — role is not admin or cajero |
Example
GET /api/caja/gastos/historial
Returns a list of the most recent expenses across all registers, ordered by creation date descending.
Request
Query parameters
Maximum number of records to return (default: 50)
Response
Success (200)
Returns an array of expense objects. Each item has the same shape as thePOST /api/caja/gastos success response.
Expense record ID
Register ID this expense belongs to
ID of the user who recorded the expense
Expense description
Payment method:
efectivo or qrExpense amount (BOB)
Timestamp when the expense was created
Error responses
| Status | Description |
|---|---|
| 401 | Unauthorized — missing or invalid JWT |
| 403 | Forbidden — role is not admin or cajero |