Revenue API #
GET /analytics/revenue #
Returns revenue KPIs and breakdowns for the requested period.
URL: GET /wp-json/dmsilm/v1/analytics/revenue
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
date_from | string | 30 days ago | Start date (YYYY-MM-DD) |
date_to | string | Today | End date (YYYY-MM-DD) |
period | string | monthly | Aggregation: daily, weekly, monthly, quarterly |
product_id | integer | null | Filter to specific product |
Response:
{
"success": true,
"data": {
"mrr": 9420.00,
"arr": 113040.00,
"total_revenue": 9420.00,
"revenue_growth": 8.5,
"by_product": [
{
"product_id": 1,
"product_name": "Pro Plugin",
"revenue": 7200.00,
"mrr_contribution": 7200.00
}
],
"trend": [
{ "period": "2026-02-01", "revenue": 9420.00 }
]
},
"meta": { "period": "monthly", "date_from": "2026-02-01", "date_to": "2026-02-28" }
}
GET /analytics/revenue/forecast #
Returns revenue forecasts for 1, 3, 6, and 12 months.
URL: GET /wp-json/dmsilm/v1/analytics/revenue/forecast
Response:
{
"success": true,
"data": {
"1_month": { "forecast": 10200.00, "lower": 9100.00, "upper": 11300.00, "accuracy_pct": 85 },
"3_months": { "forecast": 11800.00, "lower": 9800.00, "upper": 13800.00, "accuracy_pct": 75 },
"6_months": { "forecast": 14200.00, "lower": 11000.00, "upper": 17400.00, "accuracy_pct": 65 },
"12_months": { "forecast": 18900.00, "lower": 13000.00, "upper": 24800.00, "accuracy_pct": 50 }
}
}
