Dashboard & Analytics API

Pull the same figures the SpireStock dashboard shows: sales totals, order counts, outstanding payments and performance by route or salesperson.

2 endpoints. Every request needs an API key or a session token — see Authentication. To send one of these calls from the browser, use the interactive reference.

GEThttps://api.spirestock.com/api/v1/dashboard/stats

Retrieve summary statistics for the organization dashboard including order counts by status, employee metrics, revenue, and collection data.

Example request

curl https://api.spirestock.com/api/v1/dashboard/stats \
  -H "Authorization: Bearer YOUR_TOKEN"

Example response

{
  "response_code": 200,
  "data": {
    "order_initiated_count": 23,
    "order_forwarded_count": 15,
    "order_approved_count": 48,
    "order_delivered_count": 1198,
    "total_employees": 156,
    "today_attendance": 142,
    "total_tagged_outlets": 890,
    "today_tagged_outlets": 12,
    "today_revenue": 48250.00,
    "pending_amount": 125000.00,
    "total_collection": 892500.00,
    "today_collection": 35000.00
  }
}
GEThttps://api.spirestock.com/api/v1/dashboard/monthly-sales

Retrieve product-wise sales data with daily trends, monthly totals, and year-over-year comparison. Returns data grouped by product class.

Example request

curl https://api.spirestock.com/api/v1/dashboard/monthly-sales \
  -H "Authorization: Bearer YOUR_TOKEN"

Example response

{
  "response_code": 200,
  "data": [
    {
      "id": 1,
      "product_class": "Milk",
      "unit": "Litre",
      "today_total": 2500,
      "yesterday_total": 2350,
      "daily_change_percent": 6.38,
      "daily_change_status": "up",
      "month_data": 68500,
      "month_data_avg": 2283,
      "current_year_data": 410000,
      "prev_year_data": 385000,
      "yearly_change_percent": 6.49,
      "yearly_change_status": "up",
      "seven_day_data": [
        { "date": "2026-05-25", "year": 2026, "month": 4, "day": 25, "total": 2400.0 },
        { "date": "2026-05-26", "year": 2026, "month": 4, "day": 26, "total": 2350.0 }
      ],
      "product_breakdown": [
        { "product_name": "Full Cream Milk", "quantity": 1500.0 },
        { "product_name": "Toned Milk", "quantity": 1000.0 }
      ]
    }
  ]
}