Overview
Returns time-series data aggregated by hour, day, or week. Optionally includes comparison with previous period.
Authentication
Requires JWT authentication. VENDEDOR role is not authorized.
Query Parameters
Date range preset: today, yesterday, week, month, year, range
Start date in YYYY-MM-DD (required if date=range)
End date in YYYY-MM-DD (required if date=range)
Aggregation interval: hour, day, week
Alias for interval (frontend compatibility)
Include comparison with previous period
Filter by ventana (admin only)
Response
Previous period comparison data (if compare=true)
Interval Limits
hour: Max 7 days
day: Max 90 days
week: Max 365 days
Example Request
GET /api/v1/admin/dashboard/timeseries?date=week&interval=day&compare=true
Example Response
{
"success": true,
"data": {
"series": [
{
"timestamp": "2024-03-11T06:00:00.000Z",
"sales": 200000,
"payouts": 100000,
"tickets": 150,
"netProfit": 100000
},
{
"timestamp": "2024-03-12T06:00:00.000Z",
"sales": 250000,
"payouts": 120000,
"tickets": 180,
"netProfit": 130000
}
],
"comparison": [
{
"timestamp": "2024-03-04T06:00:00.000Z",
"sales": 180000,
"payouts": 90000,
"tickets": 140,
"netProfit": 90000
}
]
},
"meta": {
"range": {
"fromAt": "2024-03-11T06:00:00.000Z",
"toAt": "2024-03-18T05:59:59.999Z"
},
"generatedAt": "2024-03-15T12:00:00.000Z"
}
}