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

# Atualiza o cadastro de um cartão de crédito (substituição total).

> Mudança de closing_day/due_day vale a partir do ciclo SEGUINTE — faturas já materializadas (fechadas ou em andamento) não são alteradas (Decisão D, Q1).



## OpenAPI

````yaml /openapi/extat-openapi.json put /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}:
    put:
      tags:
        - Empresa
      summary: Atualiza o cadastro de um cartão de crédito (substituição total).
      description: >-
        Mudança de closing_day/due_day vale a partir do ciclo SEGUINTE — faturas
        já materializadas (fechadas ou em andamento) não são alteradas (Decisão
        D, Q1).
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/credit_card.UpdateCreditCardAccountRequestDTO
        description: Credit card data
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/credit_card.CreditCardAccountResponseDTO'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: >-
            corpo malformado, x-company-id inválido, apelido ausente, dia fora
            de 1-31, ou limite <= 0
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: cartão não encontrado
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: já existe um cartão com esse apelido nesta empresa
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponseDTO'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    credit_card.UpdateCreditCardAccountRequestDTO:
      properties:
        active:
          type: boolean
        alias:
          type: string
        closing_day:
          type: integer
        credit_limit:
          type: number
        due_day:
          type: integer
        issuer:
          type: string
        last4:
          type: string
      required:
        - alias
        - closing_day
        - due_day
      type: object
    credit_card.CreditCardAccountResponseDTO:
      properties:
        active:
          type: boolean
        alias:
          type: string
        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
        updated_at:
          type: string
      type: object
    handler.ErrorResponseDTO:
      properties:
        error:
          type: string
        message:
          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

````