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

# Get Payment Breakdown Grouped

> Get payment breakdown data with grouping and per-group pagination.

This endpoint returns all data in a single response, including:
- Groups with their summaries and individual rows (first page)
- Grand totals across all data

When `groupKey` and `page` are provided, returns only that specific page
for the requested group (GroupPageResponse).

Pagination flow:
1. Initial load: All groups + first page each
2. Page navigation: Specific group + requested page



## OpenAPI

````yaml get /analytics/dashboards/payment-breakdown/payment-breakdown-grouped
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /analytics/dashboards/payment-breakdown/payment-breakdown-grouped:
    get:
      tags:
        - provider
        - analytics
        - analytics
      summary: Get Payment Breakdown Grouped
      description: |-
        Get payment breakdown data with grouping and per-group pagination.

        This endpoint returns all data in a single response, including:
        - Groups with their summaries and individual rows (first page)
        - Grand totals across all data

        When `groupKey` and `page` are provided, returns only that specific page
        for the requested group (GroupPageResponse).

        Pagination flow:
        1. Initial load: All groups + first page each
        2. Page navigation: Specific group + requested page
      operationId: >-
        get_payment_breakdown_grouped_analytics_dashboards_payment_breakdown_payment_breakdown_grouped_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: group_by
          in: query
          required: true
          schema:
            enum:
              - location
              - provider
              - payment_medium
              - created_date
              - week
              - month
            type: string
            title: Group By
        - name: timezone
          in: query
          required: true
          schema:
            type: string
            description: Timezone for date grouping (e.g., 'America/New_York', 'UTC')
            title: Timezone
          description: Timezone for date grouping (e.g., 'America/New_York', 'UTC')
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            default: 20
            title: Page Size
        - name: group_key
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Group Key
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Page
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            default: created_date
            title: Sort By
        - name: sort_direction
          in: query
          required: false
          schema:
            enum:
              - asc
              - desc
            type: string
            default: desc
            title: Sort Direction
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Start Date
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: End Date
        - name: location_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Location Ids
        - name: location_names
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Location Names
        - name: patient_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Patient Ids
        - name: payment_mediums
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Payment Mediums
        - name: payment_statuses
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Payment Statuses
        - name: min_amount
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: Min Amount
        - name: max_amount
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: Max Amount
        - name: comment
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Comment
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PaymentBreakdownGroupedResponse'
                  - $ref: >-
                      #/components/schemas/decoda__apps__api__routes__analytics__dashboards__payment_breakdown__GroupPageResponse
                title: >-
                  Response Get Payment Breakdown Grouped Analytics Dashboards
                  Payment Breakdown Payment Breakdown Grouped Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PaymentBreakdownGroupedResponse:
      properties:
        groups:
          items:
            $ref: '#/components/schemas/PaymentBreakdownGroup'
          type: array
          title: Groups
        grandTotals:
          $ref: '#/components/schemas/PaymentBreakdownSummary'
        totalCount:
          type: integer
          title: Totalcount
      type: object
      required:
        - groups
        - grandTotals
        - totalCount
      title: PaymentBreakdownGroupedResponse
      description: Complete response from the payment breakdown grouped endpoint.
    decoda__apps__api__routes__analytics__dashboards__payment_breakdown__GroupPageResponse:
      properties:
        groupKey:
          type: string
          title: Groupkey
        rows:
          items:
            $ref: '#/components/schemas/PaymentBreakdownItem'
          type: array
          title: Rows
        page:
          type: integer
          title: Page
        totalPages:
          type: integer
          title: Totalpages
      type: object
      required:
        - groupKey
        - rows
        - page
        - totalPages
      title: GroupPageResponse
      description: Response for fetching a single group's page.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaymentBreakdownGroup:
      properties:
        key:
          type: string
          title: Key
        label:
          type: string
          title: Label
        count:
          type: integer
          title: Count
        summary:
          $ref: '#/components/schemas/PaymentBreakdownSummary'
        rows:
          items:
            $ref: '#/components/schemas/PaymentBreakdownItem'
          type: array
          title: Rows
        totalPages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totalpages
      type: object
      required:
        - key
        - label
        - count
        - summary
        - rows
      title: PaymentBreakdownGroup
      description: A single group in the payment breakdown response.
    PaymentBreakdownSummary:
      properties:
        totalPayments:
          type: integer
          title: Totalpayments
          default: 0
        totalAmount:
          type: integer
          title: Totalamount
          default: 0
        totalFee:
          type: integer
          title: Totalfee
          default: 0
        totalNetAmount:
          type: integer
          title: Totalnetamount
          default: 0
        uniquePatients:
          type: integer
          title: Uniquepatients
          default: 0
        uniqueLocations:
          type: integer
          title: Uniquelocations
          default: 0
      type: object
      title: PaymentBreakdownSummary
      description: Aggregated summary for a group or grand totals.
    PaymentBreakdownItem:
      properties:
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Date when the payment was created
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
          description: Location name where the payment occurred
        patient:
          $ref: '#/components/schemas/PatientTiny'
          description: Patient information
        paymentMedium:
          type: string
          title: Paymentmedium
          description: Payment medium used
        paymentMethodType:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentmethodtype
          description: Payment method type (card, bank, etc.)
        paymentMethodDetails:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentmethoddetails
          description: Payment method details (last 4 digits, etc.)
        amount:
          type: integer
          title: Amount
          description: Payment amount in cents
        fee:
          type: integer
          title: Fee
          description: Fee amount in cents
        netAmount:
          type: integer
          title: Netamount
          description: Net amount after fees in cents
        status:
          type: string
          title: Status
          description: Payment status
        paymentId:
          type: string
          title: Paymentid
          description: Payment ID for reference
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: Charge comment (from associated charge)
      type: object
      required:
        - createdDate
        - patient
        - paymentMedium
        - amount
        - fee
        - netAmount
        - status
        - paymentId
      title: PaymentBreakdownItem
      description: Individual payment breakdown item.
    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
    PatientTiny:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
          default: PATIENT
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
          description: The date of birth of the patient.
        onSchedulingBlacklist:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Onschedulingblacklist
          description: Whether the patient is on the scheduling blacklist.
      type: object
      required:
        - id
      title: PatientTiny
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType

````