Get Dashboard Statistics
Retrieves comprehensive dashboard statistics including revenue metrics, order counts, user statistics, recent sales, top products, and chart data for the last 180 days.
Authentication: Admin access required
Response
Indicates if the request was successful
All-time total revenue from completed orders
Total network fees from all completed orders
Percentage change in revenue (last 30 days vs previous 30 days), e.g. “+15.3%”
Percentage change in orders (last 30 days vs previous 30 days)
Percentage change in new users (last 30 days vs previous 30 days)
Percentage change in network fees (last 30 days vs previous 30 days)
Revenue from the last 30 days
Number of orders from the last 30 days
Network fees from the last 30 days
Object with order status as keys and counts as values (e.g. {"completed": 150, "pending": 12})
Array of the 8 most recent orders with populated user information User object with username and email
Blockchain transaction hash
Array of products in the order
Top 3 products by quantity sold (from completed orders) with trend data Total revenue from this product
Revenue trend percentage (last 30 days vs previous 30 days)
Daily revenue data for the last 180 days Date in YYYY-MM-DD format
Revenue for that day (0 if no sales)
Response Example
{
"success" : true ,
"stats" : {
"totals" : {
"totalRevenue" : 50000 ,
"totalOrders" : 245 ,
"activeUsers" : 150 ,
"totalUsers" : 180 ,
"networkFees" : 500
},
"trends" : {
"revenueChange" : "+15.3%" ,
"ordersChange" : "+8.2%" ,
"usersChange" : "+12.5%" ,
"feesChange" : "+15.0%"
},
"last30Days" : {
"totalRevenue" : 15000 ,
"totalOrders" : 75 ,
"networkFees" : 150
},
"statusCounts" : {
"completed" : 200 ,
"pending" : 30 ,
"refunded" : 15
}
},
"recentSales" : [
{
"orderId" : "ORD-123456" ,
"userId" : {
"username" : "john_doe" ,
"email" : "[email protected] "
},
"total" : 299.99 ,
"status" : "completed" ,
"createdAt" : "2026-03-04T10:30:00.000Z" ,
"transactionHash" : "0xabc123..." ,
"products" : []
}
],
"topProducts" : [
{
"_id" : "prod123" ,
"name" : "Premium Package" ,
"quantitySold" : 150 ,
"revenue" : 15000 ,
"trend" : "+20.5%"
}
],
"chartData" : [
{
"date" : "2025-09-06" ,
"revenue" : 1200
},
{
"date" : "2025-09-07" ,
"revenue" : 0
}
]
}
Error Response
{
"error" : "Error message"
}