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

# Get income statement (Estado de Resultados) for a year

> Returns a full P&L (Estado de Resultados) for the specified year with monthly breakdown.

    **Sections returned:**
    - ingresos: Revenue from subscriptions, visits, device sales, discounts
    - costos_directos: Technician costs (COGS from payroll boletas)
    - margen_bruto: Gross margin (ingresos - costos_directos)
    - gastos_operacionales: Operating expenses by category + payroll
    - resultado_operacional: Operating result
    - gastos_financieros: Financial expenses by category
    - resultado_neto: Net result

    **Projection**: Months after currentMonth use a 3-month rolling average.



## OpenAPI

````yaml /generated/specs/finance.json get /api/v1/analytics/income-statement
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/analytics/income-statement:
    get:
      tags:
        - Analytics - Dashboard
      summary: Get income statement (Estado de Resultados) for a year
      description: >-
        Returns a full P&L (Estado de Resultados) for the specified year with
        monthly breakdown.

            **Sections returned:**
            - ingresos: Revenue from subscriptions, visits, device sales, discounts
            - costos_directos: Technician costs (COGS from payroll boletas)
            - margen_bruto: Gross margin (ingresos - costos_directos)
            - gastos_operacionales: Operating expenses by category + payroll
            - resultado_operacional: Operating result
            - gastos_financieros: Financial expenses by category
            - resultado_neto: Net result

            **Projection**: Months after currentMonth use a 3-month rolling average.
      operationId: FinancialStatementsController_getIncomeStatement
      parameters:
        - name: year
          required: true
          in: query
          description: Year for the income statement
          schema:
            example: 2026
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncomeStatementResponseDto'
        '400':
          description: Invalid year parameter
      security:
        - bearerAuth: []
components:
  schemas:
    IncomeStatementResponseDto:
      type: object
      properties:
        year:
          type: number
          description: Year of the income statement
        months:
          description: 'Month labels: ["Ene", "Feb", ..., "Dic"]'
          type: array
          items:
            type: string
        sections:
          type: object
          description: >-
            Full income statement sections with ingresos, costos, gastos, and
            results
        meta:
          $ref: '#/components/schemas/IncomeStatementMetaDto'
      required:
        - year
        - months
        - sections
        - meta
    IncomeStatementMetaDto:
      type: object
      properties:
        currentMonth:
          type: number
          description: Current month (1-12). Months after this are projected.
        projectionMethod:
          type: string
          description: Projection method used for future months
      required:
        - currentMonth
        - projectionMethod
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Token de sesión Better Auth para rutas de backoffice; las rutas de
        portal usan su token propio.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.