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

# Detalle de una factura del cliente

> Campos del listado más textos, plazo y el DTE vinculado (saldo, enlace de MercadoPago y si admite pago en línea).



## OpenAPI

````yaml /generated/specs/atlas-portal.json get /api/v1/internal/atlas-portal/clients/{atlasClientId}/invoices/{invoiceId}
openapi: 3.0.0
info:
  title: Raul API - Portal del cliente (Atlas)
  description: >-
    Namespace interno que consume el backend de Atlas: facturacion y soporte de
    un cliente comercial resuelto por Client.atlas_client_id, con token de
    servicio propio.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/internal/atlas-portal/clients/{atlasClientId}/invoices/{invoiceId}:
    get:
      tags:
        - Atlas portal
      summary: Detalle de una factura del cliente
      description: >-
        Campos del listado más textos, plazo y el DTE vinculado (saldo, enlace
        de MercadoPago y si admite pago en línea).
      operationId: AtlasPortalInternalController_getInvoice
      parameters:
        - name: atlasClientId
          required: true
          in: path
          description: >-
            Id del client de Atlas (24 hex); se resuelve contra
            Client.atlas_client_id
          schema:
            type: string
            example: 64f1c0ffee0ddba11ce55aa1
        - name: invoiceId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalInvoiceDetailResponseDto'
        '401':
          description: Token de servicio inválido (UNAUTHORIZED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalErrorResponseDto'
        '404':
          description: >-
            Sin vínculo o factura de otro cliente (CLIENT_NOT_LINKED,
            INVOICE_NOT_FOUND)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalErrorResponseDto'
      security:
        - bearerAuth: []
components:
  schemas:
    AtlasPortalInvoiceDetailResponseDto:
      type: object
      properties:
        contractVersion:
          type: number
          description: Versión del contrato; el consumidor acepta la vigente y la anterior
          example: 1
          minimum: 1
        invoice:
          $ref: '#/components/schemas/AtlasPortalInvoiceDetailDto'
      required:
        - contractVersion
        - invoice
    AtlasPortalErrorResponseDto:
      type: object
      properties:
        contractVersion:
          type: number
          description: Versión del contrato; el consumidor acepta la vigente y la anterior
          example: 1
          minimum: 1
        code:
          type: string
          enum:
            - CLIENT_NOT_LINKED
            - CLIENT_WITHOUT_ATLAS_LINK
            - INVOICE_NOT_FOUND
            - INVOICE_NOT_PAYABLE
            - TICKET_NOT_FOUND
            - TICKET_CLOSED
            - TOKEN_INVALID
            - TOKEN_WITHOUT_EMAIL
            - VALIDATION_ERROR
            - UNAUTHORIZED
        message:
          type: string
      required:
        - contractVersion
        - code
        - message
    AtlasPortalInvoiceDetailDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        folio:
          type: string
          nullable: true
          example: F33-10452
        taxStatus:
          type: string
          enum:
            - pending
            - sent
            - accepted
            - rejected
            - creditNote
            - voided
        paymentStatus:
          type: string
          enum:
            - pending
            - paid
            - overdue
            - cancelled
        netAmount:
          type: number
          description: CLP sin decimales
          example: 250000
        taxAmount:
          type: number
          example: 47500
        totalAmount:
          type: number
          example: 297500
        amountPaid:
          type: number
          example: 0
        issueDate:
          type: string
          format: date
          example: '2026-08-01'
        dueDate:
          type: string
          format: date
          example: '2026-08-11'
        creditNote:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/AtlasPortalCreditNoteReferenceDto'
        payableOnline:
          type: boolean
          description: >-
            DTE con folio, no PAID/REFUNDED/CANCELLED y con saldo, y factura sin
            pagar ni anular: se puede pagar en línea (también en el pago
            múltiple)
        concept:
          type: string
          nullable: true
          example: Servicio GPS agosto
        publicNotes:
          type: string
          nullable: true
        period:
          type: string
          nullable: true
          example: 2026-08
        paymentTermsDays:
          type: number
          example: 10
        receiverName:
          type: string
          example: Transportes Ejemplo SpA
        dteId:
          type: string
          format: uuid
          nullable: true
          description: DTE vinculado (último no borrado con invoice_id); null sin DTE
        amountResidual:
          type: number
          nullable: true
          description: Saldo del DTE en CLP; null sin DTE
          example: 297500
        mpInitPoint:
          type: string
          nullable: true
      required:
        - id
        - folio
        - taxStatus
        - paymentStatus
        - netAmount
        - taxAmount
        - totalAmount
        - amountPaid
        - issueDate
        - dueDate
        - creditNote
        - payableOnline
        - concept
        - publicNotes
        - period
        - paymentTermsDays
        - receiverName
        - dteId
        - amountResidual
        - mpInitPoint
    AtlasPortalCreditNoteReferenceDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        folio:
          type: string
          nullable: true
          example: NC61-212
        issueDate:
          type: string
          format: date
          example: '2026-07-20'
      required:
        - id
        - folio
        - issueDate
  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.