Subscription Metrics
curl --request GET \
--url https://api.creptapay.com/v1/subscriptions/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creptapay.com/v1/subscriptions/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.creptapay.com/v1/subscriptions/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.creptapay.com/v1/subscriptions/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.creptapay.com/v1/subscriptions/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.creptapay.com/v1/subscriptions/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/subscriptions/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Successfully fetched subscription metrics",
"data": {
"mrr": 4312.5,
"active": 84,
"trialing": 11,
"past_due": {
"count": 6,
"amount": 294
},
"canceled_30d": 5,
"churn_percent": 4.76,
"renewals_this_week": {
"count": 19,
"amount": 931
}
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}Subscriptions
Subscription Metrics
MRR, active and trialing counts, past due, 30-day churn and the renewals due this week — for this business and environment.
GET
/
subscriptions
/
summary
Subscription Metrics
curl --request GET \
--url https://api.creptapay.com/v1/subscriptions/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creptapay.com/v1/subscriptions/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.creptapay.com/v1/subscriptions/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.creptapay.com/v1/subscriptions/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.creptapay.com/v1/subscriptions/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.creptapay.com/v1/subscriptions/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/subscriptions/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Successfully fetched subscription metrics",
"data": {
"mrr": 4312.5,
"active": 84,
"trialing": 11,
"past_due": {
"count": 6,
"amount": 294
},
"canceled_30d": 5,
"churn_percent": 4.76,
"renewals_this_week": {
"count": 19,
"amount": 931
}
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}The numbers behind a subscriptions dashboard, for the business and environment
the API key belongs to.
Request authentication
This endpoint requires a Secret Key (sk_...).
How MRR is calculated
Every running subscription is normalised to a monthly figure in USD from its own terms, not from its plan — so a subscriber still on last year’s price contributes last year’s price.- A quarterly plan counts a third of its price each month; an annual one a twelfth.
- Amounts in other currencies are converted at the current rate.
- Subscriptions set to cancel at period end are excluded — they are not recurring any more.
trialingandpast_duesubscriptions are included: they are still expected to pay.
churn_percent is subscriptions canceled or expired in the last 30 days over
that number plus the ones still running. It is null when there is no base to
measure against, rather than 0 — a new account has not achieved zero churn,
it has no churn to report yet.