Skip to main content
GET
/
v0
/
profitability
Get profitability summary
curl --request GET \
  --url https://api.paygentic.io/v0/profitability \
  --header 'Authorization: Bearer <token>'
{
  "object": "<string>",
  "currency": "<string>",
  "rows": [
    {
      "customerId": "<string>",
      "customerName": "<string>",
      "netRevenue": "<string>",
      "totalCost": "<string>",
      "profit": "<string>",
      "marginPct": "<string>",
      "trend": {
        "values": [
          "<string>"
        ],
        "periodChange": 123
      }
    }
  ],
  "warnings": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

API key authentication

Query Parameters

merchantId
string
required

Merchant whose customers to summarize Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
from
string<date-time>
required

Start of the time range (ISO 8601 format)

to
string<date-time>
required

End of the time range (ISO 8601 format)

topN
integer
default:10

Number of top customers (by profit) to return individually. The rest are rolled into a single 'Other' row.

Required range: 1 <= x <= 100
currency
string

ISO 4217 currency code to scope the summary. Defaults to the merchant's primary currency.

Required string length: 3
bucketWidth
enum<string>
default:day

Time bucket granularity for the per-customer revenue trend. When omitted, the server picks a reasonable bucket from the window length.

Available options:
hour,
day,
week

Response

Profitability summary

object
string
required

Object type identifier

Allowed value: "profitability_summary"
currency
string
required

ISO 4217 currency code applied to revenue and cost values

rows
object[]
required

Top-N customer rows by profit descending, optionally followed by a single 'Other' row when more than topN customers contributed.

Maximum array length: 101
warnings
string[]

Non-fatal warnings collected during cost discovery (e.g. an individual cost query failed). Empty array on a clean run.

Maximum array length: 100