curl --request GET \
--url https://api.paygentic.io/v0/profitability \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/profitability"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/profitability', 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.paygentic.io/v0/profitability",
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://api.paygentic.io/v0/profitability"
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://api.paygentic.io/v0/profitability")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/profitability")
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{
"object": "profitability_summary",
"currency": "<string>",
"rows": [
{
"customerId": "<string>",
"customerName": "<string>",
"netRevenue": "<string>",
"totalCost": "<string>",
"profit": "<string>",
"marginPct": "<string>",
"trend": {
"values": [
"<string>"
],
"periodChange": 123
}
}
],
"warnings": [
"<string>"
]
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Get profitability summary
Returns a per-customer profitability summary for a merchant over a date range. Each row aggregates revenue (from issued + paid invoices), cost (from metered cost discovery), profit, and margin. Customers are ranked by profit descending and capped at topN; the remainder is rolled into a single self-consistent ‘Other’ row whose revenue, cost, and profit reflect the same set of customers. Rows are inner-joined against the merchant’s customer list, so orphaned meter subjects from deleted or unknown customers are dropped.
curl --request GET \
--url https://api.paygentic.io/v0/profitability \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/profitability"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/profitability', 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.paygentic.io/v0/profitability",
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://api.paygentic.io/v0/profitability"
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://api.paygentic.io/v0/profitability")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/profitability")
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{
"object": "profitability_summary",
"currency": "<string>",
"rows": [
{
"customerId": "<string>",
"customerName": "<string>",
"netRevenue": "<string>",
"totalCost": "<string>",
"profit": "<string>",
"marginPct": "<string>",
"trend": {
"values": [
"<string>"
],
"periodChange": 123
}
}
],
"warnings": [
"<string>"
]
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Query Parameters
Merchant whose customers to summarize Unique identifier for an organization
^org_[a-zA-Z0-9]+$Start of the time range (ISO 8601 format)
End of the time range (ISO 8601 format)
Number of top customers (by profit) to return individually. The rest are rolled into a single 'Other' row.
1 <= x <= 100ISO 4217 currency code to scope the summary. Defaults to the merchant's primary currency.
3Time bucket granularity for the per-customer revenue trend. When omitted, the server picks a reasonable bucket from the window length.
hour, day, week Response
Profitability summary
Object type identifier
"profitability_summary"ISO 4217 currency code applied to revenue and cost values
Top-N customer rows by profit descending, optionally followed by a single 'Other' row when more than topN customers contributed.
101Show child attributes
Show child attributes
Non-fatal warnings collected during cost discovery (e.g. an individual cost query failed). Empty array on a clean run.
100Was this page helpful?