Skip to content

Analytics

Analytics endpoints return pre-aggregated reporting data for your merchant account: summary metrics for payment volume, refunds, payment counts, and new customers; bucketed payment volume; and subscription metrics including MRR, ARR, and subscription status counts. All endpoints are read-only.

Periods#

Every endpoint takes a period. period_start_at is required and period_end_at is optional, both as RFC 3339 timestamps. The period includes its start and excludes its end. An omitted end, or an end in the future, resolves to the request time truncated to the second, and the response echoes the resolved period_start_at and period_end_at.

A period can span at most 400 days, or 32 days with granularity=hour. A start that is not before the resolved end returns 400 INVALID_REQUEST with period_start_at as the parameter, and a period that is too long returns the same error for period_end_at. A query parameter an endpoint doesn't support returns 400 INVALID_REQUEST with detail code UNKNOWN_FIELD and the parameter in param, including range and include_previous_period, which earlier versions accepted.

Analytics does not compare periods. To compare, request a second period and compare the two responses, as Compare two periods shows.

Payment volume buckets#

The payment volume timeseries splits the period into buckets. granularity is hour, day (the default), week, or month, and weeks start on Monday. timezone is an IANA name such as America/New_York, defaults to UTC, and applies only to this endpoint. An invalid timezone returns 400 INVALID_REQUEST with detail code INVALID_VALUE and param: timezone. Sending timezone to the overview or subscriptions endpoint returns 400 INVALID_REQUEST with detail code UNKNOWN_FIELD and param: timezone.

  • Bucket boundaries fall on local hours, dates, Mondays, or the first of the month in timezone. The first and last buckets are clipped to the period, so a bucket's period_start_at and period_end_at are the clipped instants.
  • Buckets with no payments are included with a zero volume_money and payments_count.
  • When clocks go back, the repeated local hour produces two hourly buckets. When clocks go forward, the skipped hour produces none, and a calendar date that doesn't exist produces no daily bucket.

Currency#

Amounts in different currencies are never added together. volume_money, gross_volume_money, refunded_money, collected_money, mrr_money, arr_money, and payments_count are all in one currency, echoed as currency. Pass currency as a three-letter uppercase ISO 4217 code to choose it; omit it to get your account's default currency. An invalid code returns 400 INVALID_REQUEST with detail code INVALID_VALUE and param: currency.

Customer counts and subscription counts span currencies, because a customer or subscription isn't tied to one. currencies lists the currencies with activity, so you can offer the others as choices and request each one.

Metric definitions#

A payment counts once it has succeeded. Payments, refunds, customers, and subscriptions are selected by their creation time, and canceled subscriptions by their cancellation time.

  • gross_volume_money is the sum of succeeded payments created in the period, and payments_count is how many there were.
  • refunded_money is refunds created in the period that did not fail and were not canceled, whenever the refunded payment was made.
  • new_customers_count counts customers created in the period.
  • new_subscriptions_count counts subscriptions created in the period whose current status is trialing, active, paused, or past_due. Subscriptions waiting for their first payment and canceled subscriptions are excluded, so a past period's count can go down later.
  • canceled_subscriptions_count counts subscriptions canceled in the period.
  • collected_money is subscription payments that succeeded in the period, including recurring charges and setup fees.
  • mrr_money is monthly recurring revenue from active and past due subscriptions, with each subscription normalized to a month and rounded separately. arr_money is mrr_money times 12.
  • status_counts is the number of subscriptions in each status.

The subscription snapshot, which is mrr_money, arr_money, and status_counts, describes your subscriptions as they are now, is cached briefly, and doesn't depend on the period.

The responses don't include net volume or average payment. Derive net volume by subtracting refunded_money from gross_volume_money; it doesn't subtract processing fees or disputes. Derive an average payment by dividing gross_volume_money by payments_count.

Compare two periods#

Request each period separately, using the same currency, and compute the change yourself. This compares October 15 to 21 with the 7 days before it:

cURL
curl -G https://api.withflintpay.com/v1/analytics/overview \
  -H "Authorization: Bearer $FLINT_API_KEY" \
  -d period_start_at=2026-10-15T00:00:00Z \
  -d period_end_at=2026-10-22T00:00:00Z \
  -d currency=USD

curl -G https://api.withflintpay.com/v1/analytics/overview \
  -H "Authorization: Bearer $FLINT_API_KEY" \
  -d period_start_at=2026-10-08T00:00:00Z \
  -d period_end_at=2026-10-15T00:00:00Z \
  -d currency=USD

Because an end is excluded and a start is included, adjacent periods share a boundary without counting a payment twice. To compare a period that is still in progress fairly, end the earlier period at the same point in its own span, such as the same time of day.

Note:

For per-event data instead of aggregates, use webhooks or list the underlying resources directly.

Get analytics overview#

GET/v1/analytics/overview

Requires scope analytics.read

Rate limit: read

Returns high-level merchant analytics for the requested half-open period.

Query parameters

period_start_atstringRequired

