Skip to main content
GET
/
v0
/
revenue
Get revenue summary
curl --request GET \
  --url https://api.paygentic.io/v0/revenue \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.paygentic.io/v0/revenue"

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/revenue', 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/revenue",
  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/revenue"

	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/revenue")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v0/revenue")

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": "<string>",
  "netRevenue": "<string>",
  "totalRefunds": "<string>",
  "refundCount": 123,
  "invoices": {
    "issued": {
      "count": 123,
      "amount": "<string>"
    },
    "outstanding": {
      "count": 123,
      "amount": "<string>"
    },
    "paid": {
      "count": 123,
      "amount": "<string>"
    },
    "writtenOff": {
      "count": 123,
      "amount": "<string>"
    }
  },
  "payments": {
    "completedCount": 123,
    "completedAmount": "<string>",
    "pendingCount": 123,
    "pendingAmount": "<string>",
    "expiredCount": 123,
    "expiredAmount": "<string>"
  },
  "trend": [
    {
      "timestamp": "2023-11-07T05:31:56Z",
      "issuedInvoices": "<string>",
      "writtenOffInvoices": "<string>",
      "completedPayments": "<string>",
      "groupBreakdown": [
        {
          "groupKey": "<string>",
          "groupLabel": "<string>",
          "issuedInvoices": "<string>"
        }
      ]
    }
  ],
  "groupBreakdown": [
    {
      "groupKey": "<string>",
      "groupLabel": "<string>",
      "outstanding": {
        "count": 123,
        "amount": "<string>"
      },
      "paid": {
        "count": 123,
        "amount": "<string>"
      },
      "writtenOff": {
        "count": 123,
        "amount": "<string>"
      }
    }
  ],
  "currencyBreakdown": [
    {
      "currency": "<string>",
      "netRevenue": "<string>",
      "invoices": {
        "issued": {
          "count": 123,
          "amount": "<string>"
        },
        "outstanding": {
          "count": 123,
          "amount": "<string>"
        },
        "paid": {
          "count": 123,
          "amount": "<string>"
        },
        "writtenOff": {
          "count": 123,
          "amount": "<string>"
        }
      },
      "payments": {
        "completedCount": 123,
        "completedAmount": "<string>",
        "pendingCount": 123,
        "pendingAmount": "<string>",
        "expiredCount": 123,
        "expiredAmount": "<string>"
      },
      "trend": [
        {
          "timestamp": "2023-11-07T05:31:56Z",
          "issuedInvoices": "<string>",
          "writtenOffInvoices": "<string>",
          "completedPayments": "<string>",
          "groupBreakdown": [
            {
              "groupKey": "<string>",
              "groupLabel": "<string>",
              "issuedInvoices": "<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

Authorization
string
header
required

API key authentication

Query Parameters

startTime
string<date-time>
required

Start of the time range (ISO 8601 format)

endTime
string<date-time>
required

End of the time range (ISO 8601 format)

bucketWidth
enum<string>
default:day

Time bucket granularity for trend data

Available options:
hour,
day,
week
merchantId
string

Filter by merchant ID. At least one of merchantId, subscriptionIds, or customerId must be provided. Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
customerId
string

Filter by customer ID. At least one of merchantId, subscriptionIds, or customerId must be provided.

subscriptionIds
string[]

Filter by subscription IDs. At least one of merchantId, subscriptionIds, or customerId must be provided.

currency
string

Filter all results to a single ISO 4217 currency code (e.g. 'USD'). When omitted, results include all currencies.

groupBy
enum<string>

Group invoice data by dimension. Allowed values: 'plan' (max 5 groups, top 4 + 'other' when exceeding), 'customer' (max 25 groups, top 24 + 'other' when exceeding, sorted by revenue descending), 'currency' (one entry per currency, primary currency first then alphabetical). Note: groupBy values are mutually exclusive — combining them returns a 400 error. When groupBy=currency is active, top-level netRevenue, invoices, and payments fields are omitted; currencyBreakdown is the sole data source.

Available options:
plan,
customer,
currency

Response

Revenue summary data

object
string
required

Object type identifier

Allowed value: "revenue_summary"
netRevenue
string

Net collected revenue in dollars (paid invoices + completed payments), already net of non-voided refunds. Omitted when groupBy=currency is active.

totalRefunds
string

Gross total of non-voided refunds (credit notes) issued in the period, in dollars. Already subtracted from netRevenue and invoice totals. Omitted when groupBy=currency is active.

refundCount
number

Number of non-voided refunds (credit notes) issued in the period. Omitted when groupBy=currency is active.

invoices
object

Invoice breakdown. Omitted when groupBy=currency is active.

payments
object

Payment breakdown. Omitted when groupBy=currency is active.

trend
object[]

Time-bucketed revenue trend data. Omitted when groupBy=currency is active.

groupBreakdown
object[]

Invoice breakdown by group dimension (only present when groupBy=plan or groupBy=customer is specified)

currencyBreakdown
object[]

Per-currency revenue aggregates (only present when groupBy=currency is specified). Primary currency appears first, then alphabetical by ISO code. When present, top-level netRevenue, invoices, payments, and trend fields are omitted.