viakite
Dashboard

API/Reports/MRR and churn from connected payment providers

MRR and churn from connected payment providers

POST/v1/projects/{project}/analytics/mrr

What the project's paying subscriptions (Stripe and Dodo Payments) are worth a month, in the project's currency, over a range: totals at its start and end, new and churned subscriptions, MRR at the end of each day, week or month, and, with breakdown, the same numbers by where subscribers came from or by plan. A subscription counts from when it starts paying (active or past_due) until it ends; trials, paused and unpaid ones count 0. Amounts are converted at the rate of the range's last day; a currency with no rate counts 0 and is listed in missing_currencies. Test-mode subscriptions are left out. Filters don't apply.

Secret keyNeeds analytics.viewus.api.vk.viabio.me

Path parameters

projectstringrequired
The project's id (prj_…).

Body

date_rangeobject
A preset, or from and to as dates (2026-11-01, whole days in the project's time zone, to included) or RFC 3339 times (to excluded). Empty means the last 30 days. A range starting before the first day the plan keeps (retention_days of F47: the last N days, today included, in the project's time zone) starts on that day instead: the answer's date_range shows where it starts, and F1, F2 and the public queries add a range_clamped warning. A range wholly before it is empty.
Show 3 fields
presetstring
todayyesterday7d30d90dthis_monthlast_monththis_yearall
fromstring
tostring
breakdownstring
Where subscribers came from (their last visit before subscribing), or the plan.
channelsourcereferrer_domainutm_sourceutm_mediumutm_campaignplan
granularitystring
The chart's periods: auto (the default) is days up to 92 days, weeks up to a year, then months. At most 400 periods.
autodayweekmonth

Responses

MRR and churn.

currencystringrequired
The project's currency, ISO 4217.
date_rangeobjectrequired
A resolved range [from, to) in UTC.
Show 2 fields
fromstring · date-timerequired
A time in UTC, ISO 8601.
tostring · date-timerequired
A time in UTC, ISO 8601.
granularitystringrequired
dayweekmonth
breakdownstringrequired
The breakdown asked for, empty for none.
totalsobjectrequired
In the project's currency.
Show 9 fields
mrrnumberrequired
What paying subscriptions are worth a month when the range ends.
mrr_startnumberrequired
The same when it starts.
subscribersintegerrequired
Paying subscriptions when the range ends.
subscribers_startintegerrequired
Paying subscriptions when it starts.
new_subscribersintegerrequired
Subscriptions that first paid in the range.
new_mrrnumberrequired
What those still paying are worth when it ends.
churned_subscribersintegerrequired
Paying subscriptions that ended in the range.
churned_mrrnumberrequired
The MRR they had.
churn_ratenumber | nullrequired
Churned_subscribers over subscribers_start, 0 to 1; null when the range started with none.
over_timeMRRPoint[]required
Show 3 fields
datestring · date-timerequired
A time in UTC, ISO 8601.
mrrnumberrequired
MRR at the end of the period that starts at date.
subscribersintegerrequired
dataany[]required
Highest MRR first, up to 100; empty without breakdown.
missing_currenciesstring[]required
Currencies with no exchange rate: their subscriptions count 0.
Example response
1{
2 "currency": "INR",
3 "date_range": {
4 "from": "2026-11-21T09:30:00Z",
5 "to": "2026-11-21T09:30:00Z"
6 },
7 "granularity": "day",
8 "breakdown": "country",
9 "totals": {
10 "mrr": 1.5,
11 "mrr_start": 1.5,
12 "subscribers": 1,
13 "subscribers_start": 1,
14 "new_subscribers": 1,
15 "new_mrr": 1.5,
16 "churned_subscribers": 1,
17 "churned_mrr": 1.5,
18 "churn_rate": 1.5
19 },
20 "over_time": [
21 {
22 "date": "2026-11-21T09:30:00Z",
23 "mrr": 1.5,
24 "subscribers": 1
25 }
26 ],
27 "data": [
28 {
29 "mrr": 1.5,
30 "mrr_start": 1.5,
31 "subscribers": 1,
32 "subscribers_start": 1,
33 "new_subscribers": 1,
34 "new_mrr": 1.5,
35 "churned_subscribers": 1,
36 "churned_mrr": 1.5,
37 "churn_rate": 1.5,
38 "value": "string"
39 }
40 ],
41 "missing_currencies": [
42 "string"
43 ]
44}

Errors

Every error has the same shape: error.code, a message for people and details.

StatusCode
422validation_error
503clickhouse_not_configured