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

# Detalha uma fatura de cartão de crédito com seus lançamentos.



## OpenAPI

````yaml /openapi/extat-openapi.json get /companies/credit-card-invoices/{id}
openapi: 3.0.0
info:
  contact:
    email: contato@cernedigital.io
    name: Cerne Digital
    url: https://cernedigital.io
  description: >-
    API REST da Extat Plataforma usada pelo painel web. Artefato OpenAPI 3.0
    para a documentação Mintlify (tags em PT-BR).
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Extat Plataforma - API REST
  version: '1.0'
servers:
  - url: https://golang-api-vgnqx.ondigitalocean.app/v1
security: []
tags:
  - name: Autenticação
  - name: Bancos
  - name: Contas Bancárias
  - name: Plano e Assinaturas
  - name: Empresa
  - name: Centros de Custo
  - name: Painel
  - name: Demonstrativos
  - name: Saúde
  - name: Convites
  - name: Membros
  - name: Onboarding
  - name: Fornecedores
  - name: Usuário
paths:
  /companies/credit-card-invoices/{id}:
    get:
      tags:
        - Empresa
      summary: Detalha uma fatura de cartão de crédito com seus lançamentos.
      parameters:
        - description: company uuid
          in: header
          name: x-company-id
          required: true
          schema:
            type: string
        - description: Invoice ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/credit_card.InvoiceDetailResponseDTO'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: x-company-id inválido
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: fatura não encontrada (inclusive de outra empresa — CC-6)
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    credit_card.InvoiceDetailResponseDTO:
      properties:
        credit_card_account_id:
          type: string
        due_date:
          type: string
        entries:
          items:
            $ref: '#/components/schemas/credit_card.InvoiceEntryResponseDTO'
          type: array
        id:
          type: string
        installments_amount:
          type: number
        open_balance:
          type: string
        open_balance_value:
          type: number
        paid_amount:
          type: number
        paid_at:
          description: |-
            PaidAt nil ⇔ fatura ainda não paga, nem total nem parcialmente (RN5:
            TODO pagamento — parcial ou não — fecha a fatura e grava paid_at).
          type: string
        payments:
          description: >-
            Payments é o histórico de pagamentos da fatura, do mais antigo ao
            mais

            recente, ESTORNADOS INCLUSIVE (cada um traz
            reversed_at/reversal_reason).


            Sem esta lista, a rota de desfazer pagamento

            (DELETE /credit-card-invoices/{id}/payments/{paymentId}) era
            inalcançável

            pelo front: o `paymentId` só aparecia na resposta do POST de
            pagamento,

            que ninguém guarda.
          items:
            $ref: >-
              #/components/schemas/credit_card.CreditCardInvoicePaymentResponseDTO
          type: array
        period_end:
          type: string
        period_start:
          type: string
        previous_balance:
          type: number
        reference_month:
          description: >-
            ReferenceMonth é o RÓTULO da fatura — "04/2026" é a fatura de abril,
            a

            que VENCE em abril (Decisão D4), não a que fecha em abril.
          type: string
        rolled_amount:
          type: number
        total:
          type: string
        total_value:
          type: number
      type: object
    handler.ErrorResponseDTO:
      properties:
        error:
          type: string
        message:
          type: string
      type: object
    credit_card.InvoiceEntryResponseDTO:
      properties:
        amount:
          type: string
        amount_value:
          type: number
        canceled_at:
          type: string
        installment_id:
          type: string
        installment_number:
          type: integer
        installments_total:
          type: integer
        is_legacy:
          type: boolean
        purchase_date:
          description: nil ⇔ dívida legada
          type: string
        purchase_id:
          type: string
        reference:
          type: string
        transaction_id:
          description: nil ⇔ dívida legada (RN4)
          type: string
      type: object
    credit_card.CreditCardInvoicePaymentResponseDTO:
      properties:
        amount:
          type: string
        amount_value:
          type: number
        bank_account_id:
          type: string
        created_at:
          type: string
        credit_card_invoice_id:
          type: string
        id:
          type: string
        idempotency_key:
          type: string
        payment_date:
          type: string
        reversal_reason:
          type: string
        reversed_at:
          description: ReversedAt/ReversalReason só aparecem preenchidos depois do RN6.
          type: string
        rolled_amount:
          type: number
        rolled_to_invoice_id:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Token da sessão no cabeçalho Authorization, no formato Bearer (mesmo
        esquema ApiKeyAuth do contrato).
      in: header
      name: Authorization
      type: apiKey

````