> ## 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.

# Obtener factura por ID con detalles

> Operacion: Obtener factura por ID con detalles.



## OpenAPI

````yaml /generated/specs/finance.json get /api/v1/billing/invoices/{id}
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/billing/invoices/{id}:
    get:
      tags:
        - Invoices
      summary: Obtener factura por ID con detalles
      description: 'Operacion: Obtener factura por ID con detalles.'
      operationId: InvoiceDetailQueryController_getById
      parameters:
        - name: id
          required: true
          in: path
          description: UUID de la factura
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceWithDetailsResponseDto'
        '404':
          description: Factura no encontrada
      security:
        - bearerAuth: []
components:
  schemas:
    InvoiceWithDetailsResponseDto:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        status:
          type: string
        client_id:
          type: object
        receiver_rut:
          type: object
        receiver_name:
          type: string
        receiver_email:
          type: object
        receiver_address:
          type: object
        receiver_ciudad:
          type: object
        receiver_comuna:
          type: object
        receiver_giro:
          type: object
        issue_date:
          type: string
          format: date-time
        due_date:
          type: string
          format: date-time
        subtotal:
          type: number
        discount_total:
          type: number
        net_amount:
          type: number
        tax_rate:
          type: number
        tax_amount:
          type: number
        total_amount:
          type: number
        tax_amount_override:
          type: object
        total_amount_override:
          type: object
        amount_paid:
          type: number
        client_credit_balance:
          type: number
          description: >-
            Saldo a favor disponible del cliente desde sobrepagos de otras
            facturas
        uf_value_at_creation:
          type: object
        folio_prefix:
          type: object
        folio_number:
          type: object
        internal_notes:
          type: object
        public_notes:
          type: object
        concept:
          type: object
        periodo:
          type: object
        payment_terms_days:
          type: number
        credit_note_for_id:
          type: object
        credit_note_reason:
          type: object
        factura_id:
          type: object
        invoice_type:
          type: string
        parent_client_id:
          type: object
        billing_client_id:
          type: object
        oc_number:
          type: object
        hes_number:
          type: object
        requires_oc:
          type: boolean
        requires_hes:
          type: boolean
        detail_xlsx_url:
          type: object
        last_dte_error:
          type: object
        dte_retry_count:
          type: number
        dte_local_status:
          type: object
          description: local_status del DTE más reciente (estado del XML ante el SII)
        sii_status_detail:
          type: object
          description: Detalle libre devuelto por el SII para el DTE más reciente
        created_by:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: object
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItemResponseDto'
        events:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceEventResponseDto'
        credit_notes:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceResponseDto'
        references:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceReferenceResponseDto'
        dte_document_id:
          type: object
        dte_documents:
          type: array
          items:
            $ref: '#/components/schemas/DteDocumentSummaryDto'
        factoring:
          $ref: '#/components/schemas/InvoiceFactoringSummaryDto'
        factoring_capabilities:
          $ref: '#/components/schemas/InvoiceFactoringCapabilitiesDto'
      required:
        - id
        - type
        - status
        - receiver_name
        - issue_date
        - due_date
        - subtotal
        - discount_total
        - net_amount
        - tax_rate
        - tax_amount
        - total_amount
        - amount_paid
        - client_credit_balance
        - payment_terms_days
        - invoice_type
        - created_at
        - updated_at
        - line_items
        - events
        - credit_notes
        - references
        - factoring_capabilities
    InvoiceLineItemResponseDto:
      type: object
      properties:
        id:
          type: string
        invoice_id:
          type: string
        description:
          type: string
        quantity:
          type: number
        unit_price:
          type: number
        discount_pct:
          type: number
        subtotal:
          type: number
        unit_price_uf:
          type: object
        source_type:
          type: object
        source_id:
          type: object
        position:
          type: number
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - invoice_id
        - description
        - quantity
        - unit_price
        - discount_pct
        - subtotal
        - position
        - created_at
        - updated_at
    InvoiceEventResponseDto:
      type: object
      properties:
        id:
          type: string
        invoice_id:
          type: string
        event_type:
          type: string
        actor_id:
          type: object
        payload:
          type: object
        processed:
          type: boolean
        processed_at:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - invoice_id
        - event_type
        - processed
        - created_at
        - updated_at
    InvoiceResponseDto:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        status:
          type: string
        client_id:
          type: object
        receiver_rut:
          type: object
        receiver_name:
          type: string
        receiver_email:
          type: object
        receiver_address:
          type: object
        receiver_ciudad:
          type: object
        receiver_comuna:
          type: object
        receiver_giro:
          type: object
        issue_date:
          type: string
          format: date-time
        due_date:
          type: string
          format: date-time
        subtotal:
          type: number
        discount_total:
          type: number
        net_amount:
          type: number
        tax_rate:
          type: number
        tax_amount:
          type: number
        total_amount:
          type: number
        tax_amount_override:
          type: object
        total_amount_override:
          type: object
        amount_paid:
          type: number
        client_credit_balance:
          type: number
          description: >-
            Saldo a favor disponible del cliente desde sobrepagos de otras
            facturas
        uf_value_at_creation:
          type: object
        folio_prefix:
          type: object
        folio_number:
          type: object
        internal_notes:
          type: object
        public_notes:
          type: object
        concept:
          type: object
        periodo:
          type: object
        payment_terms_days:
          type: number
        credit_note_for_id:
          type: object
        credit_note_reason:
          type: object
        factura_id:
          type: object
        invoice_type:
          type: string
        parent_client_id:
          type: object
        billing_client_id:
          type: object
        oc_number:
          type: object
        hes_number:
          type: object
        requires_oc:
          type: boolean
        requires_hes:
          type: boolean
        detail_xlsx_url:
          type: object
        last_dte_error:
          type: object
        dte_retry_count:
          type: number
        dte_local_status:
          type: object
          description: local_status del DTE más reciente (estado del XML ante el SII)
        sii_status_detail:
          type: object
          description: Detalle libre devuelto por el SII para el DTE más reciente
        created_by:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: object
      required:
        - id
        - type
        - status
        - receiver_name
        - issue_date
        - due_date
        - subtotal
        - discount_total
        - net_amount
        - tax_rate
        - tax_amount
        - total_amount
        - amount_paid
        - client_credit_balance
        - payment_terms_days
        - invoice_type
        - created_at
        - updated_at
    InvoiceReferenceResponseDto:
      type: object
      properties:
        id:
          type: string
        invoice_id:
          type: string
        doc_number:
          type: string
        doc_type_code:
          type: string
        doc_type_name:
          type: string
        reference_code:
          type: object
        reason:
          type: object
        doc_date:
          type: string
          format: date-time
        odoo_reference_id:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - invoice_id
        - doc_number
        - doc_type_code
        - doc_type_name
        - doc_date
        - created_at
        - updated_at
    DteDocumentSummaryDto:
      type: object
      properties:
        id:
          type: string
        folio:
          type: object
        document_type:
          type: string
        local_status:
          type: string
        odoo_dte_status:
          type: object
        sii_track_id:
          type: object
        sii_status_detail:
          type: object
        intercambio_casilla_email:
          type: object
        intercambio_sent_at:
          type: object
        sii_accepted_at:
          type: object
        acceptance_status:
          type: object
        acceptance_updated_at:
          type: object
        acceptance_notes:
          type: object
        pdf_blob_url:
          type: object
        cedible_pdf_blob_url:
          type: object
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - document_type
        - local_status
        - updated_at
    InvoiceFactoringSummaryDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - processing
            - yielded
            - reconciliation_required
        partner_id:
          type: object
        partner_name:
          type: object
        yielded_at:
          type: object
        aec_attachment_id:
          type: object
        aec_attachment_name:
          type: object
        aec_entry_id:
          type: object
        aec_entry_name:
          type: object
        synced_at:
          type: string
        provider:
          type: string
          enum:
            - sii_direct
            - odoo
        aec_track_id:
          type: object
        rtc_estado:
          type: object
        rtc_glosa:
          type: object
        has_aec_xml:
          type: boolean
      required:
        - status
        - synced_at
    InvoiceFactoringCapabilitiesDto:
      type: object
      properties:
        can_create:
          type: boolean
        reason_code:
          type: object
        reason_label:
          type: object
      required:
        - can_create
  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.