Skip to content

Analytics & Reports

Analytics & Reports

Get powerful insights into your pharmacy’s performance — sales trends, customer behavior, popular products, and financial metrics.

Platform Analytics

Get a comprehensive overview of your pharmacy’s performance.

Terminal window
# Get analytics for date range
getProviderAnalytics({
startDate: "2026-01-01",
endDate: "2026-04-30",
groupBy: "month" // day, week, month
})

Parameters:

ParameterTypeRequiredDescription
startDatestringYesStart date (YYYY-MM-DD)
endDatestringYesEnd date (YYYY-MM-DD)
groupBystringNoGrouping period (default: “day”)

Response:

{
"period": {
"start": "2026-01-01",
"end": "2026-04-30"
},
"summary": {
"totalRevenue": 2450000,
"totalOrders": 456,
"totalCustomers": 123,
"averageOrderValue": 5373,
"newCustomers": 34
},
"trends": [
{
"period": "2026-01",
"revenue": 520000,
"orders": 98,
"customers": 45
},
{
"period": "2026-02",
"revenue": 580000,
"orders": 105,
"customers": 48
},
{
"period": "2026-03",
"revenue": 650000,
"orders": 120,
"customers": 52
},
{
"period": "2026-04",
"revenue": 700000,
"orders": 133,
"customers": 58
}
],
"topProducts": [
{ "name": "Paracetamol 500mg", "sales": 245, "revenue": 196000 },
{ "name": "Amoxicillin 500mg", "sales": 189, "revenue": 472500 }
],
"topCustomers": [
{ "name": "John Doe", "orders": 15, "spent": 125000 },
{ "name": "Jane Smith", "orders": 12, "spent": 98000 }
]
}

Order Analytics

Detailed analysis of order patterns and metrics.

Terminal window
# Get order analytics
getProviderOrderAnalytics({
period: "month",
year: 2026,
month: 4
})

Response:

{
"period": "April 2026",
"orders": {
"total": 133,
"completed": 128,
"cancelled": 3,
"pending": 2
},
"delivery": {
"delivery": 89,
"pickup": 44
},
"payment": {
"card": 95,
"cash": 25,
"transfer": 13
},
"peakDays": ["Monday", "Friday"],
"peakHours": ["9AM-11AM", "4PM-6PM"],
"averageFulfillmentTime": "25 minutes"
}

Order Statistics

Quick stats dashboard data.

Terminal window
# Get current order stats
getProviderOrderStats()

Response:

{
"today": {
"orders": 12,
"revenue": 85000,
"pending": 3,
"processing": 2
},
"thisWeek": {
"orders": 78,
"revenue": 520000
},
"thisMonth": {
"orders": 312,
"revenue": 2100000
},
"comparison": {
"daily": { "current": 12, "previous": 10, "change": 20 },
"weekly": { "current": 78, "previous": 72, "change": 8.3 }
}
}

Customer Analytics

Understand your customer base.

Terminal window
# Get customer insights
getProviderCustomerAnalytics({
startDate: "2026-01-01",
endDate: "2026-04-30"
})

Response:

{
"totalCustomers": 245,
"newCustomers": 34,
"returningCustomers": 211,
"retentionRate": 86.1,
"averageLifetimeValue": 150000,
"segments": {
"highValue": 25, // Spent > ₦100k
"regular": 120, // Monthly orders
"occasional": 85, // < Monthly
"inactive": 15 // 90+ days since last order
},
"acquisition": {
"organic": 45,
"referral": 32,
"social": 28,
"walkIn": 140
}
}

Product Analytics

Analyze product performance.

Terminal window
# Get product sales analytics
getProviderProductAnalytics({
startDate: "2026-04-01",
endDate: "2026-04-30",
category: "antibiotics"
})

Response:

{
"totalProductsSold": 567,
"revenue": 890000,
"byCategory": [
{ "category": "Antibiotics", "sales": 145, "revenue": 320000 },
{ "category": "Analgesics", "sales": 234, "revenue": 187000 },
{ "category": "Antimalarial", "sales": 89, "revenue": 156000 }
],
"topSelling": [
{ "product": "Paracetamol 500mg", "quantity": 234, "revenue": 187000 },
{ "product": "Amoxicillin 500mg", "quantity": 145, "revenue": 362500 }
],
"lowSelling": [
{ "product": "Vitamin D3", "quantity": 5, "revenue": 15000 }
],
"outOfStockImpact": {
"lostSales": 45000,
"customersAffected": 12
}
}

Export Reports

Export analytics data for further analysis.

Terminal window
# Export sales report
exportProviderReport({
type: "sales",
format: "csv", // csv, excel, pdf
startDate: "2026-04-01",
endDate: "2026-04-30"
})

Report Types:

TypeDescription
salesSales transactions
ordersOrder details
inventoryStock levels and movements
customersCustomer activity
financialRevenue and expenses

Example: Monthly Review

Terminal window
# Get monthly overview
getProviderAnalytics({
startDate: "2026-04-01",
endDate: "2026-04-30",
groupBy: "week"
})
# → Shows weekly trends for the month
# Check order patterns
getProviderOrderAnalytics({ period: "month", month: 4 })
# → Shows delivery vs pickup, peak times
# Review customer growth
getProviderCustomerAnalytics({
startDate: "2026-04-01",
endDate: "2026-04-30"
})
# → Shows new vs returning customers

Dashboard Integration

Use these analytics to power your dashboard:

  1. Real-time StatsgetProviderOrderStats() for live numbers
  2. Trend ChartsgetProviderAnalytics() for historical data
  3. Top Products — Product analytics for inventory decisions
  4. Customer Insights — Customer analytics for marketing

Next steps

  • Wallet — View financial transactions
  • Orders — Manage daily operations
  • Formulary — Optimize inventory