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

# Facturas

> Lista las facturas de la clínica, de la más reciente a la más antigua, con número, estado, totales y lo que queda por cobrar.

**Cuándo usarla:** Para encontrar una factura por paciente, estado o fecha de emisión, o para ver qué facturas siguen sin cobrar. Los importes van en céntimos.


## OpenAPI

````yaml /api-reference/openapi.es.json get /invoices
openapi: 3.1.0
info:
  title: API de Brelio
  version: '1'
  description: >-
    Todo lo que una persona hace en Brelio lo puede hacer un programa, con los
    mismos permisos, auditoría y límites. Cada endpoint se deriva del catálogo
    de operaciones.
servers:
  - url: https://api.brelio.app/v1
security: []
tags:
  - name: Agenda
  - name: Huecos libres
  - name: Citas
  - name: Pacientes
  - name: Profesionales
  - name: Servicios
  - name: Webhooks
  - name: Centros y accesos
  - name: Datos para integraciones
  - name: Facturación
paths:
  /invoices:
    get:
      tags:
        - Facturación
      summary: Facturas
      description: >-
        Lista las facturas de la clínica, de la más reciente a la más antigua,
        con número, estado, totales y lo que queda por cobrar.


        **Cuándo usarla:** Para encontrar una factura por paciente, estado o
        fecha de emisión, o para ver qué facturas siguen sin cobrar. Los
        importes van en céntimos.
      operationId: invoices.list
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            maxLength: 200
          description: '`next_cursor` de la página anterior. Omítelo para la primera página.'
        - name: limit
          in: query
          required: false
          schema:
            default: 25
            type: integer
            minimum: 1
            maximum: 100
          description: Tamaño de página, de 1 a 100.
        - name: patientId
          in: query
          required: false
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: Solo las facturas de este paciente.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - draft
              - issued
              - paid
              - partial
              - void
              - overdue
              - credit_note_issued
              - refunded
          description: Solo las facturas en este estado.
        - name: issuedFrom
          in: query
          required: false
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
          description: Solo las facturas emitidas en ese momento o después, ISO 8601.
        - name: issuedTo
          in: query
          required: false
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
          description: Solo las facturas emitidas en ese momento o antes, ISO 8601.
        - name: includeVoided
          in: query
          required: false
          schema:
            type: boolean
          description: Incluye también las facturas anuladas. Por defecto, false.
      responses:
        '200':
          description: Correcto
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        number:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Número fiscal asignado al emitir, como 2026-0042;
                            null mientras la factura es un borrador.
                        series:
                          type: string
                          description: >-
                            Serie de numeración: INV para facturas ordinarias, R
                            para rectificativas, S para simplificadas.
                        documentType:
                          type: string
                          enum:
                            - ordinary
                            - simplified
                          description: Factura ordinaria o factura simplificada.
                        status:
                          type: string
                          enum:
                            - draft
                            - issued
                            - paid
                            - partial
                            - void
                            - overdue
                            - credit_note_issued
                            - refunded
                          description: >-
                            draft (borrador), issued (emitida), partial (cobrada
                            en parte), paid (cobrada), void (anulada) o un
                            estado heredado de devolución.
                        patientId:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          description: El paciente al que corresponde la factura.
                        billToId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                          description: >-
                            El tercero pagador al que va dirigida la factura;
                            null si va dirigida al paciente.
                        subtotal:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: Base imponible tras descuentos, en céntimos.
                        tax:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: IVA y otros impuestos, en céntimos.
                        total:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: Total, en céntimos.
                        currency:
                          type: string
                          description: Código ISO 4217, como EUR.
                        correctsInvoiceId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                          description: >-
                            En una rectificativa, la factura que corrige; null
                            en las demás.
                        replacesInvoiceId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                          description: La factura a la que sustituyó, si la hay.
                        invoiceDate:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                              description: ISO 8601, en UTC.
                            - type: 'null'
                          description: >-
                            Fecha de expedición; null mientras la factura es un
                            borrador.
                        issuedAt:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                              description: ISO 8601, en UTC.
                            - type: 'null'
                        dueAt:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                              description: ISO 8601, en UTC.
                            - type: 'null'
                        paidAt:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                              description: ISO 8601, en UTC.
                            - type: 'null'
                        voidedAt:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                              description: ISO 8601, en UTC.
                            - type: 'null'
                        createdAt:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                          description: ISO 8601, en UTC.
                        updatedAt:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                          description: ISO 8601, en UTC.
                        pending:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: >-
                            Pendiente de cobro (0 en borradores, facturas
                            anuladas y rectificativas), en céntimos.
                      required:
                        - id
                        - number
                        - series
                        - documentType
                        - status
                        - patientId
                        - billToId
                        - subtotal
                        - tax
                        - total
                        - currency
                        - correctsInvoiceId
                        - replacesInvoiceId
                        - invoiceDate
                        - issuedAt
                        - dueAt
                        - paidAt
                        - voidedAt
                        - createdAt
                        - updatedAt
                        - pending
                      additionalProperties: false
                  next_cursor:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Pásalo como `cursor` para leer la página siguiente; null
                      en la última página.
                  has_more:
                    type: boolean
                required:
                  - data
                  - next_cursor
                  - has_more
                additionalProperties: false
        '401':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '402':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '503':
          description: Problem Details (RFC 9457) con un `code` estable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer: []
components:
  schemas:
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
        - detail
        - request_id
        - params
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        code:
          type: string
        detail:
          type: string
        request_id:
          type: string
        hint:
          type: string
        retryAfterSeconds:
          type: integer
        params:
          type: object
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        Clave de API de Brelio (de organización o personal) o un token de acceso
        de WorkOS.

````

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