Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Pana-Baker/llms.txt

Use this file to discover all available pages before exploring further.

The stats endpoint returns a single aggregated snapshot covering the authenticated bakery’s historical performance. The response groups data by time period (today, this week, all time), by product, by hour of day, and by order status. The app renders this data as summary cards, a bar chart, and ranked product lists — all from this one call.

GET /stats/bakery

Returns the full statistics snapshot for the authenticated bakery.
curl https://your-backend.com/api/v1/stats/bakery \
  -H "Authorization: Bearer <token>" \
  -H "X-User-Name: María"

Response

{
  "data": {
    "totalOrders": 142,
    "totalRevenue": 1850000,
    "averageOrderValue": 13028,
    "revenueToday": 125000,
    "ordersToday": 9,
    "ordersThisWeek": 41,
    "revenueThisWeek": 534000,
    "topProducts": [
      {
        "productName": "Pan de masa madre",
        "emoji": "🍞",
        "totalSold": 58,
        "totalRevenue": 696000
      }
    ],
    "ordersByHour": {
      "07": 12,
      "08": 31,
      "09": 28,
      "10": 15
    },
    "ordersByStatus": {
      "PENDING": 2,
      "CONFIRMED": 3,
      "BAKING": 1,
      "READY": 0,
      "COMPLETED": 130,
      "CANCELLED": 6
    }
  }
}

Response fields

totalOrders
number
Total number of orders ever placed at this bakery across all statuses.
totalRevenue
number
Cumulative revenue in COP across all completed orders.
averageOrderValue
number
Mean order value in COP across all orders.
revenueToday
number
Revenue in COP from orders placed today (server’s local date).
ordersToday
number
Number of orders placed today.
ordersThisWeek
number
Number of orders placed during the current calendar week.
revenueThisWeek
number
Revenue in COP from orders placed during the current calendar week.
topProducts
array
Ranked list of best-selling products, ordered by totalSold descending.
ordersByHour
object
A map of hour strings ("07", "08", etc.) to order counts. Only hours with at least one order are included. The app renders this as a bar chart.
ordersByStatus
object
A map of order status strings to the count of orders in that status. Keys correspond to the standard status values: PENDING, CONFIRMED, BAKING, READY, COMPLETED, CANCELLED.
The revenueToday and ordersToday fields reflect the server’s notion of “today” based on its local timezone. The ordersThisWeek and revenueThisWeek fields cover the current calendar week as defined by the server. Consult your backend configuration if the boundaries don’t align with your expected timezone.

Build docs developers (and LLMs) love