Herald
OpenapiBilling

Payment statistics for the admin statistics page.

Counts only finalized attempts (Succeeded/Failed) attributed to their initiation day (`created_at`). Requires the `billing.view` permission.

GET
/api/bill/stats/payments

Counts only finalized attempts (Succeeded/Failed) attributed to their initiation day (created_at). Requires the billing.view permission.

Authorization

bearer_auth
headerAuthorizationBearer <token>

Query Parameters

days?|

Statistics window in days; only 7 or 30 are accepted. Defaults to 7.

Formatint32

Response Body

Payment statistics for the requested window

application/json
  1. response

Payment statistics over a fixed window. The success rate is derived on the client from succeeded / (succeeded + failed); amounts are grouped per currency and never summed across currencies.

amountsByCurrency*array<>
failedCount*integer
Formatint64
paymentTrend*array<>
providers*array<>
succeededCount*integer
Formatint64
windowDays*integer
Formatint32
Example Request
curl -X GET 'https://example.com/api/bill/stats/payments'
Example Response
{
  "amountsByCurrency": [
    {
      "amount": 0,
      "currency": "string"
    }
  ],
  "failedCount": 0,
  "paymentTrend": [
    {
      "date": "string",
      "failedCount": 0,
      "succeededCount": 0
    }
  ],
  "providers": [
    {
      "amountsByCurrency": [
        {
          "amount": 0,
          "currency": "string"
        }
      ],
      "failedCount": 0,
      "paymentProvider": "string",
      "succeededCount": 0
    }
  ],
  "succeededCount": 0,
  "windowDays": 0
}