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

# Get a fiscal totals summary for a filtered set of invoices

> Subtotal/total are summed via SQL (unbounded). IVA is computed by parsing each matching invoice's stamped XML — capped at 2000 matching invoices per request; beyond that, `iva` is `null` and `ivaCapped` is `true`, and the caller should narrow the date range.



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json get /invoices/report/summary
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /invoices/report/summary:
    get:
      tags:
        - invoices
      summary: Get a fiscal totals summary for a filtered set of invoices
      description: >-
        Subtotal/total are summed via SQL (unbounded). IVA is computed by
        parsing each matching invoice's stamped XML — capped at 2000 matching
        invoices per request; beyond that, `iva` is `null` and `ivaCapped` is
        `true`, and the caller should narrow the date range.
      operationId: InvoicesController_reportSummary
      parameters:
        - name: dateFrom
          required: false
          in: query
          description: >-
            Filtra por fecha de registro en Timbrix (createdAt), desde
            (inclusive, ISO 8601). Un valor de solo fecha (YYYY-MM-DD) se ancla
            al inicio del día en America/Mexico_City.
          schema:
            example: '2026-08-01'
            type: string
        - name: dateTo
          required: false
          in: query
          description: >-
            Filtra por fecha de registro en Timbrix (createdAt), hasta
            (inclusive, ISO 8601). Un valor de solo fecha (YYYY-MM-DD) se ancla
            al final del día (23:59:59.999) en America/Mexico_City, incluyendo
            el día completo.
          schema:
            example: '2026-08-31'
            type: string
        - name: type
          required: false
          in: query
          description: Filtra por tipo de comprobante
          schema:
            type: string
            enum:
              - I
              - E
              - T
        - name: status
          required: false
          in: query
          description: Filtra por estatus
          schema:
            type: string
            enum:
              - vigente
              - cancelado
        - name: rfcReceptor
          required: false
          in: query
          description: Filtra por RFC exacto del receptor
          schema:
            example: XAXX010101000
            type: string
        - name: environment
          required: false
          in: query
          description: >-
            Filtra por entorno. Ignorado para peticiones autenticadas con API
            key (siempre se usa el entorno de la key). Para una sesión de
            Supabase, por defecto es 'production' — pasa este parámetro para
            incluir CFDI de sandbox.
          schema:
            type: string
            enum:
              - sandbox
              - production
        - name: X-Organization-Id
          in: header
          description: >-
            Required for Supabase session auth. Ignored when authenticating with
            an API key (the organization resolves from the key).
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceReportSummaryDto'
      security:
        - apiKey: []
        - bearer: []
components:
  schemas:
    InvoiceReportSummaryDto:
      type: object
      properties:
        subtotal:
          type: number
          example: 12500.5
        total:
          type: number
          example: 14500.58
        iva:
          type: object
          example: 2000.08
          nullable: true
          description: >-
            Suma de IVA trasladado leído del XML de cada CFDI — null cuando el
            rango filtrado excede el límite calculable (ver ivaCapped)
        ivaCapped:
          type: boolean
          example: false
          description: >-
            true cuando el rango filtrado tiene demasiados CFDI para calcular
            IVA en esta solicitud — reduce el rango de fechas
        retenciones:
          type: object
          example: 350.5
          nullable: true
          description: >-
            Suma de impuestos retenidos (ISR, IVA retenido, etc.) leída del XML
            de cada CFDI — null cuando el rango filtrado excede el límite
            calculable (ver ivaCapped)
        ivaIncomplete:
          type: boolean
          example: false
          description: >-
            true cuando uno o más CFDI del rango filtrado no pudieron parsearse
            — iva/retenciones están incompletos (subestimados) para este reporte
        vigenteCount:
          type: number
          example: 48
        canceladoCount:
          type: number
          example: 2
        totalCount:
          type: number
          example: 50
      required:
        - subtotal
        - total
        - iva
        - ivaCapped
        - retenciones
        - ivaIncomplete
        - vigenteCount
        - canceladoCount
        - totalCount
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API Key for authentication (format: sk_...)'
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````