openapi: 3.0.3
info:
  title: Vitrin Digital API — Pública
  version: 1.0.0
  description: Endpoints disponíveis para integração das organizações com a Vitrin
    Digital. Para gestão administrativa da plataforma, consulte a documentação interna
    em /api/docs/.
paths:
  /api/v1/anticipations/:
    get:
      operationId: anticipations_retrieve
      description: GET /anticipations/?status=eligible|anticipated — Lista transações
        para antecipação.
      summary: Listar antecipacoes
      tags:
      - Antecipacao
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/anticipations/request/:
    post:
      operationId: anticipations_request_create
      description: POST /anticipations/request/ — Solicita antecipação (requer PIN).
      summary: Solicitar antecipacao (PIN)
      tags:
      - Antecipacao
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/anticipations/simulate/:
    post:
      operationId: anticipations_simulate_create
      description: POST /anticipations/simulate/ — Simula antecipação de recebível.
      summary: Simular antecipacao
      tags:
      - Antecipacao
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/auth/api-key/regenerate/:
    post:
      operationId: auth_api_key_regenerate_create
      description: POST /api/v1/auth/api-key/regenerate/ — Gerar nova API key (requer
        PIN).
      summary: Regenerar API key (PIN)
      tags:
      - Auth
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/balance/:
    get:
      operationId: balance_retrieve
      description: 'GET /balance/ — Saldo da org (disponível + total + pendente).

        Combina dois endpoints Asaas para dar visão completa.'
      summary: Saldo da conta
      tags:
      - Financeiro
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/charges/:
    post:
      operationId: charges_create
      description: Criar cobrança avulsa.
      summary: Cobranca avulsa
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/boleto/:
    post:
      operationId: checkout_boleto_create
      description: POST /checkout/boleto/ — Cria cobrança Boleto e retorna código
        de barras.
      summary: Cobrar via Boleto
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/guest/:
    post:
      operationId: checkout_guest_create
      description: 'POST /checkout/guest/ — Checkout sem customer pré-cadastrado.

        Cria customer + cobrança em um passo. Ideal para checkouts transparentes

        onde o pagador não tem conta na plataforma da org.'
      summary: Guest checkout
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/installments/:
    get:
      operationId: checkout_installments_retrieve
      description: GET /checkout/installments/?amount=100 — Consulta opções de parcelamento.
      summary: Consultar parcelamento
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/pay/:
    post:
      operationId: checkout_pay_create
      description: Checkout transparente — processar pagamento.
      summary: Cobrar com token
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/pix/:
    post:
      operationId: checkout_pix_create
      description: POST /checkout/pix/ — Cria cobrança Pix e retorna QR Code.
      summary: Cobrar via Pix
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/sessions/:
    post:
      operationId: checkout_sessions_create
      description: 'POST /checkout/sessions/ — Cria link de checkout hospedado (redirect).

        NOTA: Payment links do Asaas NÃO suportam split. A taxa da plataforma

        não é retida automaticamente. Use /checkout/pay/ ou /orders/create/ para

        cobranças com split.'
      summary: Checkout redirect
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/checkout/tokenize/:
    post:
      operationId: checkout_tokenize_create
      description: POST /checkout/tokenize/ — Tokeniza cartão de crédito via Asaas.
      summary: Tokenizar cartao
      tags:
      - Checkout
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/contracts/{contract_id}/preview/:
    get:
      operationId: contracts_preview_retrieve
      description: 'GET /api/v1/contracts/{contract_id}/preview/ — Renderiza o template

        com os dados atuais da org. Não cria aceitação. Usado para mostrar o

        contrato antes de assinar.'
      summary: Preview do contrato
      parameters:
      - in: path
        name: contract_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Contratos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/contracts/acceptances/{acceptance_id}/:
    get:
      operationId: contracts_acceptances_retrieve
      description: 'GET /api/v1/contracts/acceptances/{acceptance_id}/ — Retorna o
        body

        snapshot completo de uma aceitação específica (para visualizar/baixar

        o contrato exatamente como foi assinado).'
      summary: Detalhe de uma aceitação
      parameters:
      - in: path
        name: acceptance_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Contratos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/contracts/active/:
    get:
      operationId: contracts_active_retrieve
      description: GET /api/v1/contracts/active/ — Aceitações vigentes.
      summary: Listar contratos vigentes
      tags:
      - Contratos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/contracts/history/:
    get:
      operationId: contracts_history_retrieve
      description: GET /api/v1/contracts/history/ — Histórico completo de aceitações
        da org.
      summary: Historico de aceitacoes
      tags:
      - Contratos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/contracts/pending/:
    get:
      operationId: contracts_pending_retrieve
      description: GET /api/v1/contracts/pending/ — Apenas os contratos a assinar.
      summary: Listar contratos pendentes
      tags:
      - Contratos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/contracts/status/:
    get:
      operationId: contracts_status_retrieve
      description: 'GET /api/v1/contracts/status/ — Visão geral dos contratos da org.


        Retorna `pending`, `active` e `all_signed`. Usado pelo frontend para

        decidir se mostra o banner de pendência e se permite operação.'
      summary: Status de contratos da org
      tags:
      - Contratos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/customers/:
    get:
      operationId: customers_list
      description: CRUD de clientes da org autenticada.
      summary: Listar clientes
      parameters:
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      tags:
      - Clientes
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCustomerList'
          description: ''
    post:
      operationId: customers_create
      description: CRUD de clientes da org autenticada.
      summary: Criar cliente
      tags:
      - Clientes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCreate'
          description: ''
  /api/v1/customers/{id}/:
    get:
      operationId: customers_retrieve
      description: CRUD de clientes da org autenticada.
      summary: Detalhes do cliente
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Cliente.
        required: true
      tags:
      - Clientes
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          description: ''
    put:
      operationId: customers_update
      description: CRUD de clientes da org autenticada.
      summary: Atualizar cliente
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Cliente.
        required: true
      tags:
      - Clientes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Customer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Customer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Customer'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          description: ''
    patch:
      operationId: customers_partial_update
      description: CRUD de clientes da org autenticada.
      summary: Atualizar cliente (parcial)
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Cliente.
        required: true
      tags:
      - Clientes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCustomer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCustomer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCustomer'
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          description: ''
    delete:
      operationId: customers_destroy
      description: CRUD de clientes da org autenticada.
      summary: Excluir cliente
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Cliente.
        required: true
      tags:
      - Clientes
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '204':
          description: No response body
  /api/v1/finance/statement/:
    get:
      operationId: finance_statement_retrieve
      description: GET /finance/statement/ — Extrato de movimentações financeiras.
      summary: Extrato financeiro
      tags:
      - Financeiro
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/onboarding/status/:
    get:
      operationId: onboarding_status_retrieve
      description: 'GET /api/v1/onboarding/status/ — Status completo do onboarding
        Asaas.

        Consulta status em tempo real via GET /myAccount/status.'
      summary: Status do onboarding Asaas
      tags:
      - Configuracoes
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/orders/:
    get:
      operationId: orders_list
      description: Lista e detalhe de pedidos.
      summary: Listar pedidos
      parameters:
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - in: query
        name: product
        schema:
          type: string
          format: uuid
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      - in: query
        name: status
        schema:
          type: string
          enum:
          - canceled
          - expired
          - fulfilled
          - paid
          - pending
          - refunded
        description: '* `pending` - Pendente

          * `paid` - Pago

          * `fulfilled` - Entregue

          * `refunded` - Reembolsado

          * `canceled` - Cancelado

          * `expired` - Expirado'
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrderList'
          description: ''
  /api/v1/orders/{id}/:
    get:
      operationId: orders_retrieve
      description: Lista e detalhe de pedidos.
      summary: Detalhes do pedido
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Pedido.
        required: true
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
          description: ''
  /api/v1/orders/{id}/fulfill/:
    post:
      operationId: orders_fulfill_create
      description: POST /orders/{id}/fulfill/ — Marca pedido como entregue.
      summary: Marcar entregue
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/orders/create/:
    post:
      operationId: orders_create_create
      description: 'POST /orders/ — Cria pedido: seleciona produto, cobra cliente,
        gera Order.'
      summary: Criar pedido
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/payments/{id}/cancel/:
    post:
      operationId: payments_cancel_create
      description: POST /payments/{id}/cancel/ — Cancela cobrança pendente.
      summary: Cancelar cobranca
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Pagamentos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/payments/{id}/chargeback-defense/:
    get:
      operationId: payments_chargeback_defense_retrieve
      description: 'GET /payments/{id}/chargeback-defense/ — Dossiê de defesa de chargeback.

        Compila automaticamente todas as evidências da transação para contestação.

        Baseado no Guia Prático de Contestação de Chargebacks do Asaas.'
      summary: Dossie de defesa
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Pagamentos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/payments/{id}/refund/:
    post:
      operationId: payments_refund_create
      description: POST /payments/{id}/refund/ — Reembolso parcial ou total (requer
        PIN).
      summary: Reembolsar (PIN)
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Pagamentos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/payments/{id}/status/:
    get:
      operationId: payments_status_retrieve
      description: 'GET /payments/{id}/status/ — Polling de status (usado para Pix).

        Retorna status atual da transação. O frontend pode fazer polling

        até receber status ''confirmed'' ou ''received''.'
      summary: Status do pagamento
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Pagamentos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/pix-automatic/authorizations/:
    get:
      operationId: pix_automatic_authorizations_list
      description: 'CRUD de autorizações Pix Automático.


        PIX_AUTOMATIC é tratado pela plataforma como tipo de pagamento recorrente

        via SPI/BC, com aceite único e cobranças periódicas geradas pela org.'
      summary: Listar autorizações Pix Automático
      parameters:
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      tags:
      - Pix Automatico
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPixAutomaticAuthorizationList'
          description: ''
    post:
      operationId: pix_automatic_authorizations_create
      description: 'CRUD de autorizações Pix Automático.


        PIX_AUTOMATIC é tratado pela plataforma como tipo de pagamento recorrente

        via SPI/BC, com aceite único e cobranças periódicas geradas pela org.'
      summary: Criar autorização (gera QR Code)
      tags:
      - Pix Automatico
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorizationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorizationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorizationCreate'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixAutomaticAuthorizationCreate'
          description: ''
  /api/v1/pix-automatic/authorizations/{id}/:
    get:
      operationId: pix_automatic_authorizations_retrieve
      description: 'CRUD de autorizações Pix Automático.


        PIX_AUTOMATIC é tratado pela plataforma como tipo de pagamento recorrente

        via SPI/BC, com aceite único e cobranças periódicas geradas pela org.'
      summary: Detalhes da autorização
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Autorização Pix Automático.
        required: true
      tags:
      - Pix Automatico
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixAutomaticAuthorization'
          description: ''
    delete:
      operationId: pix_automatic_authorizations_destroy
      description: 'CRUD de autorizações Pix Automático.


        PIX_AUTOMATIC é tratado pela plataforma como tipo de pagamento recorrente

        via SPI/BC, com aceite único e cobranças periódicas geradas pela org.'
      summary: Cancelar autorização (PIN)
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Autorização Pix Automático.
        required: true
      tags:
      - Pix Automatico
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '204':
          description: No response body
  /api/v1/pix-automatic/authorizations/{id}/charges/:
    post:
      operationId: pix_automatic_authorizations_charges_create
      description: 'POST /pix-automatic/authorizations/{id}/charges/ — gera cobrança
        recorrente.


        Asaas exige criar a instrução com 2 a 10 dias úteis antes do vencimento.'
      summary: Criar cobrança recorrente
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Autorização Pix Automático.
        required: true
      tags:
      - Pix Automatico
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorization'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorization'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorization'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixAutomaticAuthorization'
          description: ''
  /api/v1/pix-automatic/authorizations/{id}/instructions/:
    get:
      operationId: pix_automatic_authorizations_instructions_retrieve
      description: GET /pix-automatic/authorizations/{id}/instructions/ — lista instruções.
      summary: Listar instruções da autorização
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Autorização Pix Automático.
        required: true
      tags:
      - Pix Automatico
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixAutomaticAuthorization'
          description: ''
  /api/v1/pix-automatic/authorizations/{id}/sync/:
    post:
      operationId: pix_automatic_authorizations_sync_create
      description: POST /pix-automatic/authorizations/{id}/sync/ — força sync com
        Asaas.
      summary: Sincronizar status com Asaas
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Autorização Pix Automático.
        required: true
      tags:
      - Pix Automatico
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorization'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorization'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PixAutomaticAuthorization'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixAutomaticAuthorization'
          description: ''
  /api/v1/pix-automatic/instructions/:
    get:
      operationId: pix_automatic_instructions_list
      description: 'Read-only de instruções de pagamento Pix Automático.


        Instruções são criadas indiretamente através do endpoint

        POST /pix-automatic/authorizations/{id}/charges/ e atualizadas via webhook.'
      summary: Listar instruções Pix Automático
      parameters:
      - in: query
        name: authorization
        schema:
          type: string
          format: uuid
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      - in: query
        name: status
        schema:
          type: string
          enum:
          - AWAITING_REQUEST
          - CANCELLED
          - DONE
          - REFUSED
          - SCHEDULED
        description: '* `AWAITING_REQUEST` - Aguardando solicitação

          * `SCHEDULED` - Agendada

          * `DONE` - Concluída

          * `CANCELLED` - Cancelada

          * `REFUSED` - Recusada'
      tags:
      - Pix Automatico
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPixAutomaticInstructionList'
          description: ''
  /api/v1/pix-automatic/instructions/{id}/:
    get:
      operationId: pix_automatic_instructions_retrieve
      description: 'Read-only de instruções de pagamento Pix Automático.


        Instruções são criadas indiretamente através do endpoint

        POST /pix-automatic/authorizations/{id}/charges/ e atualizadas via webhook.'
      summary: Detalhes da instrução
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Instrução Pix Automático.
        required: true
      tags:
      - Pix Automatico
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixAutomaticInstruction'
          description: ''
  /api/v1/plans/:
    get:
      operationId: plans_list
      summary: Listar planos
      parameters:
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      tags:
      - Assinaturas
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlanList'
          description: ''
    post:
      operationId: plans_create
      summary: Criar plano
      tags:
      - Assinaturas
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Plan'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Plan'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Plan'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: ''
  /api/v1/plans/{id}/:
    get:
      operationId: plans_retrieve
      summary: Detalhes do plano
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Plano.
        required: true
      tags:
      - Assinaturas
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: ''
    put:
      operationId: plans_update
      summary: Atualizar plano
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Plano.
        required: true
      tags:
      - Assinaturas
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Plan'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Plan'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Plan'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: ''
    patch:
      operationId: plans_partial_update
      summary: Atualizar plano (parcial)
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Plano.
        required: true
      tags:
      - Assinaturas
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlan'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlan'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlan'
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: ''
    delete:
      operationId: plans_destroy
      summary: Excluir plano
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Plano.
        required: true
      tags:
      - Assinaturas
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '204':
          description: No response body
  /api/v1/products/:
    get:
      operationId: products_list
      description: CRUD de produtos da org.
      summary: Listar produtos
      parameters:
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProductList'
          description: ''
    post:
      operationId: products_create
      description: CRUD de produtos da org.
      summary: Criar produto
      tags:
      - Produtos
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProductCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProductCreate'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductCreate'
          description: ''
  /api/v1/products/{id}/:
    get:
      operationId: products_retrieve
      description: CRUD de produtos da org.
      summary: Detalhes do produto
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Produto.
        required: true
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
          description: ''
    put:
      operationId: products_update
      description: CRUD de produtos da org.
      summary: Atualizar produto
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Produto.
        required: true
      tags:
      - Produtos
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProductCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProductCreate'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductCreate'
          description: ''
    patch:
      operationId: products_partial_update
      description: CRUD de produtos da org.
      summary: Atualizar produto (parcial)
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Produto.
        required: true
      tags:
      - Produtos
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedProductCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedProductCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedProductCreate'
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductCreate'
          description: ''
    delete:
      operationId: products_destroy
      description: CRUD de produtos da org.
      summary: Excluir produto
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Produto.
        required: true
      tags:
      - Produtos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '204':
          description: No response body
  /api/v1/reports/anticipation/:
    get:
      operationId: reports_anticipation_retrieve
      description: GET /reports/anticipation/ — Relatório de antecipações.
      summary: Relatório de antecipações
      parameters:
      - in: query
        name: date_from
        schema:
          type: string
      - in: query
        name: date_to
        schema:
          type: string
      tags:
      - Relatorios
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/reports/churn/:
    get:
      operationId: reports_churn_retrieve
      description: GET /reports/churn/ — Relatório de churn de assinaturas.
      summary: Relatório de churn
      tags:
      - Relatorios
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/reports/overview/:
    get:
      operationId: reports_overview_retrieve
      description: GET /api/v1/reports/overview/ — overview da org autenticada.
      summary: Dashboard overview
      parameters:
      - in: query
        name: days
        schema:
          type: integer
          default: 30
      tags:
      - Relatorios
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/reports/revenue/:
    get:
      operationId: reports_revenue_retrieve
      description: GET /api/v1/reports/revenue/ — receita por dia.
      summary: Receita por dia
      parameters:
      - in: query
        name: days
        schema:
          type: integer
          default: 30
      tags:
      - Relatorios
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/reports/revenue/monthly/:
    get:
      operationId: reports_revenue_monthly_retrieve
      description: GET /api/v1/reports/revenue/monthly/ — receita por mês.
      summary: Receita por mês
      parameters:
      - in: query
        name: months
        schema:
          type: integer
          default: 12
      tags:
      - Relatorios
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/reports/transactions/:
    get:
      operationId: reports_transactions_retrieve
      description: 'GET /reports/transactions/ — Relatório detalhado com filtros avançados.

        Admin vê todas as transações. Org vê apenas as suas.'
      summary: Relatório de transações
      parameters:
      - in: query
        name: billing_type
        schema:
          type: string
      - in: query
        name: customer_id
        schema:
          type: string
      - in: query
        name: date_from
        schema:
          type: string
      - in: query
        name: date_to
        schema:
          type: string
      - in: query
        name: max_amount
        schema:
          type: number
          format: double
      - in: query
        name: min_amount
        schema:
          type: number
          format: double
      - in: query
        name: status
        schema:
          type: string
      tags:
      - Relatorios
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/settings/:
    get:
      operationId: settings_list
      description: Self-service de configurações da org.
      summary: Obter settings da org
      tags:
      - Configuracoes
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationSettings'
          description: ''
    patch:
      operationId: settings_partial_update
      description: Self-service de configurações da org.
      summary: Atualizar settings da org
      tags:
      - Configuracoes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOrganizationSettings'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedOrganizationSettings'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedOrganizationSettings'
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationSettings'
          description: ''
  /api/v1/subscriptions/:
    get:
      operationId: subscriptions_list
      summary: Listar assinaturas
      parameters:
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      tags:
      - Assinaturas
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSubscriptionList'
          description: ''
    post:
      operationId: subscriptions_create
      summary: Criar assinatura
      tags:
      - Assinaturas
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SubscriptionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SubscriptionCreate'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionCreate'
          description: ''
  /api/v1/subscriptions/{id}/:
    get:
      operationId: subscriptions_retrieve
      summary: Detalhes da assinatura
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Assinatura.
        required: true
      tags:
      - Assinaturas
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
          description: ''
  /api/v1/subscriptions/{id}/cancel/:
    post:
      operationId: subscriptions_cancel_create
      summary: Cancelar assinatura
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Assinatura.
        required: true
      tags:
      - Assinaturas
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Subscription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Subscription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Subscription'
        required: true
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
          description: ''
  /api/v1/subscriptions/{id}/detail/:
    get:
      operationId: subscriptions_detail_retrieve
      description: GET /subscriptions/{id}/detail/ — Detalhe da assinatura com dados
        Asaas em tempo real.
      summary: Detalhe da assinatura
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Assinaturas
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/transactions/:
    get:
      operationId: transactions_list
      summary: Listar transações
      parameters:
      - in: query
        name: billing_type
        schema:
          type: string
          title: Forma de pagamento
          enum:
          - BOLETO
          - CREDIT_CARD
          - PIX
          - PIX_AUTOMATIC
        description: '* `PIX` - Pix

          * `PIX_AUTOMATIC` - Pix Automático

          * `CREDIT_CARD` - Cartão de Crédito

          * `BOLETO` - Boleto'
      - name: ordering
        required: false
        in: query
        description: Qual campo usar ao ordenar os resultados.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: Um número de página dentro do conjunto de resultados paginado.
        schema:
          type: integer
      - name: search
        required: false
        in: query
        description: Um termo de busca.
        schema:
          type: string
      - in: query
        name: status
        schema:
          type: string
          enum:
          - canceled
          - chargeback
          - confirmed
          - failed
          - overdue
          - pending
          - received
          - refunded
        description: '* `pending` - Pendente

          * `confirmed` - Confirmado

          * `received` - Recebido

          * `overdue` - Vencido

          * `refunded` - Reembolsado

          * `chargeback` - Chargeback

          * `failed` - Falhou

          * `canceled` - Cancelado'
      tags:
      - Pagamentos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTransactionList'
          description: ''
  /api/v1/transactions/{id}/:
    get:
      operationId: transactions_retrieve
      summary: Detalhes da transação
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: Um string UUID que identifica este Transação.
        required: true
      tags:
      - Pagamentos
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: ''
  /api/v1/transfers/:
    get:
      operationId: transfers_retrieve
      description: GET /transfers/ — Lista transferências da org.
      summary: Historico de transferencias
      tags:
      - Financeiro
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/transfers/bank/:
    post:
      operationId: transfers_bank_create
      description: 'POST /transfers/bank/ — Transferência via dados bancários (Pix
        ou TED, requer PIN).

        Cobra taxa de saque (TED ou Pix conforme operationType).'
      summary: Transferir via banco (PIN)
      tags:
      - Financeiro
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/transfers/pix/:
    post:
      operationId: transfers_pix_create
      description: 'POST /transfers/pix/ — Transferência via chave Pix (requer PIN).

        Cobra taxa de saque (withdrawal_fee_fixed_pix) automaticamente.'
      summary: Transferir via Pix (PIN)
      tags:
      - Financeiro
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
  /api/v1/webhooks/config/:
    put:
      operationId: webhooks_config_update
      description: PUT /api/v1/webhooks/config/ — Configura webhook URL e secret (requer
        PIN).
      summary: Configurar webhook
      tags:
      - Configuracoes
      security:
      - ApiKeyAuth: []
      - JWTAuth: []
      responses:
        '200':
          description: No response body
