Dashboard & Analytics API

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

2 endpointsBase URL https://api.spirestock.com/api/v1

Every request needs an API key or a session token. Last updated .

On this page (2)

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": {
    "date": "2026-10-22",
    "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,
    "pending_amount": 125000,
    "total_collection": 892500,
    "today_collection": 35000,
    "total_retailers": 9918,
    "total_distributors": 298,
    "active_distributors": 112,
    "inactive_distributors": 186,
    "primary_orders_count": 0,
    "secondary_orders_count": 0,
    "fieldwork_count": 0,
    "other_works_count": 0,
    "leave_count": 0,
    "not_marked_count": 82,
    "new_retailers_count": 0,
    "visited_outlets": 0,
    "productive_outlets": 0,
    "unproductive_outlets": 0,
    "productivity_percent": 0
  }
}

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 }
      ]
    }
  ]
}