America/La_Paz). It is designed to power frontend dashboard widgets without requiring multiple round trips.
This endpoint requires only a valid JWT. No specific role (
admin or cajero) is needed.GET /api/dashboard/stats
Return a real-time summary of restaurant activity.
Authentication: Bearer JWT requiredRequired role: any authenticated user
Request parameters
No parameters.Response
Returns a stats object (200 OK).
Count of active (non-deleted) users in the system.
Count of active (non-deleted) products.
Count of active (non-deleted) dishes (platos).
Total number of non-deleted transactions recorded today.
Number of today’s transactions with status
pendiente or abierto.Sum of
monto_total for today’s transactions with status cerrado, as a two-decimal string (e.g. "850.00"). Returns "0.00" when there are no closed transactions.The 5 most recent transactions from today, ordered by
hora descending. Each item has the following fields:Transaction serial ID.
Transaction description (e.g.
"Mesa 3 - Almuerzo").Table or service label (e.g.
"Mesa 3", "Para llevar"). null if not set.Transaction status:
pendiente, abierto, or cerrado.Total amount as a two-decimal string (e.g.
"120.00"). Defaults to "0.00".Timestamp of the transaction.
Error codes
| Status | Meaning |
|---|---|
401 | Missing or invalid JWT |