components:
  schemas:
    ActorTypeEnum:
      enum:
      - system
      - admin
      - org
      - customer
      - asaas
      type: string
      description: '* `system` - Sistema

        * `admin` - Admin

        * `org` - Organização

        * `customer` - Cliente

        * `asaas` - Asaas'
    AuditLog:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        timestamp:
          type: string
          format: date-time
          readOnly: true
        actor_type:
          allOf:
          - $ref: '#/components/schemas/ActorTypeEnum'
          title: Tipo do ator
        actor_id:
          type: string
          title: ID do ator
          maxLength: 255
        organization:
          type: string
          format: uuid
          nullable: true
          title: Organização
        organization_name:
          type: string
          readOnly: true
          default: ''
        customer:
          type: string
          format: uuid
          nullable: true
          title: Cliente
        action:
          type: string
          title: Ação
          maxLength: 100
        resource_type:
          type: string
          title: Tipo do recurso
          maxLength: 100
        resource_id:
          type: string
          title: ID do recurso
          maxLength: 255
        detail:
          title: Detalhes (before/after)
        ip_address:
          type: string
          nullable: true
          title: IP
      required:
      - action
      - actor_id
      - actor_type
      - id
      - organization_name
      - resource_id
      - resource_type
      - timestamp
    BillingCycleEnum:
      enum:
      - weekly
      - biweekly
      - monthly
      - bimonthly
      - quarterly
      - semiannually
      - yearly
      type: string
      description: '* `weekly` - Semanal

        * `biweekly` - Quinzenal

        * `monthly` - Mensal

        * `bimonthly` - Bimestral

        * `quarterly` - Trimestral

        * `semiannually` - Semestral

        * `yearly` - Anual'
    CompanyTypeEnum:
      enum:
      - MEI
      - LIMITED
      - INDIVIDUAL
      - ASSOCIATION
      type: string
      description: '* `MEI` - MEI

        * `LIMITED` - LIMITED

        * `INDIVIDUAL` - INDIVIDUAL

        * `ASSOCIATION` - ASSOCIATION'
    ContractSign:
      type: object
      properties:
        pin:
          type: string
          maxLength: 6
          minLength: 6
      required:
      - pin
    Customer:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        email:
          type: string
          format: email
          maxLength: 254
        cpf_cnpj:
          type: string
          title: CPF/CNPJ
          maxLength: 18
        phone:
          type: string
          title: Telefone
          maxLength: 20
        address:
          type: string
          title: Endereço
          maxLength: 255
        address_number:
          type: string
          title: Número
          maxLength: 20
        province:
          type: string
          title: Bairro
          maxLength: 100
        postal_code:
          type: string
          title: CEP
          maxLength: 9
        city:
          type: string
          title: Cidade
          maxLength: 100
        state:
          type: string
          title: UF
          maxLength: 2
        asaas_customer_id:
          type: string
          readOnly: true
          title: Customer ID Asaas
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - asaas_customer_id
      - cpf_cnpj
      - created_at
      - email
      - id
      - name
      - updated_at
    CustomerCreate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        email:
          type: string
          format: email
          maxLength: 254
        cpf_cnpj:
          type: string
          title: CPF/CNPJ
          maxLength: 18
        phone:
          type: string
          title: Telefone
          maxLength: 20
        address:
          type: string
          title: Endereço
          maxLength: 255
        address_number:
          type: string
          title: Número
          maxLength: 20
        province:
          type: string
          title: Bairro
          maxLength: 100
        postal_code:
          type: string
          title: CEP
          maxLength: 9
        city:
          type: string
          title: Cidade
          maxLength: 100
        state:
          type: string
          title: UF
          maxLength: 2
      required:
      - cpf_cnpj
      - email
      - id
      - name
    DefaultRates:
      type: object
      description: Serializer dos defaults para novas orgs (não expõe os pisos).
      properties:
        default_fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % Pix
        default_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default fixo Pix
        default_fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % Boleto
        default_fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default fixo Boleto
        default_fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito à vista
        default_fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito 2-6x
        default_fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito 7-12x
        default_fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito 13-21x
        default_fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default fixo crédito
        default_anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default antecipação crédito à vista
        default_anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default antecipação crédito parcelado
        default_anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default antecipação boleto/pix
        default_withdrawal_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default saque Pix
        default_withdrawal_fee_fixed_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default saque TED
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - updated_at
    Login:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
          writeOnly: true
      required:
      - email
      - password
    Order:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        customer:
          type: string
          format: uuid
          title: Cliente
        customer_name:
          type: string
          readOnly: true
        product:
          type: string
          format: uuid
          nullable: true
          title: Produto
          description: Nulo para cobranças avulsas sem produto.
        product_name:
          type: string
          nullable: true
          readOnly: true
        transaction_id:
          type: string
          nullable: true
          readOnly: true
        quantity:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Quantidade
        unit_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Preço unitário
        total_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Valor total
        status:
          allOf:
          - $ref: '#/components/schemas/OrderStatusEnum'
          readOnly: true
        fulfilled_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Entregue em
        expires_at:
          type: string
          format: date-time
          nullable: true
          title: Expira em
        metadata:
          title: Metadados
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - created_at
      - customer
      - customer_name
      - fulfilled_at
      - id
      - product_name
      - status
      - total_amount
      - transaction_id
      - unit_price
      - updated_at
    OrderStatusEnum:
      enum:
      - pending
      - paid
      - fulfilled
      - refunded
      - canceled
      - expired
      type: string
      description: '* `pending` - Pendente

        * `paid` - Pago

        * `fulfilled` - Entregue

        * `refunded` - Reembolsado

        * `canceled` - Cancelado

        * `expired` - Expirado'
    OrganizationAdmin:
      type: object
      description: Serializer completo para o admin da plataforma.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          maxLength: 100
          pattern: ^[-a-zA-Z0-9_]+$
        cpf_cnpj:
          type: string
          title: CPF/CNPJ
          maxLength: 18
        asaas_subaccount_id:
          type: string
          title: Subconta Asaas ID
          maxLength: 100
        asaas_wallet_id:
          type: string
          title: Wallet ID Asaas
          maxLength: 100
        asaas_onboarding_url:
          type: string
          format: uri
          maxLength: 200
        asaas_document_status:
          type: string
          title: Status documentos Asaas
          description: PENDING, AWAITING_APPROVAL, APPROVED, REJECTED
          maxLength: 30
        asaas_commercial_info_expires:
          type: string
          format: date
          nullable: true
          title: Expiração dados comerciais Asaas
        webhook_url:
          type: string
          format: uri
          title: URL de Webhook
          maxLength: 200
        api_key_prefix:
          type: string
          maxLength: 20
        status:
          $ref: '#/components/schemas/OrganizationAdminStatusEnum'
        fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % Pix
        fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa Pix
        fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % Boleto
        fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa Boleto
        fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito à vista
        fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito 2-6x
        fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito 7-12x
        fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito 13-21x
        fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa crédito
        withdrawal_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa saque Pix
          description: Custo Asaas ~R$0-2 + spread Vitrin
        withdrawal_fee_fixed_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa saque TED
          description: Custo Asaas ~R$5-10 + spread Vitrin
        anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Antecipação crédito à vista (% a.m.)
        anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Antecipação crédito parcelado (% a.m.)
        anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Antecipação boleto/pix (% a.m.)
        allowed_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          title: Métodos permitidos (admin)
          description: Métodos de pagamento que o admin liberou para esta org
        max_installments:
          type: integer
          maximum: 21
          minimum: 1
          title: Máximo de parcelas (admin)
        min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Parcela mínima (admin)
        allow_anticipation:
          type: boolean
          title: Permitir antecipação (admin)
        allow_auto_anticipation:
          type: boolean
          title: Permitir antecipação automática (admin)
        pass_fees_to_customer:
          type: boolean
          title: Repassar taxas ao cliente
          description: 'Se ativo, o valor cobrado do cliente final inclui a taxa da
            plataforma. Ex: produto R$100 + taxa R$5,49 = cliente paga R$105,49.'
        enabled_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          title: Métodos habilitados (org)
        org_max_installments:
          type: integer
          maximum: 21
          minimum: 1
          title: Máximo de parcelas (org)
        org_min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Parcela mínima (org)
        auto_anticipation_enabled:
          type: boolean
          title: Antecipação automática ativa
        pin_failed_attempts:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Tentativas PIN erradas
        pin_locked_until:
          type: string
          format: date-time
          nullable: true
          title: PIN bloqueado até
        checkout_logo:
          type: string
          format: uri
          title: Logo do checkout
          maxLength: 200
        checkout_primary_color:
          type: string
          title: Cor primária do checkout
          maxLength: 7
        checkout_custom_fields:
          title: Campos extras do checkout
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
        owner:
          type: integer
          title: Proprietário
      required:
      - created_at
      - id
      - name
      - owner
      - slug
      - updated_at
    OrganizationAdminStatusEnum:
      enum:
      - onboarding
      - active
      - suspended
      - inactive
      type: string
      description: '* `onboarding` - Onboarding

        * `active` - Ativa

        * `suspended` - Suspensa

        * `inactive` - Inativa'
    OrganizationSettings:
      type: object
      description: 'Serializer para self-service da org (apenas campos editáveis pela
        org).

        Inclui campos admin read-only para o frontend poder filtrar features e

        expor as taxas reais da org (usadas pelo simulador, checkout etc).'
      properties:
        enabled_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          title: Métodos habilitados (org)
        org_max_installments:
          type: integer
          maximum: 21
          minimum: 1
          title: Máximo de parcelas (org)
        org_min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Parcela mínima (org)
        auto_anticipation_enabled:
          type: boolean
          title: Antecipação automática ativa
        checkout_logo:
          type: string
          format: uri
          title: Logo do checkout
          maxLength: 200
        checkout_primary_color:
          type: string
          title: Cor primária do checkout
          maxLength: 7
        checkout_custom_fields:
          title: Campos extras do checkout
        webhook_url:
          type: string
          format: uri
          title: URL de Webhook
          maxLength: 200
        webhook_secret_masked:
          type: string
          nullable: true
          readOnly: true
        pass_fees_to_customer:
          type: boolean
          title: Repassar taxas ao cliente
          description: 'Se ativo, o valor cobrado do cliente final inclui a taxa da
            plataforma. Ex: produto R$100 + taxa R$5,49 = cliente paga R$105,49.'
        allowed_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          readOnly: true
          title: Métodos permitidos (admin)
          description: Métodos de pagamento que o admin liberou para esta org
        max_installments:
          type: integer
          readOnly: true
          title: Máximo de parcelas (admin)
        min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Parcela mínima (admin)
        allow_anticipation:
          type: boolean
          readOnly: true
          title: Permitir antecipação (admin)
        allow_auto_anticipation:
          type: boolean
          readOnly: true
          title: Permitir antecipação automática (admin)
        fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % Pix
        fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa Pix
        fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % Boleto
        fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa Boleto
        fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito à vista
        fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito 2-6x
        fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito 7-12x
        fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito 13-21x
        fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa crédito
        anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Antecipação crédito à vista (% a.m.)
        anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Antecipação crédito parcelado (% a.m.)
        anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Antecipação boleto/pix (% a.m.)
        withdrawal_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa saque Pix
          description: Custo Asaas ~R$0-2 + spread Vitrin
        withdrawal_fee_fixed_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa saque TED
          description: Custo Asaas ~R$5-10 + spread Vitrin
      required:
      - allow_anticipation
      - allow_auto_anticipation
      - allowed_payment_methods
      - anticipation_rate_boleto_pix
      - anticipation_rate_credit_parceled
      - anticipation_rate_credit_vista
      - fee_fixed_boleto
      - fee_fixed_credit
      - fee_fixed_pix
      - fee_percentage_boleto
      - fee_percentage_credit
      - fee_percentage_credit_13
      - fee_percentage_credit_2_6
      - fee_percentage_credit_7_12
      - fee_percentage_pix
      - max_installments
      - min_installment_value
      - webhook_secret_masked
      - withdrawal_fee_fixed_pix
      - withdrawal_fee_fixed_ted
    PaginatedAuditLogList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/AuditLog'
    PaginatedCustomerList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Customer'
    PaginatedOrderList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Order'
    PaginatedOrganizationAdminList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationAdmin'
    PaginatedPixAutomaticAuthorizationList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/PixAutomaticAuthorization'
    PaginatedPixAutomaticInstructionList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/PixAutomaticInstruction'
    PaginatedPlanList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Plan'
    PaginatedProductList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    PaginatedSubscriptionList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
    PaginatedTransactionList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
    PasswordResetConfirm:
      type: object
      properties:
        email:
          type: string
          format: email
        token:
          type: string
        new_password:
          type: string
          minLength: 8
      required:
      - email
      - new_password
      - token
    PasswordResetRequest:
      type: object
      properties:
        email:
          type: string
          format: email
      required:
      - email
    PatchedCustomer:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        email:
          type: string
          format: email
          maxLength: 254
        cpf_cnpj:
          type: string
          title: CPF/CNPJ
          maxLength: 18
        phone:
          type: string
          title: Telefone
          maxLength: 20
        address:
          type: string
          title: Endereço
          maxLength: 255
        address_number:
          type: string
          title: Número
          maxLength: 20
        province:
          type: string
          title: Bairro
          maxLength: 100
        postal_code:
          type: string
          title: CEP
          maxLength: 9
        city:
          type: string
          title: Cidade
          maxLength: 100
        state:
          type: string
          title: UF
          maxLength: 2
        asaas_customer_id:
          type: string
          readOnly: true
          title: Customer ID Asaas
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
    PatchedDefaultRates:
      type: object
      description: Serializer dos defaults para novas orgs (não expõe os pisos).
      properties:
        default_fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % Pix
        default_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default fixo Pix
        default_fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % Boleto
        default_fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default fixo Boleto
        default_fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito à vista
        default_fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito 2-6x
        default_fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito 7-12x
        default_fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default % crédito 13-21x
        default_fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default fixo crédito
        default_anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default antecipação crédito à vista
        default_anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default antecipação crédito parcelado
        default_anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Default antecipação boleto/pix
        default_withdrawal_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default saque Pix
        default_withdrawal_fee_fixed_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Default saque TED
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
    PatchedOrganizationAdmin:
      type: object
      description: Serializer completo para o admin da plataforma.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          maxLength: 100
          pattern: ^[-a-zA-Z0-9_]+$
        cpf_cnpj:
          type: string
          title: CPF/CNPJ
          maxLength: 18
        asaas_subaccount_id:
          type: string
          title: Subconta Asaas ID
          maxLength: 100
        asaas_wallet_id:
          type: string
          title: Wallet ID Asaas
          maxLength: 100
        asaas_onboarding_url:
          type: string
          format: uri
          maxLength: 200
        asaas_document_status:
          type: string
          title: Status documentos Asaas
          description: PENDING, AWAITING_APPROVAL, APPROVED, REJECTED
          maxLength: 30
        asaas_commercial_info_expires:
          type: string
          format: date
          nullable: true
          title: Expiração dados comerciais Asaas
        webhook_url:
          type: string
          format: uri
          title: URL de Webhook
          maxLength: 200
        api_key_prefix:
          type: string
          maxLength: 20
        status:
          $ref: '#/components/schemas/OrganizationAdminStatusEnum'
        fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % Pix
        fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa Pix
        fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % Boleto
        fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa Boleto
        fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito à vista
        fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito 2-6x
        fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito 7-12x
        fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Taxa % crédito 13-21x
        fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa crédito
        withdrawal_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa saque Pix
          description: Custo Asaas ~R$0-2 + spread Vitrin
        withdrawal_fee_fixed_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Taxa fixa saque TED
          description: Custo Asaas ~R$5-10 + spread Vitrin
        anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Antecipação crédito à vista (% a.m.)
        anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Antecipação crédito parcelado (% a.m.)
        anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Antecipação boleto/pix (% a.m.)
        allowed_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          title: Métodos permitidos (admin)
          description: Métodos de pagamento que o admin liberou para esta org
        max_installments:
          type: integer
          maximum: 21
          minimum: 1
          title: Máximo de parcelas (admin)
        min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Parcela mínima (admin)
        allow_anticipation:
          type: boolean
          title: Permitir antecipação (admin)
        allow_auto_anticipation:
          type: boolean
          title: Permitir antecipação automática (admin)
        pass_fees_to_customer:
          type: boolean
          title: Repassar taxas ao cliente
          description: 'Se ativo, o valor cobrado do cliente final inclui a taxa da
            plataforma. Ex: produto R$100 + taxa R$5,49 = cliente paga R$105,49.'
        enabled_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          title: Métodos habilitados (org)
        org_max_installments:
          type: integer
          maximum: 21
          minimum: 1
          title: Máximo de parcelas (org)
        org_min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Parcela mínima (org)
        auto_anticipation_enabled:
          type: boolean
          title: Antecipação automática ativa
        pin_failed_attempts:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Tentativas PIN erradas
        pin_locked_until:
          type: string
          format: date-time
          nullable: true
          title: PIN bloqueado até
        checkout_logo:
          type: string
          format: uri
          title: Logo do checkout
          maxLength: 200
        checkout_primary_color:
          type: string
          title: Cor primária do checkout
          maxLength: 7
        checkout_custom_fields:
          title: Campos extras do checkout
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
        owner:
          type: integer
          title: Proprietário
    PatchedOrganizationSettings:
      type: object
      description: 'Serializer para self-service da org (apenas campos editáveis pela
        org).

        Inclui campos admin read-only para o frontend poder filtrar features e

        expor as taxas reais da org (usadas pelo simulador, checkout etc).'
      properties:
        enabled_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          title: Métodos habilitados (org)
        org_max_installments:
          type: integer
          maximum: 21
          minimum: 1
          title: Máximo de parcelas (org)
        org_min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Parcela mínima (org)
        auto_anticipation_enabled:
          type: boolean
          title: Antecipação automática ativa
        checkout_logo:
          type: string
          format: uri
          title: Logo do checkout
          maxLength: 200
        checkout_primary_color:
          type: string
          title: Cor primária do checkout
          maxLength: 7
        checkout_custom_fields:
          title: Campos extras do checkout
        webhook_url:
          type: string
          format: uri
          title: URL de Webhook
          maxLength: 200
        webhook_secret_masked:
          type: string
          nullable: true
          readOnly: true
        pass_fees_to_customer:
          type: boolean
          title: Repassar taxas ao cliente
          description: 'Se ativo, o valor cobrado do cliente final inclui a taxa da
            plataforma. Ex: produto R$100 + taxa R$5,49 = cliente paga R$105,49.'
        allowed_payment_methods:
          type: array
          items:
            type: string
            maxLength: 20
          readOnly: true
          title: Métodos permitidos (admin)
          description: Métodos de pagamento que o admin liberou para esta org
        max_installments:
          type: integer
          readOnly: true
          title: Máximo de parcelas (admin)
        min_installment_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Parcela mínima (admin)
        allow_anticipation:
          type: boolean
          readOnly: true
          title: Permitir antecipação (admin)
        allow_auto_anticipation:
          type: boolean
          readOnly: true
          title: Permitir antecipação automática (admin)
        fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % Pix
        fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa Pix
        fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % Boleto
        fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa Boleto
        fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito à vista
        fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito 2-6x
        fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito 7-12x
        fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa % crédito 13-21x
        fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa crédito
        anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Antecipação crédito à vista (% a.m.)
        anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Antecipação crédito parcelado (% a.m.)
        anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          readOnly: true
          title: Antecipação boleto/pix (% a.m.)
        withdrawal_fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa saque Pix
          description: Custo Asaas ~R$0-2 + spread Vitrin
        withdrawal_fee_fixed_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa fixa saque TED
          description: Custo Asaas ~R$5-10 + spread Vitrin
    PatchedPlan:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          maxLength: 100
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          title: Descrição
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Preço
        billing_cycle:
          allOf:
          - $ref: '#/components/schemas/BillingCycleEnum'
          title: Ciclo de cobrança
        features:
          title: Funcionalidades
        is_active:
          type: boolean
          title: Ativo
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
    PatchedPlatformConfig:
      type: object
      description: Serializer dos pisos de custo (não expõe os defaults).
      properties:
        fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % Pix
        fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso fixo Pix
        fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % Boleto
        fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso fixo Boleto
        fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito à vista
        fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito 2-6x
        fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito 7-12x
        fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito 13-21x
        fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso fixo crédito
        anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso antecipação crédito à vista
        anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso antecipação crédito parcelado
        anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso antecipação boleto/pix
        withdrawal_fee_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso saque Pix
        withdrawal_fee_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso saque TED
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
    PatchedProductCreate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          title: Descrição
        product_type:
          allOf:
          - $ref: '#/components/schemas/ProductTypeEnum'
          title: Tipo
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Preço
        quantity:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Quantidade no pacote
          description: 'Para packs: quantas unidades o cliente recebe. Para one_time:
            sempre 1.'
        is_active:
          type: boolean
          title: Ativo
        metadata:
          title: Metadados
          description: 'Dados extras: validade_dias, features, limites, etc.'
    PinChange:
      type: object
      properties:
        current_pin:
          type: string
          maxLength: 6
          minLength: 6
        new_pin:
          type: string
          maxLength: 6
          minLength: 6
      required:
      - current_pin
      - new_pin
    PinResetConfirm:
      type: object
      properties:
        email:
          type: string
          format: email
        token:
          type: string
        new_pin:
          type: string
          maxLength: 6
          minLength: 6
      required:
      - email
      - new_pin
      - token
    PinResetRequest:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
          writeOnly: true
      required:
      - email
      - password
    PinVerify:
      type: object
      properties:
        pin:
          type: string
          maxLength: 6
          minLength: 6
      required:
      - pin
    PixAutomaticAuthorization:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        customer:
          type: string
          format: uuid
          title: Cliente
        customer_name:
          type: string
          readOnly: true
        plan:
          type: string
          format: uuid
          nullable: true
          title: Plano
        subscription:
          type: string
          format: uuid
          nullable: true
          title: Assinatura
        asaas_authorization_id:
          type: string
          readOnly: true
          title: Authorization ID Asaas
        contract_id:
          type: string
          description: Identificador externo da org (max 35 chars).
          maxLength: 35
        conciliation_identifier:
          type: string
          readOnly: true
          title: Identificador de conciliação
          description: Retornado pelo Asaas, incluído nas cobranças vinculadas.
        frequency:
          allOf:
          - $ref: '#/components/schemas/PixAutomaticAuthorizationFrequencyEnum'
          title: Frequência
        value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
          title: Valor fixo
          description: Se nulo, valor pode variar por instrução.
        min_limit_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
          title: Piso de valor
          description: Valor máximo que o pagador pode atribuir.
        description:
          type: string
          title: Descrição
          maxLength: 35
        start_date:
          type: string
          format: date
          title: Início da vigência
        finish_date:
          type: string
          format: date
          nullable: true
          title: Fim da vigência
          description: Vazio = prazo indeterminado.
        status:
          allOf:
          - $ref: '#/components/schemas/PixAutomaticAuthorizationStatusEnum'
          readOnly: true
        refusal_reason:
          type: string
          readOnly: true
          title: Motivo de recusa
        cancelled_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Cancelada em
        activated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Ativada em
        immediate_qr_code:
          type: string
          readOnly: true
          title: QR Code da primeira cobrança
        immediate_payload:
          type: string
          readOnly: true
          title: Payload copia-cola
        instructions_count:
          type: integer
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - activated_at
      - asaas_authorization_id
      - cancelled_at
      - conciliation_identifier
      - contract_id
      - created_at
      - customer
      - customer_name
      - frequency
      - id
      - immediate_payload
      - immediate_qr_code
      - instructions_count
      - refusal_reason
      - start_date
      - status
      - updated_at
    PixAutomaticAuthorizationCreate:
      type: object
      properties:
        customer_id:
          type: string
          format: uuid
        contract_id:
          type: string
          maxLength: 35
        frequency:
          $ref: '#/components/schemas/PixAutomaticAuthorizationCreateFrequencyEnum'
        start_date:
          type: string
          format: date
        finish_date:
          type: string
          format: date
          nullable: true
        value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
          description: Valor fixo. Se omitido, valor varia por instrução.
        min_limit_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
        description:
          type: string
          maxLength: 35
        plan_id:
          type: string
          format: uuid
          nullable: true
        first_charge_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          description: Valor da primeira cobrança imediata (gera o QR Code de aceite).
        first_charge_description:
          type: string
          maxLength: 500
      required:
      - contract_id
      - customer_id
      - first_charge_value
      - frequency
      - start_date
    PixAutomaticAuthorizationCreateFrequencyEnum:
      enum:
      - WEEKLY
      - MONTHLY
      - QUARTERLY
      - SEMIANNUALLY
      - ANNUALLY
      type: string
      description: '* `WEEKLY` - WEEKLY

        * `MONTHLY` - MONTHLY

        * `QUARTERLY` - QUARTERLY

        * `SEMIANNUALLY` - SEMIANNUALLY

        * `ANNUALLY` - ANNUALLY'
    PixAutomaticAuthorizationFrequencyEnum:
      enum:
      - WEEKLY
      - MONTHLY
      - QUARTERLY
      - SEMIANNUALLY
      - ANNUALLY
      type: string
      description: '* `WEEKLY` - Semanal

        * `MONTHLY` - Mensal

        * `QUARTERLY` - Trimestral

        * `SEMIANNUALLY` - Semestral

        * `ANNUALLY` - Anual'
    PixAutomaticAuthorizationStatusEnum:
      enum:
      - CREATED
      - ACTIVE
      - CANCELLED
      - REFUSED
      - EXPIRED
      type: string
      description: '* `CREATED` - Criada (aguardando aceite)

        * `ACTIVE` - Ativa

        * `CANCELLED` - Cancelada

        * `REFUSED` - Recusada

        * `EXPIRED` - Expirada'
    PixAutomaticInstruction:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        authorization:
          type: string
          format: uuid
          readOnly: true
          title: Autorização
        transaction:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          title: Transação
        asaas_instruction_id:
          type: string
          readOnly: true
          title: Instruction ID Asaas
        asaas_payment_id:
          type: string
          readOnly: true
          title: Payment ID Asaas
        value:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Valor
        due_date:
          type: string
          format: date
          readOnly: true
          title: Vencimento
        status:
          allOf:
          - $ref: '#/components/schemas/PixAutomaticInstructionStatusEnum'
          readOnly: true
        refusal_reason:
          type: string
          readOnly: true
          title: Motivo de recusa
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - asaas_instruction_id
      - asaas_payment_id
      - authorization
      - created_at
      - due_date
      - id
      - refusal_reason
      - status
      - transaction
      - updated_at
      - value
    PixAutomaticInstructionStatusEnum:
      enum:
      - AWAITING_REQUEST
      - SCHEDULED
      - DONE
      - CANCELLED
      - REFUSED
      type: string
      description: '* `AWAITING_REQUEST` - Aguardando solicitação

        * `SCHEDULED` - Agendada

        * `DONE` - Concluída

        * `CANCELLED` - Cancelada

        * `REFUSED` - Recusada'
    Plan:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          maxLength: 100
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          title: Descrição
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Preço
        billing_cycle:
          allOf:
          - $ref: '#/components/schemas/BillingCycleEnum'
          title: Ciclo de cobrança
        features:
          title: Funcionalidades
        is_active:
          type: boolean
          title: Ativo
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - created_at
      - id
      - name
      - price
      - slug
      - updated_at
    PlatformConfig:
      type: object
      description: Serializer dos pisos de custo (não expõe os defaults).
      properties:
        fee_percentage_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % Pix
        fee_fixed_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso fixo Pix
        fee_percentage_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % Boleto
        fee_fixed_boleto:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso fixo Boleto
        fee_percentage_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito à vista
        fee_percentage_credit_2_6:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito 2-6x
        fee_percentage_credit_7_12:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito 7-12x
        fee_percentage_credit_13:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso % crédito 13-21x
        fee_fixed_credit:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso fixo crédito
        anticipation_rate_credit_vista:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso antecipação crédito à vista
        anticipation_rate_credit_parceled:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso antecipação crédito parcelado
        anticipation_rate_boleto_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Piso antecipação boleto/pix
        withdrawal_fee_pix:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso saque Pix
        withdrawal_fee_ted:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Piso saque TED
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - updated_at
    Product:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          maxLength: 100
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          title: Descrição
        product_type:
          allOf:
          - $ref: '#/components/schemas/ProductTypeEnum'
          title: Tipo
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Preço
        quantity:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Quantidade no pacote
          description: 'Para packs: quantas unidades o cliente recebe. Para one_time:
            sempre 1.'
        is_active:
          type: boolean
          title: Ativo
        metadata:
          title: Metadados
          description: 'Dados extras: validade_dias, features, limites, etc.'
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - created_at
      - id
      - name
      - price
      - slug
      - updated_at
    ProductCreate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Nome
          maxLength: 255
        slug:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          title: Descrição
        product_type:
          allOf:
          - $ref: '#/components/schemas/ProductTypeEnum'
          title: Tipo
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Preço
        quantity:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Quantidade no pacote
          description: 'Para packs: quantas unidades o cliente recebe. Para one_time:
            sempre 1.'
        is_active:
          type: boolean
          title: Ativo
        metadata:
          title: Metadados
          description: 'Dados extras: validade_dias, features, limites, etc.'
      required:
      - id
      - name
      - price
    ProductTypeEnum:
      enum:
      - one_time
      - pack
      - credits
      type: string
      description: '* `one_time` - Pagamento único

        * `pack` - Pacote (quantidade)

        * `credits` - Créditos'
    Signup:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
          writeOnly: true
          minLength: 8
        org_name:
          type: string
          maxLength: 255
        cpf_cnpj:
          type: string
          maxLength: 18
        phone:
          type: string
          maxLength: 20
        birth_date:
          type: string
          format: date
          description: 'Obrigatório. Formato: YYYY-MM-DD'
        company_type:
          allOf:
          - $ref: '#/components/schemas/CompanyTypeEnum'
          description: 'Tipo de empresa (obrigatório para CNPJ): MEI, LIMITED, INDIVIDUAL,
            ASSOCIATION


            * `MEI` - MEI

            * `LIMITED` - LIMITED

            * `INDIVIDUAL` - INDIVIDUAL

            * `ASSOCIATION` - ASSOCIATION'
        income_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,10}(?:\.\d{0,2})?$
          default: '1000.00'
        postal_code:
          type: string
          maxLength: 9
        address:
          type: string
          maxLength: 255
        address_number:
          type: string
          maxLength: 20
        province:
          type: string
          maxLength: 100
        complement:
          type: string
          default: ''
          maxLength: 255
        security_pin:
          type: string
          maxLength: 6
          minLength: 6
      required:
      - address
      - address_number
      - birth_date
      - cpf_cnpj
      - email
      - org_name
      - password
      - phone
      - postal_code
      - province
      - security_pin
    Subscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        customer:
          type: string
          format: uuid
          title: Cliente
        customer_name:
          type: string
          readOnly: true
        plan:
          type: string
          format: uuid
          title: Plano
        plan_name:
          type: string
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/SubscriptionStatusEnum'
          readOnly: true
        billing_type:
          type: string
          title: Forma de pagamento
          maxLength: 20
        asaas_subscription_id:
          type: string
          readOnly: true
          title: Subscription ID Asaas
        current_period_start:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Início do período
        current_period_end:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Fim do período
        canceled_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Cancelado em
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - asaas_subscription_id
      - canceled_at
      - created_at
      - current_period_end
      - current_period_start
      - customer
      - customer_name
      - id
      - plan
      - plan_name
      - status
      - updated_at
    SubscriptionCreate:
      type: object
      properties:
        customer_id:
          type: string
          format: uuid
        plan_id:
          type: string
          format: uuid
        billing_type:
          $ref: '#/components/schemas/SubscriptionCreateBillingTypeEnum'
        credit_card_token:
          type: string
        next_due_date:
          type: string
          format: date
      required:
      - billing_type
      - customer_id
      - plan_id
    SubscriptionCreateBillingTypeEnum:
      enum:
      - CREDIT_CARD
      - PIX
      - BOLETO
      type: string
      description: '* `CREDIT_CARD` - CREDIT_CARD

        * `PIX` - PIX

        * `BOLETO` - BOLETO'
    SubscriptionStatusEnum:
      enum:
      - pending
      - active
      - overdue
      - canceled
      - expired
      type: string
      description: '* `pending` - Pendente

        * `active` - Ativa

        * `overdue` - Inadimplente

        * `canceled` - Cancelada

        * `expired` - Expirada'
    TokenRefresh:
      type: object
      properties:
        access:
          type: string
          readOnly: true
        refresh:
          type: string
      required:
      - access
      - refresh
    Transaction:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        customer:
          type: string
          format: uuid
          title: Cliente
        customer_name:
          type: string
          readOnly: true
        subscription:
          type: string
          format: uuid
          nullable: true
          title: Assinatura
        description:
          type: string
          title: Descrição
          maxLength: 500
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          title: Valor bruto
        net_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Valor líquido
        platform_fee:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa da plataforma
        provider_fee:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa do provider (Asaas)
        billing_type:
          allOf:
          - $ref: '#/components/schemas/TransactionBillingTypeEnum'
          title: Forma de pagamento
        installments:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Parcelas
        status:
          allOf:
          - $ref: '#/components/schemas/TransactionStatusEnum'
          readOnly: true
        pix_qr_code:
          type: string
          readOnly: true
        pix_copy_paste:
          type: string
          readOnly: true
          title: Pix Copia e Cola
        boleto_url:
          type: string
          format: uri
          readOnly: true
          title: URL do Boleto
        boleto_barcode:
          type: string
          readOnly: true
          title: Código de Barras
        due_date:
          type: string
          format: date
          nullable: true
          title: Vencimento
        paid_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Pago em
        anticipated:
          type: boolean
          readOnly: true
          title: Antecipado
        anticipation_fee:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          title: Taxa de antecipação
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Criado em
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Atualizado em
      required:
      - amount
      - anticipated
      - anticipation_fee
      - billing_type
      - boleto_barcode
      - boleto_url
      - created_at
      - customer
      - customer_name
      - id
      - net_amount
      - paid_at
      - pix_copy_paste
      - pix_qr_code
      - platform_fee
      - provider_fee
      - status
      - updated_at
    TransactionBillingTypeEnum:
      enum:
      - PIX
      - PIX_AUTOMATIC
      - CREDIT_CARD
      - BOLETO
      type: string
      description: '* `PIX` - Pix

        * `PIX_AUTOMATIC` - Pix Automático

        * `CREDIT_CARD` - Cartão de Crédito

        * `BOLETO` - Boleto'
    TransactionStatusEnum:
      enum:
      - pending
      - confirmed
      - received
      - overdue
      - refunded
      - chargeback
      - failed
      - canceled
      type: string
      description: '* `pending` - Pendente

        * `confirmed` - Confirmado

        * `received` - Recebido

        * `overdue` - Vencido

        * `refunded` - Reembolsado

        * `chargeback` - Chargeback

        * `failed` - Falhou

        * `canceled` - Cancelado'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'API key da organização: Bearer vd_live_xxx'
tags:
- name: Checkout
  description: 'Cobranças: Pix, Boleto, Cartão, Guest checkout'
- name: Pagamentos
  description: Status, reembolso, cancelamento, chargeback
- name: Assinaturas
  description: Planos e assinaturas recorrentes
- name: Produtos
  description: Produtos avulsos e pedidos
- name: Clientes
  description: Cadastro de pagadores
- name: Financeiro
  description: Saldo, transferências, extrato
- name: Antecipacao
  description: Simulação e solicitação de antecipação
- name: Pix Automatico
  description: Autorizações e cobranças recorrentes via Pix Automático (SPI/BC)
- name: Contratos
  description: Gestão e assinatura eletrônica de contratos comerciais
- name: Relatorios
  description: Overview, receita, churn, transações
- name: Configuracoes
  description: Webhook, onboarding, settings da org
- name: Auth
  description: Signup, login, PIN, API key
