The Reports API provides a single, data-rich endpoint designed to power the Ordervista admin dashboard. A singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt
Use this file to discover all available pages before exploring further.
GET request fires seven parallel database queries and returns the results as a structured JSON object containing sales summaries, day-by-day revenue trends, top-selling products, order status breakdowns, category-level sales, and a snapshot of the most recent orders. Most sections respect the optional startDate / endDate date window; the metrics and recentOrders keys always return system-wide aggregates regardless of the filter. Cancelled orders (id_estado = 5) are excluded from all date-filtered queries. This endpoint is restricted to Administrator users (role 1) only.
GET /api/reports/dashboard
Returns a composite analytics payload for the admin dashboard. Auth required: Yes — role1 (Admin)
Query parameters
Start of the date range, in
YYYY-MM-DD format (e.g. 2025-01-01). When omitted, the query covers all historical data.End of the date range, in
YYYY-MM-DD format (e.g. 2025-01-31). When omitted, the query covers up to the current date.Response
Aggregated sales figures for the requested date range, excluding cancelled orders.
Count of all non-cancelled orders within the date window.
Sum of all order totals within the date window.
Average order value (
ventas_estimadas / total_pedidos) within the date window.Count of distinct customers who placed at least one non-cancelled order within the date window.
System-wide operational metrics calculated over all data, independent of the date filter.
Count of non-cancelled orders placed today.
Total number of registered customer accounts (role 3).
Count of products currently marked as active.
Count of orders currently in an active state (Pendiente, En preparación, or Listo).
Array of daily revenue data points for the requested period. Used to render the bar chart in the dashboard.
Date string in
YYYY-MM-DD format.Count of non-cancelled orders placed on that day.
Total revenue for that day.
Ranked list of best-selling products within the date window, limited to 8 results.
Product identifier.
Product name.
Category name from
CATEGORIAS.nombre.Total units sold within the date window.
Total revenue generated by this product within the date window.
Breakdown of order counts by status code, excluding cancelled orders. Used for the status distribution chart.
Status code.
Human-readable status name (e.g.
"Pendiente", "En preparación", "Listo", "Entregado").Number of orders in this status within the date window.
Revenue grouped by product category. Used for the pie chart.
Category identifier.
Category name from
CATEGORIAS.nombre.Total revenue attributable to this category within the date window.
Total units sold in this category within the date window.
Fixed snapshot of the 8 most recently placed orders, regardless of the date filter. Intended for the “Recent Activity” feed on the dashboard.
Order identifier.
ISO 8601 datetime the order was placed.
Order total.
Current status code (
1–4).Order type (
1 = Delivery, 2 = Retiro, 3 = Consumo Local).Full name of the customer who placed the order.
Email address of the customer who placed the order.
Human-readable status name from
ESTADOS_PEDIDO.nombre.Count of distinct line items in the order.
Sample partial response
Error responses
| Status | mensaje |
|---|---|
401 | Unauthorized — missing or invalid token |
403 | Forbidden — insufficient role |
500 | "Error al obtener reportes" |