POST /api/transacciones
Creates a new transaction. If a cash register (caja) is currently open, it is automatically associated with the transaction. If you provide a caja_id, it must match the currently open register.
Authentication: Required
Required role: Any authenticated user
If a cash register (
caja) is currently open, the transaction is automatically linked to it even if you omit caja_id. Transactions created without an open register will have caja_id: null and any payments recorded will not be tallied to a shift — open the register first for accurate daily reconciliation.Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <token> | Yes |
| Content-Type | application/json | Yes |
Body
Sequential registration number. Must be ≥ 1.
Description of the order (e.g.
"Pedido mesa 5").Transaction type. Defaults to
"venta".Service location descriptor:
"Mesa 5", "Para llevar", "Delivery", etc.Customer name.
Initial status. One of
pendiente, abierto, cerrado. Defaults to pendiente.ID of the cash register to associate. If omitted, the currently open register is used automatically.
Response
Success (201)
Auto-generated transaction ID.
Sequential registration number.
Transaction description.
Transaction type.
Service location.
Customer name.
Current status (
pendiente, abierto, or cerrado).Kitchen status (
pendiente or terminado).Total amount as a decimal string. Starts at
"0".Amount already paid as a decimal string. Starts at
"0".Calculated outstanding amount (
monto_total - monto_pagado).Associated register ID, if any.
ID of the user who created the transaction.
Creation date (
YYYY-MM-DD).Creation timestamp with timezone.
Full creation timestamp.
Last update timestamp.
Error responses
| Status | Description |
|---|---|
| 400 | caja_id does not match the currently open register |
| 401 | Unauthorized |