> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get payment 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>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json get /api/apps/{app_id}/payments/analytics
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - ApiKeyAuth: []
paths:
  /api/apps/{app_id}/payments/analytics:
    get:
      summary: Get payment analytics
      description: >-
        <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>
      operationId: get_payment_analytics_api_apps__app_id__payments_analytics_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose payments to read.
            title: App Id
          description: ID of the app whose payments to read.
          example: 6820f3a4e7b91d003c45a1f2
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              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.
            title: Start Date
          description: >-
            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.
          example: '2026-08-01T00:00:00Z'
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Last moment of the window, as an ISO 8601 timestamp. Send it
              together with `start_date`.
            title: End Date
          description: >-
            Last moment of the window, as an ISO 8601 timestamp. Send it
            together with `start_date`.
          example: '2026-08-31T23:59:59Z'
        - name: period
          in: query
          required: false
          schema:
            enum:
              - 7d
              - 30d
              - 90d
            type: string
            description: >-
              Window to use when you send no dates, counted back over whole UTC
              days including today. Either `7d`, `30d` or `90d`.
            default: 30d
            title: Period
          description: >-
            Window to use when you send no dates, counted back over whole UTC
            days including today. Either `7d`, `30d` or `90d`.
          example: 30d
        - name: currencies
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              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`.
            title: Currencies
          description: >-
            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`.
          example: usd,eur
      responses:
        '200':
          description: The app's payment totals and daily series.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAnalyticsResponse'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            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':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PaymentAnalyticsResponse:
      properties:
        summary:
          $ref: '#/components/schemas/PaymentSummary'
          description: Totals across the whole window.
        daily:
          items:
            $ref: '#/components/schemas/DailyMetrics'
          type: array
          title: Daily
          description: >-
            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.
          example:
            - date: '2026-08-25'
              payment_count: 4
              payments: 8200
              unique_customers: 4
        available_currencies:
          items:
            type: string
          type: array
          title: Available Currencies
          description: >-
            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.
          default: []
          example:
            - usd
            - eur
      type: object
      required:
        - summary
        - daily
      title: PaymentAnalyticsResponse
      description: An app's payment totals and its day-by-day series.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaymentSummary:
      properties:
        gross_revenue:
          type: integer
          title: Gross Revenue
          description: >-
            Everything customers paid, in the smallest unit of `currency`, so
            `125000` is 1,250.00 in a currency with two decimal places.
          default: 0
          example: 125000
        total_refunds:
          type: integer
          title: Total Refunds
          description: >-
            Everything refunded to customers, in the smallest unit of
            `currency`, so `125000` is 1,250.00 in a currency with two decimal
            places.
          default: 0
          example: 4500
        total_disputes:
          type: integer
          title: Total Disputes
          description: >-
            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.
          default: 0
          example: 0
        net_revenue:
          type: integer
          title: Net Revenue
          description: >-
            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.
          default: 0
          example: 120500
        transaction_count:
          type: integer
          title: Transaction Count
          description: How many payments were taken in the window.
          default: 0
          example: 64
        refund_count:
          type: integer
          title: Refund Count
          description: How many refunds were issued in the window.
          default: 0
          example: 3
        dispute_count:
          type: integer
          title: Dispute Count
          description: How many disputes the customer won in the window.
          default: 0
          example: 0
        unique_customers:
          type: integer
          title: Unique Customers
          description: How many distinct customers paid in the window.
          default: 0
          example: 51
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: >-
            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.
          example: usd
      type: object
      title: PaymentSummary
      description: Payment totals for the window.
    DailyMetrics:
      properties:
        date:
          type: string
          title: Date
          description: The day these totals cover, as `YYYY-MM-DD` in UTC.
          example: '2026-08-25'
        payments:
          type: integer
          title: Payments
          description: >-
            Paid that day, in the smallest unit of `currency`, so `125000` is
            1,250.00 in a currency with two decimal places.
          default: 0
          example: 8200
        payment_count:
          type: integer
          title: Payment Count
          description: Payments taken that day.
          default: 0
          example: 4
        refunds:
          type: integer
          title: Refunds
          description: >-
            Refunded that day, in the smallest unit of `currency`, so `125000`
            is 1,250.00 in a currency with two decimal places.
          default: 0
          example: 0
        refund_count:
          type: integer
          title: Refund Count
          description: Refunds issued that day.
          default: 0
          example: 0
        disputes:
          type: integer
          title: Disputes
          description: >-
            Lost to disputes that day, in the smallest unit of `currency`, so
            `125000` is 1,250.00 in a currency with two decimal places.
          default: 0
          example: 0
        dispute_count:
          type: integer
          title: Dispute Count
          description: Disputes the customer won that day.
          default: 0
          example: 0
        unique_customers:
          type: integer
          title: Unique Customers
          description: Distinct customers who paid that day.
          default: 0
          example: 4
      type: object
      required:
        - date
      title: DailyMetrics
      description: Payment totals for one day.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````