---
title: "Get payment analytics"
method: GET
path: "/api/apps/{app_id}/payments/analytics"
---

# Get payment analytics

`GET /api/apps/{app_id}/payments/analytics`

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Returns what an app earned: the totals for a window, and a day-by-day series you can chart.

Money is reported in the smallest unit of the currency, so `125000` is 1,250.00 where the currency has two decimal places. Read `net_revenue` for what the app actually kept, since `gross_revenue` counts refunded and disputed payments too.

Set the window with `start_date` and `end_date`, which you must send together. With neither, `period` picks the last 7, 30 or 90 whole UTC days including today, and 30 is the default. Sending only one of the two dates falls back to `period` and silently ignores the date you sent, so send both or neither.

<Warning>Read `summary.currency` before you read any amount. It is `null` when the app took money in more than one currency in the window, and the amounts are then sums across currencies, which is not a number you can show anyone. Use `available_currencies` to see which ones are present and pass `currencies` to narrow to one.</Warning>

<Note>An unknown or malformed currency code in `currencies` is dropped rather than rejected, and if every code you send is unusable the response comes back as zeros rather than an error. Send lowercase three-letter codes taken from `available_currencies`.</Note>

Only live money is counted. Payments an app took while its payment provider was still in test mode are excluded.

<Note>This reads an analytics store rather than the payment provider, so the last few minutes of activity can be missing, and a window with no transactions is reported as zeros rather than as an error.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

## Path parameters

- `app_id` string, required — ID of the app whose payments to read.

## Query parameters

- `start_date` string, date-time, nullable — First moment of the window, as an ISO 8601 timestamp. Send it together with `end_date`, because sending only one falls back to `period` and ignores the one you sent.
- `end_date` string, date-time, nullable — Last moment of the window, as an ISO 8601 timestamp. Send it together with `start_date`.
- `period` '7d' | '30d' | '90d' — Window to use when you send no dates, counted back over whole UTC days including today. Either `7d`, `30d` or `90d`.
- `currencies` string, nullable — Narrow the totals to these currencies, as a comma-separated list of three-letter ISO 4217 codes. Case does not matter. For example, `usd,eur` reports only those two. Take the values from `available_currencies`.

## Response `200`

The app's payment totals and daily series.

- PaymentAnalyticsResponse — An app's payment totals and its day-by-day series.
  - `summary` PaymentSummary, required — Payment totals for the window.
    - `gross_revenue` integer — Everything customers paid, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places.
    - `total_refunds` integer — Everything refunded to customers, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places.
    - `total_disputes` integer — Everything lost to disputes customers won, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places. Open disputes are not counted.
    - `net_revenue` integer — What the app actually kept, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places. It is `gross_revenue` less `total_refunds` and `total_disputes`, and it can be negative in a window with more refunds than sales.
    - `transaction_count` integer — How many payments were taken in the window.
    - `refund_count` integer — How many refunds were issued in the window.
    - `dispute_count` integer — How many disputes the customer won in the window.
    - `unique_customers` integer — How many distinct customers paid in the window.
    - `currency` string, nullable — Currency the amounts are in, as a lowercase three-letter ISO 4217 code. It is `null` when the window mixes currencies, in which case the amounts are sums across all of them and cannot be read as one currency, and also `null` when the window has no transactions at all.
  - `daily` DailyMetrics[], required — One entry per day that had activity, oldest first. A day with no transactions is absent rather than zero-filled, so chart against the window you asked for rather than assuming a contiguous series.
    - `date` string, required — The day these totals cover, as `YYYY-MM-DD` in UTC.
    - `payments` integer — Paid that day, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places.
    - `payment_count` integer — Payments taken that day.
    - `refunds` integer — Refunded that day, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places.
    - `refund_count` integer — Refunds issued that day.
    - `disputes` integer — Lost to disputes that day, in the smallest unit of `currency`, so `125000` is 1,250.00 in a currency with two decimal places.
    - `dispute_count` integer — Disputes the customer won that day.
    - `unique_customers` integer — Distinct customers who paid that day.
  - `available_currencies` string[] — Every currency the app took money in during the window, as lowercase three-letter ISO 4217 codes. Pass one or more of these back in `currencies` to narrow the totals to a single currency.

## Other responses

- `401` — Missing or invalid credentials.
- `403` — You don't have access to this app, or the app does not exist. A missing app and an app you cannot reach are deliberately the same answer.
- `422` — Validation Error

---

[API](https://skmtc.dev/adexad/apis/base44-app-management-api.md) · [All operations](https://skmtc.dev/adexad/apis/base44-app-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/adexad/base44-app-management-api/revisions/6ad855bf424f/schema)
