Customer API #
GET /analytics/customers #
Returns customer metrics including LTV, CAC, churn, retention, and cohort data.
URL: GET /wp-json/dmsilm/v1/analytics/customers
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
date_from | string | 30 days ago | Start date |
date_to | string | Today | End date |
period | string | monthly | Aggregation period |
Response:
{
"success": true,
"data": {
"total_customers": 1248,
"new_customers": 87,
"churned_customers": 23,
"net_growth": 64,
"churn_rate": 1.84,
"retention_rate": 98.16,
"average_ltv": 342.50,
"cohort_data": [
{
"cohort": "2026-01",
"size": 45,
"retention": { "month_1": 91.1, "month_2": 84.4, "month_3": 80.0 }
}
]
}
}
