Statistics
Retrieve All Statistics
Fetches all metrics on all disbursements the organization has created. The response includes basic aggregations on payments, receivers, receiver wallets, and assets.
Retrieve All Statistics
curl --request GET \
--url https://api.example.com/statistics \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/statistics"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/statistics', 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.example.com/statistics",
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: <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.example.com/statistics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.example.com/statistics")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/statistics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total_disbursements": 20,
"payment_counters": {
"canceled": 123,
"draft": 1,
"ready": 2,
"pending": 3,
"paused": 1,
"success": 5,
"failed": 1,
"total": 14
},
"payment_amounts_by_asset": [
{
"asset_code": "USDC",
"asset_issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
"payment_amounts": {
"canceled": "<string>",
"draft": "100.00",
"ready": "200.00",
"pending": "300.00",
"paused": "100.00",
"success": "500.00",
"failed": "100.00",
"average": "100.00",
"total": "1400.00"
}
}
],
"receiver_wallets_counters": {
"draft": 1,
"ready": 1,
"registered": 1,
"flagged": 1,
"total": 4
},
"total_receivers": 1000
}{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "distribution wallet not found"
}Authorizations
Authorization header containing an SDP JWT (ES256) or an SDP_ API key.
Headers
Optional. Narrows the statistics to a single distribution account. Naming an account outside your access returns 404 rather than disclosing that it exists. Omit it to cover every account you have access to.
Response
General Statistics response
Total number of disbursements
Example:
20
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Total number of receivers
Example:
1000
Retrieve All Statistics
curl --request GET \
--url https://api.example.com/statistics \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/statistics"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/statistics', 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.example.com/statistics",
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: <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.example.com/statistics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.example.com/statistics")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/statistics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total_disbursements": 20,
"payment_counters": {
"canceled": 123,
"draft": 1,
"ready": 2,
"pending": 3,
"paused": 1,
"success": 5,
"failed": 1,
"total": 14
},
"payment_amounts_by_asset": [
{
"asset_code": "USDC",
"asset_issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
"payment_amounts": {
"canceled": "<string>",
"draft": "100.00",
"ready": "200.00",
"pending": "300.00",
"paused": "100.00",
"success": "500.00",
"failed": "100.00",
"average": "100.00",
"total": "1400.00"
}
}
],
"receiver_wallets_counters": {
"draft": 1,
"ready": 1,
"registered": 1,
"flagged": 1,
"total": 4
},
"total_receivers": 1000
}{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "distribution wallet not found"
}