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

# Get consolidated billing by parent client with child breakdown

> Get consolidated billing by parent client with child breakdown



## OpenAPI

````yaml /generated/specs/finance.json get /api/v1/factura/consolidated/by-parent/{parentClientId}
openapi: 3.0.0
info:
  title: Raul API - Finanzas
  description: >-
    Facturas, boletas, ejecuciones de billing, cuentas por pagar y medios de
    pago.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/factura/consolidated/by-parent/{parentClientId}:
    get:
      tags:
        - Billing - Facturas
      summary: Get consolidated billing by parent client with child breakdown
      description: Get consolidated billing by parent client with child breakdown
      operationId: FacturaController_getConsolidatedByParent
      parameters:
        - name: parentClientId
          required: true
          in: path
          description: Parent client ID
          schema:
            type: string
        - name: periodo
          required: true
          in: query
          description: Period in YYYY-MM format
          schema:
            type: string
            example: 2026-01
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FacturaConsolidadaByParentResponseDto'
        '404':
          description: Parent client not found
      security:
        - bearerAuth: []
components:
  schemas:
    FacturaConsolidadaByParentResponseDto:
      type: object
      properties:
        parent_client_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Parent client ID
        parent_name:
          type: string
          example: Empresa Matriz S.A.
          description: Parent client name
        periodo:
          type: string
          example: 2026-01
          description: Billing period
        valor_uf:
          type: number
          example: 38000
          description: UF value used for calculations
        fecha_generada:
          format: date-time
          type: string
          example: '2026-01-15T10:30:00.000Z'
          description: Date when this report was generated
        children_billing:
          description: Billing breakdown by child companies
          type: array
          items:
            $ref: '#/components/schemas/ChildBillingDto'
        direct_billing:
          description: Billing for subscriptions directly under parent (no child assigned)
          allOf:
            - $ref: '#/components/schemas/DirectBillingDto'
        grand_total_uf:
          type: number
          example: 25
          description: Grand total in UF (all children + direct)
        grand_total_clp:
          type: number
          example: 950000
          description: Grand total in CLP (all children + direct)
        total_subscriptions_count:
          type: number
          example: 15
          description: Total number of subscriptions across all children and direct
        total_visits_count:
          type: number
          example: 6
          description: Total number of visits across all children and direct
        total_sales_count:
          type: number
          example: 2
          description: Total number of sales across all children and direct
        children_count:
          type: number
          example: 3
          description: Number of child companies with billing
      required:
        - parent_client_id
        - parent_name
        - periodo
        - valor_uf
        - fecha_generada
        - children_billing
        - direct_billing
        - grand_total_uf
        - grand_total_clp
    ChildBillingDto:
      type: object
      properties:
        child_client_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Child client ID
        child_name:
          type: string
          example: Sucursal Norte S.A.
          description: Child client name
        subscriptions_count:
          type: number
          example: 10
          description: Number of subscriptions assigned to this child
        visits_count:
          type: number
          example: 3
          description: Number of billable visits assigned to this child
        sales_count:
          type: number
          example: 1
          description: Number of sales assigned to this child
        total_uf:
          type: number
          example: 12.5
          description: Total amount in UF for this child
        total_clp:
          type: number
          example: 475000
          description: Total amount in CLP for this child
        color_index:
          type: number
          example: 0
          description: Index for color-coding in frontend (0, 1, 2, etc.)
      required:
        - child_client_id
        - child_name
        - subscriptions_count
        - visits_count
        - sales_count
        - total_uf
        - total_clp
        - color_index
    DirectBillingDto:
      type: object
      properties:
        subscriptions_count:
          type: number
          example: 5
          description: Number of subscriptions directly under parent (no child assigned)
        total_uf:
          type: number
          example: 6.25
          description: Total amount in UF for direct subscriptions
        total_clp:
          type: number
          example: 237500
          description: Total amount in CLP for direct subscriptions
      required:
        - subscriptions_count
        - total_uf
        - total_clp
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication

````