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

# Consultar documento de cobro

> Devuelve el documento completo y la revisión vigente del cobro. Requiere `public_invoices:read`.



## OpenAPI

````yaml /openapi/invoices-v1.json get /v1/invoices/{invoiceId}
openapi: 3.1.0
info:
  title: Cobrix API pública de documentos de cobro
  version: 1.0.0
  description: >-
    API de documentos de cobro con montos en unidades mayores de la moneda de
    referencia de la empresa. No admite pagos parciales.
  license:
    name: Propietaria
    url: https://cobrix.co/terms
servers:
  - url: https://api.cobrix.co/api
    description: Producción
  - url: https://sandbox-api.cobrix.co/api
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Documentos públicos
    description: Documentos de cobro públicos y su cobro vigente.
paths:
  /v1/invoices/{invoiceId}:
    get:
      tags:
        - Documentos públicos
      summary: Consultar documento de cobro
      description: >-
        Devuelve el documento completo y la revisión vigente del cobro. Requiere
        `public_invoices:read`.
      operationId: getPublicInvoice
      parameters:
        - $ref: '#/components/parameters/InvoiceId'
      responses:
        '200':
          description: Documento de cobro
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    InvoiceId:
      name: invoiceId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  headers:
    RateLimitLimit:
      description: Máximo de requests por ventana.
      schema:
        type: integer
        default: 300
    RateLimitRemaining:
      description: Requests disponibles en la ventana.
      schema:
        type: integer
    RateLimitReset:
      description: Timestamp Unix de reinicio.
      schema:
        type: integer
    RetryAfter:
      description: Segundos antes de reintentar.
      schema:
        type: integer
  schemas:
    Invoice:
      type: object
      required:
        - id
        - name
        - description
        - amount
        - provider
        - provider_id
        - reference
        - status
        - remarks
        - metadata
        - due_date
        - created_at
        - updated_at
        - payment_id
        - is_test
        - partial_payment_config
        - payment
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        amount:
          type: number
        provider:
          type: string
        provider_id:
          type:
            - string
            - 'null'
        reference:
          type: string
        status:
          $ref: '#/components/schemas/InvoiceStatus'
        remarks:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        due_date:
          type:
            - string
            - 'null'
          format: date
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        payment_id:
          type:
            - string
            - 'null'
          format: uuid
        is_test:
          type: boolean
        partial_payment_config:
          type: 'null'
          description: Siempre null; esta API exige pago completo.
        payment:
          oneOf:
            - $ref: '#/components/schemas/InvoicePayment'
            - type: 'null'
    InvoiceStatus:
      type: string
      enum:
        - CREATED
        - PAID
        - CONCILIATED
        - PAID_FROM_PROVIDER
        - DELETE_FROM_PROVIDER
        - FAILED
    InvoicePayment:
      type: object
      required:
        - id
        - source
        - currency
        - amount
        - amount_label
        - title
        - description
        - phone
        - expiration_at
        - due_date
        - document_link
        - external_id
        - allows
        - status
        - is_test
        - created_at
        - paid_at
        - payment_link
        - redirect_url
        - provider_id
        - metadata
        - customer
        - method
        - splits
        - company
        - commission
      properties:
        id:
          type: string
          format: uuid
        source:
          type: string
        currency:
          type: string
        amount:
          type: number
        amount_label:
          type: string
        title:
          type: string
        description:
          type: string
        phone:
          type:
            - string
            - 'null'
        expiration_at:
          type:
            - string
            - 'null'
          format: date-time
        due_date:
          type:
            - string
            - 'null'
          format: date
        document_link:
          type:
            - string
            - 'null'
          format: uri
        external_id:
          type:
            - string
            - 'null'
        allows:
          $ref: '#/components/schemas/PaymentAllows'
        status:
          type: string
        is_test:
          type: boolean
        created_at:
          type: string
          format: date-time
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        payment_link:
          type:
            - string
            - 'null'
          format: uri
        redirect_url:
          type:
            - string
            - 'null'
          format: uri
        provider_id:
          type:
            - string
            - 'null'
        metadata:
          type: 'null'
        customer:
          type: 'null'
        method:
          type: 'null'
        splits:
          type: array
          items:
            type: object
            additionalProperties: true
        company:
          type: 'null'
        commission:
          type: 'null'
    InvoiceError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
        code:
          type: integer
        code_name:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    PaymentAllows:
      type: object
      required:
        - accounts
        - cards
        - card_extra
        - realtime
      properties:
        accounts:
          type: boolean
        cards:
          type: boolean
        card_extra:
          type: boolean
        realtime:
          type: boolean
  responses:
    Unauthorized:
      description: Llave ausente o inválida
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceError'
          example:
            message: Unauthenticated.
            code: 10002
            code_name: authentication_error
    Forbidden:
      description: Scope o compañía no habilitada
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceError'
          example:
            message: La llave API no tiene permiso para realizar esta operación.
            code: 10005
            code_name: forbidden
    NotFound:
      description: Documento inexistente o de otra empresa
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceError'
          example:
            message: El documento no existe o pertenece a otra compañía.
            code: 10004
            code_name: not_found
    RateLimited:
      description: Límite distribuido por llave, método y ruta
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceError'
          example:
            message: >-
              Demasiadas solicitudes. Espera el tiempo indicado en Retry-After e
              intenta nuevamente.
            code: 10029
            code_name: rate_limit_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Cobrix API key
      description: Llave cbx_live con scope de documentos públicos.

````