Statistics
This page contains the documentation for the statistics endpoints.
The statistics endpoints allow you to get the statistics of the users, products and orders. These metrics give you insights to the number of users, the most ordered items, and the status of the different orders.
This endpoint provides a summary of key metrics for the users shown in the admin dashboard, including:
- Total orders and their statuses (pending, delivery, and completed).
- Total users and total products. Each metric includes a text label, count, and a link for further details.
Provide your API key.
Successful response. Returns a summary of dashboard statistics.
See message description.
see message description.
GET /stats/dashboard HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"text": "All orders",
"count": 49,
"link": "orders"
},
{
"text": "Pending orders",
"count": 22,
"link": "orders/pending"
},
{
"text": "Delivered orders",
"count": 12,
"link": "orders/delivery"
},
{
"text": "Completed orders",
"count": 15,
"link": "orders/completed"
},
{
"text": "Total users",
"count": 58,
"link": "users"
},
{
"text": "Total products",
"count": 8,
"link": "products"
}
]This endpoint retrieves product statistics for the specified page, including:
- Total products sold (
soldCount). - Breakdown of product orders by status (
pending,delivery,completed) with counts and total quantities.
Provide your API key.
The page number for paginated product statistics.
Successful response. Returns a paginated list of product statistics.
See message description.
see message description.
GET /stats/productTable/{page} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"product": "6555a1f49feeac7dccd9b1ee",
"name": "brown tablede",
"soldCount": 90,
"counts": {
"delivery": {
"count": 6,
"totalQuantity": 12
},
"completed": {
"count": 7,
"totalQuantity": 30
},
"pending": {
"count": 13,
"totalQuantity": 74
}
}
},
{
"product": "655ff05e60b5a0bcc0a9314e",
"name": "Regular table",
"soldCount": 31,
"counts": {
"delivery": {
"count": 1,
"totalQuantity": 1
},
"completed": {
"count": 2,
"totalQuantity": 2
},
"pending": {
"count": 4,
"totalQuantity": 11
}
}
}
]This endpoint retrieves order statistics for the specified page.
Provide your API key.
The page number for pagination.
1A list of orders.
See message description.
see message description.
GET /stats/orders/all/{page} HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
{
"totalOrders": 49,
"orders": [
{
"_id": "674b37b8dc3d9360b4c32e72",
"user": {
"_id": "672050a27def4d23ffcb5166",
"email": "[email protected]"
},
"items": [
{
"product": {
"_id": "6555a1f49feeac7dccd9b1ee",
"name": "brown tablede",
"price": 30
},
"quantity": 4,
"shipping": "Regular",
"_id": "674b37b8dc3d9360b4c32e73"
}
],
"status": "pending",
"address": "Tester Dr, Blackwood SA 5051, Australia",
"createdAt": "30 Nov 2024",
"__v": 0
}
]
}Last updated