Analytics

Revenue composition

How the window's revenue and payments are composed, as the five donuts the dashboards draw: transaction fees by payment provider, settled transactions by plan kind, gross revenue by currency, payment attempts by outcome, and the monthly recurring revenue split by plan.

curl "https://api.subscriby.net/v1/analytics/composition?project_id=$PROJECT_ID&period=30d" \
  -H "Authorization: Bearer $SUBSCRIBY_TOKEN"
  • Every dataset carries total, unit (usd or count) and slices sorted largest first; each slice has its key, label, value, share_percent and the color the dashboard draws it in, so a client can render the same donut.
  • fees_by_provider, transactions_by_kind and revenue_by_currency read the same settled payments, so they agree with each other to the cent; payment_outcomes reads every attempt in the window, because a failed charge is exactly what it exists to show.
  • mrr_by_plan ignores the window: MRR is a balance, not a flow. It counts every active subscription on a recurring plan, normalised to a monthly USD figure, filed under its plan.
  • Labels come back in the creator's language.
get/v1/analytics/composition

Request

  • Base URL: https://api.subscriby.net
  • URL: https://api.subscriby.net/v1/analytics/composition
  • Auth: HTTP bearer

Query parameters

project_idstring uuid

Scope the figures to one project the token may see; omit for every project visible to it. A project outside the token's scope:project: allow-list is 404 TENANT_MISMATCH, an unknown one 404 RESOURCE_NOT_FOUND.

periodstring

The preset window: 7d, 14d, 30d (the default), 60d, 90d, mtd, qtd, ytd, 1y or all. Ignored when both from and to are given; an unknown value falls back to the default rather than failing.

fromstring date

The first day of an explicit window, YYYY-MM-DD. Both from and to are needed to override period.

tostring date

The last day of an explicit window, YYYY-MM-DD. Both from and to are needed to override period.

Response

The four dashboard donuts for the window plus the MRR base split by plan, each as total, unit and slices.

Example response

{
  "data": {
    "range": {
      "from": "2026-08-13",
      "to": "2026-09-12"
    },
    "mrr_by_plan": {
      "total": 4120,
      "unit": "usd",
      "slices": [
        {
          "key": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13",
          "label": "Gold",
          "value": 2980,
          "share_percent": 72.33,
          "color": "blue"
        }
      ]
    }
  },
  "meta": {
    "period": "30d",
    "project_id": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.