Analytics
Get MRR by Entity
MRR contribution of each legal entity, normalized to the reporting currency.
GET
/
v1
/
analytics
/
mrr
/
by-entity
MRR broken down by legal entity
curl --request GET \
--url https://billing.example.com/v1/analytics/mrr/by-entity \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/analytics/mrr/by-entity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/analytics/mrr/by-entity', 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://billing.example.com/v1/analytics/mrr/by-entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://billing.example.com/v1/analytics/mrr/by-entity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/analytics/mrr/by-entity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/analytics/mrr/by-entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"reporting_currency": "<string>",
"total_mrr": 123,
"entities": [
{
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_name": "<string>",
"is_primary": true,
"normalized_mrr": 123,
"arr": 123,
"subscriptions": 123
}
]
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Breaks MRR down by legal entity (Multi-Entity Books), normalized to the reporting currency and sorted by MRR descending. Every entity appears — with zero if it has no active MRR — and a single-entity tenant gets one row. Responses are cached for up to 5 minutes.
Example Request
curl "https://api.recurso.dev/v1/analytics/mrr/by-entity" \
-H "Authorization: Bearer $API_KEY"
Response
{
"data": {
"reporting_currency": "USD",
"total_mrr": 4850000,
"entities": [
{
"entity_id": "c4f8b2a6-1d9e-4c3a-8b7f-5e2a9d0c6f41",
"entity_name": "Acme Inc (US)",
"is_primary": true,
"normalized_mrr": 3000000,
"arr": 36000000,
"subscriptions": 120
},
{
"entity_id": "7d2e9a15-4c8b-4f6a-a3d1-9b0e5c7f2a84",
"entity_name": "Acme India Pvt Ltd",
"is_primary": false,
"normalized_mrr": 1850000,
"arr": 22200000,
"subscriptions": 214
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
reporting_currency | string | Currency every amount is normalized into |
total_mrr | integer | Consolidated MRR across all entities, minor units |
entities[] | array | One row per legal entity, sorted by MRR descending: entity_id, entity_name, is_primary, normalized_mrr, arr, active subscriptions |
For MRR and open receivables side by side per entity, use the entities overview.
⌘I
MRR broken down by legal entity
curl --request GET \
--url https://billing.example.com/v1/analytics/mrr/by-entity \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/analytics/mrr/by-entity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/analytics/mrr/by-entity', 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://billing.example.com/v1/analytics/mrr/by-entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://billing.example.com/v1/analytics/mrr/by-entity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/analytics/mrr/by-entity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/analytics/mrr/by-entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"reporting_currency": "<string>",
"total_mrr": 123,
"entities": [
{
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_name": "<string>",
"is_primary": true,
"normalized_mrr": 123,
"arr": 123,
"subscriptions": 123
}
]
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}