Skip to main content

Get Dashboard Stats

Retrieves key dashboard metrics including product counts, user statistics, and pending items.

Authentication

string
required
Bearer token with admin privileges
Requires: Admin role (requireAdmin middleware)

Response

boolean
required
Indicates if the request was successful
object
required
Dashboard statistics object
number
Total number of active products in the system
number
Number of products with stock level of 5 or less
number
Total number of registered users
number
Total count of all sales
number
Number of pending technical consultations

Get Sales Intelligence

Retrieves comprehensive sales analytics including revenue metrics, trends, top products, and dead stock analysis.

Authentication

string
required
Bearer token with admin privileges
Requires: Admin role (requireAdmin middleware)

Response

boolean
required
Indicates if the request was successful
object
required
Sales intelligence data object
object
Key performance indicators
number
Total revenue for the current month (approved, sent, and delivered sales)
number
Number of products with stock level of 5 or less
number
Number of sales pending approval
number
Number of pending technical consultations
object
Chart data for visualization
array
Daily sales data for the last 30 days
string
Date in ISO format (YYYY-MM-DD)
number
Number of sales on that date
number
Total sales amount on that date
array
Top 5 selling products in the last 30 days
string
Product name
number
Total quantity sold
array
Products with no sales activity in the last 90 days
number
Product ID
string
Product name
number
Current stock quantity
number
Product price
string
Date of last sale (ISO format) or null if never sold
number
Number of days since last sale or creation