> ## 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 Plans Grouped

> Get payment plan analytics data with optional grouping.

Group options:
- "none": No grouping (single group with all plans)
- "status": Group by derived status (active/completed/failed/cancelled)
- "location": Group by location
- "frequency": Group by payment frequency



## OpenAPI

````yaml get /analytics/dashboards/payment-plans/payment-plans-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-plans/payment-plans-grouped:
    get:
      tags:
        - provider
        - analytics
        - analytics
      summary: Get Payment Plans Grouped
      description: |-
        Get payment plan analytics data with optional grouping.

        Group options:
        - "none": No grouping (single group with all plans)
        - "status": Group by derived status (active/completed/failed/cancelled)
        - "location": Group by location
        - "frequency": Group by payment frequency
      operationId: >-
        get_payment_plans_grouped_analytics_dashboards_payment_plans_payment_plans_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: false
          schema:
            enum:
              - status
              - location
              - frequency
              - none
            type: string
            default: none
            title: Group By
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: Start Date
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - 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: statuses
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Statuses
        - name: frequencies
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Frequencies
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentPlanGroupedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PaymentPlanGroupedResponse:
      properties:
        groups:
          items:
            $ref: '#/components/schemas/PaymentPlanGroup'
          type: array
          title: Groups
        grandTotals:
          $ref: '#/components/schemas/PaymentPlanSummary'
        totalCount:
          type: integer
          title: Totalcount
      type: object
      required:
        - groups
        - grandTotals
        - totalCount
      title: PaymentPlanGroupedResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaymentPlanGroup:
      properties:
        key:
          type: string
          title: Key
        label:
          type: string
          title: Label
        count:
          type: integer
          title: Count
        summary:
          $ref: '#/components/schemas/PaymentPlanSummary'
        rows:
          items:
            $ref: '#/components/schemas/PaymentPlanRow'
          type: array
          title: Rows
      type: object
      required:
        - key
        - label
        - count
        - summary
        - rows
      title: PaymentPlanGroup
    PaymentPlanSummary:
      properties:
        planCount:
          type: integer
          title: Plancount
          default: 0
        totalPlanValue:
          type: number
          title: Totalplanvalue
          default: 0
        totalAmountPaid:
          type: number
          title: Totalamountpaid
          default: 0
        totalAmountRemaining:
          type: number
          title: Totalamountremaining
          default: 0
        activeCount:
          type: integer
          title: Activecount
          default: 0
        completedCount:
          type: integer
          title: Completedcount
          default: 0
        failedCount:
          type: integer
          title: Failedcount
          default: 0
        cancelledCount:
          type: integer
          title: Cancelledcount
          default: 0
      type: object
      title: PaymentPlanSummary
    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
    PaymentPlanRow:
      properties:
        paymentPlanId:
          type: string
          title: Paymentplanid
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        patientFirstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientfirstname
        patientLastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientlastname
        planTotal:
          type: number
          title: Plantotal
        amountPaid:
          type: number
          title: Amountpaid
        amountRemaining:
          type: number
          title: Amountremaining
        installmentsCompleted:
          type: integer
          title: Installmentscompleted
        installmentsTotal:
          type: integer
          title: Installmentstotal
        frequency:
          type: string
          title: Frequency
        status:
          type: string
          title: Status
        nextPaymentDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Nextpaymentdate
        createdDate:
          type: string
          format: date-time
          title: Createddate
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
        paymentMethodLast4:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentmethodlast4
        paymentMethodBrand:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentmethodbrand
        plannedPayments:
          items:
            $ref: '#/components/schemas/PlannedPaymentDetail'
          type: array
          title: Plannedpayments
      type: object
      required:
        - paymentPlanId
        - patientId
        - patientFirstName
        - patientLastName
        - planTotal
        - amountPaid
        - amountRemaining
        - installmentsCompleted
        - installmentsTotal
        - frequency
        - status
        - nextPaymentDate
        - createdDate
        - locationId
        - locationName
        - paymentMethodLast4
        - paymentMethodBrand
        - plannedPayments
      title: PaymentPlanRow
    PlannedPaymentDetail:
      properties:
        id:
          type: string
          title: Id
        amount:
          type: number
          title: Amount
        paymentDate:
          type: string
          format: date
          title: Paymentdate
        status:
          type: string
          title: Status
      type: object
      required:
        - id
        - amount
        - paymentDate
        - status
      title: PlannedPaymentDetail

````