Inclusive period start as an RFC 3339 instant. The period is [period_start_at, period_end_at), at most 400 days, or 32 days for hour granularity.

period_end_atstring

Exclusive period end as an RFC 3339 instant. Omitted or future values resolve to the request time, truncated to the second.

currencystring

ISO 4217 currency for every amount and payments_count. Defaults to the merchant's default currency. Customer and subscription counts span currencies. currencies lists the available currencies.

Response · 200

The analytics overview.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl "https://api.withflintpay.com/v1/analytics/overview?period_start_at=2026-08-02T16:00:00Z" \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The analytics overview.

JSON
{
  "data": {
    "currencies": [
      "USD"
    ],
    "currency": "USD",
    "gross_volume_money": {
      "amount": 125000,
      "currency": "USD"
    },
    "new_customers_count": 9,
    "payments_count": 48,
    "period_end_at": "2026-03-03T00:00:00Z",
    "period_start_at": "2026-03-01T00:00:00Z",
    "refunded_money": {
      "amount": 1000,
      "currency": "USD"
    }
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6M69N2X15R3VN1SHMMFDV"
}

Get payment volume timeseries#

GET/v1/analytics/payment-volume-timeseries

Requires scope analytics.read

Rate limit: read

Returns merchant payment volume buckets for the requested half-open period.

Query parameters

period_start_atstringRequired

Inclusive period start as an RFC 3339 instant. The period is [period_start_at, period_end_at), at most 400 days, or 32 days for hour granularity.

period_end_atstring

Exclusive period end as an RFC 3339 instant. Omitted or future values resolve to the request time, truncated to the second.

currencystring

ISO 4217 currency for every amount and payments_count. Defaults to the merchant's default currency. Customer and subscription counts span currencies. currencies lists the available currencies.

granularityenum

Bucket size: hour, day (default), week starting Monday, or month. Buckets follow local boundaries, clipped to the period. Repeated hours have two buckets; skipped hours and days have none. Empty buckets are included.

  • hour
  • day
  • week
  • month
timezonestring

IANA timezone for bucket boundaries. Defaults to UTC.

Response · 200

The payment volume timeseries.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl "https://api.withflintpay.com/v1/analytics/payment-volume-timeseries?period_start_at=2026-08-02T16:00:00Z" \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The payment volume timeseries.

JSON
{
  "data": {
    "buckets": [
      {
        "payments_count": 7,
        "period_end_at": "2026-03-11T04:00:00Z",
        "period_start_at": "2026-03-10T04:00:00Z",
        "volume_money": {
          "amount": 18000,
          "currency": "USD"
        }
      },
      {
        "payments_count": 9,
        "period_end_at": "2026-03-12T04:00:00Z",
        "period_start_at": "2026-03-11T04:00:00Z",
        "volume_money": {
          "amount": 22000,
          "currency": "USD"
        }
      }
    ],
    "currencies": [
      "USD"
    ],
    "currency": "USD",
    "granularity": "day",
    "period_end_at": "2026-03-12T04:00:00Z",
    "period_start_at": "2026-03-10T04:00:00Z",
    "timezone": "America/New_York"
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6PPFS788MY3WZKMAXHDZ8"
}

Get subscription analytics#

GET/v1/analytics/subscriptions

Requires scope analytics.read

Rate limit: read

Returns windowed subscription metrics plus current subscription snapshot metrics.

Query parameters

period_start_atstringRequired

Inclusive period start as an RFC 3339 instant. The period is [period_start_at, period_end_at), at most 400 days, or 32 days for hour granularity.

period_end_atstring

Exclusive period end as an RFC 3339 instant. Omitted or future values resolve to the request time, truncated to the second.

currencystring

ISO 4217 currency for every amount and payments_count. Defaults to the merchant's default currency. Customer and subscription counts span currencies. currencies lists the available currencies.

Response · 200

The subscription analytics payload.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl "https://api.withflintpay.com/v1/analytics/subscriptions?period_start_at=2026-08-02T16:00:00Z" \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The subscription analytics payload.

JSON
{
  "data": {
    "currencies": [
      "USD"
    ],
    "currency": "USD",
    "period_end_at": "2026-03-03T00:00:00Z",
    "period_start_at": "2026-03-01T00:00:00Z",
    "snapshot_metrics": {
      "arr_money": {
        "amount": 1558800,
        "currency": "USD"
      },
      "mrr_money": {
        "amount": 129900,
        "currency": "USD"
      },
      "status_counts": {
        "active_count": 42,
        "canceled_count": 18,
        "incomplete_count": 4,
        "past_due_count": 3,
        "paused_count": 2,
        "scheduled_count": 2,
        "trialing_count": 5
      }
    },
    "window_metrics": {
      "canceled_subscriptions_count": 3,
      "collected_money": {
        "amount": 485000,
        "currency": "USD"
      },
      "new_subscriptions_count": 14
    }
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6N45CBA9JBB8EXZG0MXHW"
}

Was this helpful?