---
title: "Payments analytics"
description: "Gross volume, refunds, chargebacks, failure rate + gateway/method/error breakdowns."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/organization/payments-analytics"
---
# Payments analytics

> Gross volume, refunds, chargebacks, failure rate + gateway/method/error breakdowns.

<api-operation method="GET" path="/v1/businesses/{biz}/payments_analytics">
<template v-slot:docs="">

The payments counterpart to `/analytics` (which is subscription revenue). Measures what the gateways did over a CALENDAR period resolved in the business timezone, each with its comparable previous period: gross volume, refunds, chargebacks, net volume, transaction count, successful payments, failed transactions/amount, failure rate (basis points) and pending payment intents — plus breakdowns by error cause, payment method and gateway. Same series shape as `/analytics` (`headline` + `points[]`), so one UI block consumes both. Aggregated in SQL.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
</tbody>
</table>

## Query parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        range
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Calendar-relative period; boundaries resolve in the business timezone. Weeks start on the business's <code>
        week_start
      </code>
      
       (default Sunday).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      <code>
        ALL
      </code>
      
       for the FX-converted roll-up, or a currency code to scope every figure (money AND counts) to it
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        gateway
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Filter to one <code>
        gateway_key
      </code>
      
       (<code>
        unknown
      </code>
      
       selects rows with none)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        payment_method
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Filter to one payment-method type — card / upi / … (<code>
        unknown
      </code>
      
       selects rows with none)
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        business_payments_analytics
      </code>
      
      . One of <code>
        business_payments_analytics
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        business
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The business id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        as_of
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the figures were computed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        range
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The selected range.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        timezone
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The business time zone.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        granularity
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The bucket size of the series.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        period
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The selected period.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        previous_period
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The period that the figures compare against.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The currency of the money figures.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        converted
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the figures are converted into <code>
        currency
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        available_currencies
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      Currencies you can select.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        missing_rates
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      Currencies that have no exchange rate and are left out.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        filters
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The filters that apply.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The values you can filter on.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        series
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      The metric time-series.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        breakdowns
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The breakdowns.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Business payments analytics
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Invalid range
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/payments_analytics" \
  -H "Authorization: Bearer $TMBILLING_API_KEY"
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "business_payments_analytics",
  "business": "biz_XXXXXXXXXXXX01",
  "as_of": "2026-03-14T09:30:00Z",
  "range": "last_30_days",
  "timezone": "America/New_York",
  "granularity": "day",
  "period": {
    "label": "Last 30 days",
    "start": "2026-09-21T00:00:00.000Z",
    "end": "2026-10-21T00:00:00.000Z"
  },
  "previous_period": {
    "label": "Last 30 days",
    "start": "2026-09-21T00:00:00.000Z",
    "end": "2026-10-21T00:00:00.000Z"
  },
  "currency": "USD",
  "converted": false,
  "available_currencies": [
    "USD"
  ],
  "missing_rates": [
    "EUR"
  ],
  "filters": {
    "gateway": "stripe",
    "payment_method": "card"
  },
  "options": {
    "gateways": [
      {
        "key": "stripe",
        "label": "Stripe"
      }
    ],
    "payment_methods": [
      {
        "key": "card",
        "label": "Card"
      }
    ]
  },
  "series": [
    {
      "key": "mrr",
      "label": "MRR",
      "kind": "money",
      "headline": {
        "kind": "money",
        "value": 1250000,
        "prev_value": 1180000,
        "prev_label": "Previous 12 months",
        "change_bps": 593
      },
      "points": [
        {
          "t": "2026-09-01",
          "label": "Sep 2026",
          "v": 1250000
        }
      ]
    }
  ],
  "breakdowns": {
    "error_details": [
      {
        "error_code": "insufficient_funds",
        "label": "Insufficient funds",
        "count": 14,
        "prev_count": 11,
        "amount_minor": 2900,
        "prev_amount_minor": 2900
      }
    ],
    "payment_methods": [
      {
        "key": "card",
        "label": "Card",
        "count": 120,
        "prev_count": 98,
        "amount_minor": 588000,
        "prev_amount_minor": 480200
      }
    ],
    "gateways": [
      {
        "key": "card",
        "label": "Card",
        "count": 120,
        "prev_count": 98,
        "amount_minor": 588000,
        "prev_amount_minor": 480200
      }
    ]
  }
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid range"
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
