> ## 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 um cartão de crédito, com os três KPIs.

> Devolve o cadastro mais next_due_invoice (a fatura já FECHADA aguardando pagamento), open_invoice_amount (o ciclo EM ANDAMENTO) e available_limit — os mesmos três da listagem. next_due_invoice e open_invoice_amount são ciclos DIFERENTES e coexistem: nunca colapse os dois num rótulo genérico de "fatura". available_limit vem null quando o limite ou a dívida anterior não foram informados no cadastro — campo ausente, nunca um número errado com aparência de certo.



## OpenAPI

````yaml /openapi/extat-openapi.json get /companies/credit-card-accounts/{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-accounts/{id}:
    get:
      tags:
        - Empresa
      summary: Detalha um cartão de crédito, com os três KPIs.
      description: >-
        Devolve o cadastro mais next_due_invoice (a fatura já FECHADA aguardando
        pagamento), open_invoice_amount (o ciclo EM ANDAMENTO) e available_limit
        — os mesmos três da listagem. next_due_invoice e open_invoice_amount são
        ciclos DIFERENTES e coexistem: nunca colapse os dois num rótulo genérico
        de "fatura". available_limit vem null quando o limite ou a dívida
        anterior não foram informados no cadastro — campo ausente, nunca um
        número errado com aparência de certo.
      parameters:
        - description: company uuid
          in: header
          name: x-company-id
          required: true
          schema:
            type: string
        - description: Credit Card Account ID
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/credit_card.CreditCardAccountWithKPIResponseDTO
          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: cartão não encontrado (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.CreditCardAccountWithKPIResponseDTO:
      properties:
        active:
          type: boolean
        alias:
          type: string
        available_limit:
          description: >-
            AvailableLimit vem nil quando credit_limit OU a dívida legada não
            foram

            informados no cadastro (spec.md, risco R-F) — "campo ausente", nunca
            um

            número errado com aparência de certo.
          type: number
        closing_day:
          type: integer
        created_at:
          type: string
        credit_limit:
          type: number
        due_day:
          type: integer
        id:
          type: string
        issuer:
          type: string
        last4:
          type: string
        legacy_debt_declared:
          description: >-
            LegacyDebtDeclared espelha CreditCardAccount.LegacyDebtDeclaredAt !=
            nil

            — é a RESPOSTA à pergunta sobre dívida anterior, não "existe dívida"

            (spec.md § "Como dívida legada informada é determinada"). Usada pelo

            front para decidir se available_limit nulo, na listagem, significa

            "cadastro incompleto" ou "sem dívida legada, cadastro completo".
          type: boolean
        next_due_invoice:
          allOf:
            - $ref: '#/components/schemas/credit_card.DueInvoiceKPIResponseDTO'
          description: NextDueInvoice é nil quando não há fatura fechada em aberto.
        open_invoice_amount:
          type: string
        open_invoice_amount_value:
          type: number
        updated_at:
          type: string
      type: object
    handler.ErrorResponseDTO:
      properties:
        error:
          type: string
        message:
          type: string
      type: object
    credit_card.DueInvoiceKPIResponseDTO:
      properties:
        amount:
          type: string
        amount_value:
          type: number
        due_date:
          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

````