Org-wide analytics
curl --request GET \
--url https://api.beta.suby.fi/v3/analytics \
--header 'X-Suby-Api-Key: <api-key>'import requests
url = "https://api.beta.suby.fi/v3/analytics"
headers = {"X-Suby-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Suby-Api-Key': '<api-key>'}};
fetch('https://api.beta.suby.fi/v3/analytics', 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.beta.suby.fi/v3/analytics",
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-Suby-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.beta.suby.fi/v3/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Suby-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.beta.suby.fi/v3/analytics")
.header("X-Suby-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"startDate": 123,
"endDate": 123,
"range": {
"since": "<string>",
"until": "<string>",
"spanDays": 123
},
"prevLabel": "<string>",
"currency": "<string>",
"rates": {
"base": "USD",
"eurToUsdScaled1e8": "<string>",
"asOf": 123
},
"hasCrypto": true,
"series": [
{
"date": "<string>",
"full": "<string>",
"fiatCents": 123,
"cryptoCents": 123,
"refundCents": 123,
"subscriptionCents": 123,
"oneTimeCents": 123
}
],
"overview": {
"revenueCents": 123,
"revenueDelta": 123,
"subscriptionCents": 123,
"oneTimeCents": 123,
"orders": 123,
"ordersDelta": 123,
"avgOrderCents": 123,
"newCustomers": 123,
"newCustomersDelta": 123
},
"subscription": {
"mrrCents": 123,
"arrCents": 123,
"activeSubscriptions": 123,
"inactiveSubscriptions": 123
},
"oneTime": {
"revenueCents": 123,
"orders": 123,
"avgOrderCents": 123,
"repeatCustomerRate": 123
},
"payments": {
"attempts": 123,
"success": 123,
"failed": 123,
"declined": 123,
"refunded": 123,
"successRate": 123
},
"productMix": [
{
"productId": "<string>",
"name": "<string>",
"revenueCents": 123,
"currency": "<string>",
"share": 123
}
],
"customerMix": [
{
"customerId": "<string>",
"label": "<string>",
"revenueCents": 123,
"share": 123
}
],
"countryBreakdown": [
{
"countryCode": "<string>",
"countryName": "<string>",
"revenueCents": 123,
"share": 123
}
],
"customerSeries": [
{
"date": "<string>",
"full": "<string>",
"customers": 123
}
],
"customerCountryBreakdown": [
{
"countryCode": "<string>",
"countryName": "<string>",
"customers": 123,
"share": 123
}
],
"customers": {
"total": 123,
"paying": 123,
"subscription": 123,
"oneTime": 123
},
"methodBreakdown": [
{
"count": 123,
"grossCents": 123
}
],
"statusBreakdown": [
{
"count": 123
}
]
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}Analytics
Org-wide analytics
KPIs, revenue trend, product mix, and method/status breakdowns for the whole org.
GET
/
v3
/
analytics
Org-wide analytics
curl --request GET \
--url https://api.beta.suby.fi/v3/analytics \
--header 'X-Suby-Api-Key: <api-key>'import requests
url = "https://api.beta.suby.fi/v3/analytics"
headers = {"X-Suby-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Suby-Api-Key': '<api-key>'}};
fetch('https://api.beta.suby.fi/v3/analytics', 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.beta.suby.fi/v3/analytics",
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-Suby-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.beta.suby.fi/v3/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Suby-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.beta.suby.fi/v3/analytics")
.header("X-Suby-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"startDate": 123,
"endDate": 123,
"range": {
"since": "<string>",
"until": "<string>",
"spanDays": 123
},
"prevLabel": "<string>",
"currency": "<string>",
"rates": {
"base": "USD",
"eurToUsdScaled1e8": "<string>",
"asOf": 123
},
"hasCrypto": true,
"series": [
{
"date": "<string>",
"full": "<string>",
"fiatCents": 123,
"cryptoCents": 123,
"refundCents": 123,
"subscriptionCents": 123,
"oneTimeCents": 123
}
],
"overview": {
"revenueCents": 123,
"revenueDelta": 123,
"subscriptionCents": 123,
"oneTimeCents": 123,
"orders": 123,
"ordersDelta": 123,
"avgOrderCents": 123,
"newCustomers": 123,
"newCustomersDelta": 123
},
"subscription": {
"mrrCents": 123,
"arrCents": 123,
"activeSubscriptions": 123,
"inactiveSubscriptions": 123
},
"oneTime": {
"revenueCents": 123,
"orders": 123,
"avgOrderCents": 123,
"repeatCustomerRate": 123
},
"payments": {
"attempts": 123,
"success": 123,
"failed": 123,
"declined": 123,
"refunded": 123,
"successRate": 123
},
"productMix": [
{
"productId": "<string>",
"name": "<string>",
"revenueCents": 123,
"currency": "<string>",
"share": 123
}
],
"customerMix": [
{
"customerId": "<string>",
"label": "<string>",
"revenueCents": 123,
"share": 123
}
],
"countryBreakdown": [
{
"countryCode": "<string>",
"countryName": "<string>",
"revenueCents": 123,
"share": 123
}
],
"customerSeries": [
{
"date": "<string>",
"full": "<string>",
"customers": 123
}
],
"customerCountryBreakdown": [
{
"countryCode": "<string>",
"countryName": "<string>",
"customers": 123,
"share": 123
}
],
"customers": {
"total": 123,
"paying": 123,
"subscription": 123,
"oneTime": 123
},
"methodBreakdown": [
{
"count": 123,
"grossCents": 123
}
],
"statusBreakdown": [
{
"count": 123
}
]
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}Authorizations
Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).
Query Parameters
Window start, epoch milliseconds.
Required range:
x >= 0Window end, epoch milliseconds.
Required range:
x >= 0Was this page helpful?
⌘I

