curl --request GET \
--url https://coreapi.io/api/analytics/finance/revenue/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://coreapi.io/api/analytics/finance/revenue/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/api/analytics/finance/revenue/customers', 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://coreapi.io/api/analytics/finance/revenue/customers",
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;
}{
"data": [
{
"customer": {
"id": "<string>",
"number": "<string>",
"name": "<string>"
},
"values": [
{
"amount": "1234.56",
"currency": "EUR"
}
],
"total": {
"amount": "1234.56",
"currency": "EUR"
},
"sparkline": [
"1200.00"
],
"products": [
{
"product": {
"id": "<string>",
"number": "<string>",
"name": "<string>"
},
"values": [
{
"amount": "1234.56",
"currency": "EUR"
}
],
"total": {
"amount": "1234.56",
"currency": "EUR"
}
}
]
}
],
"meta": {
"page": 1,
"pageSize": 25,
"total": 112,
"sum": {
"amount": "1234.56",
"currency": "EUR"
},
"asOf": "2023-11-07T05:31:56Z"
}
}{
"status": 409,
"type": "ANALYTICS_MRR_FINANCIALS__SNAPSHOT_MONTH_NOT_ENDED",
"title": "An error occurred",
"detail": "<string>"
}{
"status": 422,
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"violations": [
{
"propertyPath": "to",
"message": "Der Zeitraum darf höchstens 36 Monate umfassen.",
"code": "analytics.mrr_financials.range_too_long"
}
],
"title": "Validation Failed",
"detail": "<string>"
}Revenue per customer, paged
Customers with billed net revenue in the range (all classes; net = gross − tax after position discounts, credit notes negative), ranked by net revenue (descending; equal amounts by customer id), each with product sub-rows and a 12-month sparkline ending with the last month of the range. Same filters as the revenue datasets.
Required permission: analytics:read.
curl --request GET \
--url https://coreapi.io/api/analytics/finance/revenue/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://coreapi.io/api/analytics/finance/revenue/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/api/analytics/finance/revenue/customers', 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://coreapi.io/api/analytics/finance/revenue/customers",
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;
}{
"data": [
{
"customer": {
"id": "<string>",
"number": "<string>",
"name": "<string>"
},
"values": [
{
"amount": "1234.56",
"currency": "EUR"
}
],
"total": {
"amount": "1234.56",
"currency": "EUR"
},
"sparkline": [
"1200.00"
],
"products": [
{
"product": {
"id": "<string>",
"number": "<string>",
"name": "<string>"
},
"values": [
{
"amount": "1234.56",
"currency": "EUR"
}
],
"total": {
"amount": "1234.56",
"currency": "EUR"
}
}
]
}
],
"meta": {
"page": 1,
"pageSize": 25,
"total": 112,
"sum": {
"amount": "1234.56",
"currency": "EUR"
},
"asOf": "2023-11-07T05:31:56Z"
}
}{
"status": 409,
"type": "ANALYTICS_MRR_FINANCIALS__SNAPSHOT_MONTH_NOT_ENDED",
"title": "An error occurred",
"detail": "<string>"
}{
"status": 422,
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"violations": [
{
"propertyPath": "to",
"message": "Der Zeitraum darf höchstens 36 Monate umfassen.",
"code": "analytics.mrr_financials.range_too_long"
}
],
"title": "Validation Failed",
"detail": "<string>"
}Autorisierungen
API token of the organisation. Send it as Authorization: Bearer api_... The token is bound to exactly one organisation.
Abfrageparameter
First month (YYYY-MM, time zone of the organisation). Default: to minus 11 months.
Last month (YYYY-MM). Default: the current month. At most 36 months.
ISO-4217 code. Default: the default currency.
Movement scope (the customer list is scope-independent; accepted for a uniform query).
subscription, invoice_address, customer, organisation Analytics segment filter.
Customer filter.
Product filter.
Page, starting at 1.
x >= 1Customers per page.
1 <= x <= 100Customer name, customer number or the name of one of the customer's products contains this text (case-insensitive, % and _ are literal).
100Antwort
One page of customers.
One page of the revenue page's customer rows: customers ranked by net revenue in the range (descending; equal amounts by customer id, so the order is stable across pages), each with product sub-rows and a 12-month sparkline ending with the last month of the range.
War diese Seite hilfreich?