curl --request GET \
--url https://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers \
--header 'api_key: <api-key>'import requests
url = "https://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers"
headers = {"api_key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {api_key: '<api-key>'}};
fetch('https://app.base44.com/api/apps/{app_id}/payments/analytics/top-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://app.base44.com/api/apps/{app_id}/payments/analytics/top-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 => [
"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://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("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://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers")
.header("api_key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api_key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customers": [
{
"customer_id": "cus_T7mK2p9Q4r6S8v",
"email": "jane@example.com",
"name": "Jane Doe",
"total_amount": 10000,
"transaction_count": 4
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get top payment customers
Returns customers ranked by live payment amount or count. Requires read access to the app. Customer details are enriched through Stripe. Filter to one currency because amounts across currencies are otherwise summed without conversion. Send both start_date and end_date to set a window. With neither or only one, period selects whole UTC days including today. Results come from an analytics store and can lag behind the payment provider. This is a bounded summary with no cursor to retrieve more rows.
curl --request GET \
--url https://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers \
--header 'api_key: <api-key>'import requests
url = "https://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers"
headers = {"api_key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {api_key: '<api-key>'}};
fetch('https://app.base44.com/api/apps/{app_id}/payments/analytics/top-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://app.base44.com/api/apps/{app_id}/payments/analytics/top-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 => [
"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://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("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://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers")
.header("api_key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/payments/analytics/top-customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api_key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customers": [
{
"customer_id": "cus_T7mK2p9Q4r6S8v",
"email": "jane@example.com",
"name": "Jane Doe",
"total_amount": 10000,
"transaction_count": 4
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal API key.
Path Parameters
ID of the Base44 app.
Query Parameters
Start of the window as an ISO 8601 timestamp. Send with end_date. Defaults to the period window.
End of the window as an ISO 8601 timestamp. Send with start_date. Defaults to now when using period.
Fallback window. Either 7d, 30d, or 90d. Defaults to 30d. Used unless both dates are supplied.
7d, 30d, 90d Ranking metric. Either amount or transactions. Defaults to amount. Highest values come first.
amount, transactions Maximum customers to return, from 1 through 10. Defaults to 5.
1 <= x <= 10Comma-separated currency codes, for example usd,eur. Defaults to no currency filter. Use one currency when comparing amounts.
Response
Successful Response
Response with top customers list.
Customers ranked by the requested metric, highest first. Empty when no matching payments are found.
Show child attributes
Show child attributes
[
{
"customer_id": "cus_T7mK2p9Q4r6S8v",
"email": "jane@example.com",
"name": "Jane Doe",
"total_amount": 10000,
"transaction_count": 4
}
]
Was this page helpful?