{
  "openapi": "3.0.0",
  "info": {
    "title": "Brazil Pix API",
    "description": "Brazil Pix Payment API documentation",
    "version": "1.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.brazilpix.com/v2"
    }
  ],
  "paths": {
    "/auth": {
      "post": {
        "operationId": "ExternalAuthController_authenticate",
        "summary": "Gerar Access Token",
        "description": "Troca o `client_id` e o `client_secret` da sua credencial por um access token de curta duração. Envie o token retornado no header `Authorization: Bearer <access_token>` das demais requisições.\n\nO token expira em **300 segundos (5 minutos)** — gere um novo quando expirar; não há refresh token.",
        "tags": ["Autenticação"],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "Identificador da credencial (mp_live_* produção, mp_test_* sandbox)",
                    "example": "mp_live_0123456789abcdef01234567"
                  },
                  "client_secret": {
                    "type": "string",
                    "description": "Secret da credencial (exibido uma única vez na criação)"
                  }
                },
                "required": ["client_id", "client_secret"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token gerado com sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "description": "Token JWT para usar no header Authorization",
                      "example": "eyJhbGciOiJSUzI1NiIs..."
                    },
                    "token_type": {
                      "type": "string",
                      "example": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Validade do token em segundos",
                      "example": 300
                    }
                  },
                  "required": ["access_token", "token_type", "expires_in"]
                }
              }
            }
          },
          "400": {
            "description": "client_id ou client_secret ausentes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "error": "Bad Request",
                    "message": "client_id and client_secret are required"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Credencial inválida, revogada ou secret incorreto",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "error": "Unauthorized",
                    "message": "Invalid credentials"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pix": {
      "post": {
        "description": "Cria uma cobrança PIX instantânea.\n\n**Permissão requerida:** `PIX:WRITE` ou `FULL_ACCESS`",
        "operationId": "ExternalPixController_createCharge",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Chave única do cliente (8-255 chars) que torna a requisição idempotente. Retentativas com a mesma chave retornam a resposta cacheada (TTL 24h). Mesma chave com body diferente retorna 422.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePixChargeInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Cobrança PIX criada com sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePixChargeOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Criar uma cobrança PIX",
        "tags": ["External API - PIX"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/projects": {
      "post": {
        "description": "Cria um novo projeto.\n\n**Permissão requerida:** `PROJECT:WRITE` ou `FULL_ACCESS`",
        "operationId": "ExternalProjectsController_createProject",
        "parameters": [
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Projeto criado com sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateProjectOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - Resource already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Criar um projeto",
        "tags": ["External API - Projects"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "description": "Retorna uma lista paginada de projetos.\n\n**Permissão requerida:** `PROJECT:READ` ou `FULL_ACCESS`",
        "operationId": "ExternalProjectsController_getAllProjects",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Número da página",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Itens por página",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "type": "integer"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "description": "Ordenar por campo",
            "schema": {
              "default": "createdAt",
              "type": "string",
              "enum": ["createdAt", "updatedAt", "name"]
            }
          },
          {
            "name": "sortOrder",
            "required": false,
            "in": "query",
            "description": "Ordem de classificação",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": ["asc", "desc"]
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de projetos",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAllProjectsOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Listar projetos",
        "tags": ["External API - Projects"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/projects/{id}": {
      "get": {
        "description": "Retorna os detalhes de um projeto específico pelo seu ID.\n\n**Permissão requerida:** `PROJECT:READ` ou `FULL_ACCESS`",
        "operationId": "ExternalProjectsController_getProject",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID do projeto",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalhes do projeto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProjectOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Buscar projeto por ID",
        "tags": ["External API - Projects"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/transactions/{id}": {
      "get": {
        "description": "Retorna os detalhes de uma transação específica pelo seu ID.\n\n**Permissão requerida:** `TRANSACTION:READ` ou `FULL_ACCESS`",
        "operationId": "ExternalTransactionsController_getTransaction",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID da transação (UUID), o seu external_reference, ou a Idempotency-Key usada na criação. Resolvidos nessa ordem. Saque ainda em processamento (sem transação) também é resolvido por qualquer um desses.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalhes da transação",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTransactionOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Buscar transação por ID",
        "tags": ["External API - Transactions"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/transactions/{id}/refund": {
      "post": {
        "description": "Solicita um reembolso total da transação de pagamento informada. O reembolso é assíncrono — a confirmação chega via webhook `refund_completed` quando o PSP processar.\n\n**Permissão requerida:** `REFUND:WRITE` ou `FULL_ACCESS`",
        "operationId": "ExternalTransactionsController_requestRefund",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID da transação de pagamento a ser reembolsada",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestRefundInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Reembolso solicitado com sucesso. Status PENDING até a confirmação via webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestRefundOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Transação não pode ser reembolsada (já reembolsada, expirada, status inválido, etc.)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Transação não encontrada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Solicitar reembolso de transação",
        "tags": ["External API - Transactions"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/balance-blocks": {
      "get": {
        "description": "Retorna os bloqueios de saldo (MED, judiciais ou administrativos) da conta. Permite filtrar opcionalmente pelo status do bloqueio.\n\n**Permissão requerida:** `BALANCE_BLOCK:READ` ou `FULL_ACCESS`",
        "operationId": "ExternalBalanceBlocksController_findAll",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filtra os bloqueios pelo status. Se omitido, retorna todos os bloqueios da conta.",
            "schema": {
              "type": "string",
              "enum": ["awaiting_response", "defended", "approved", "rejected"]
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de bloqueios de saldo da conta",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAllExternalBalanceBlocksOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Listar bloqueios de saldo",
        "tags": ["External API - Balance Blocks"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/withdrawals": {
      "post": {
        "description": "Cria um novo saque via PIX informando os dados da chave PIX e do titular da conta destino.\n\n**Permissão requerida:** `WITHDRAWAL:WRITE` ou `FULL_ACCESS`\n\n**Restrição de IP:** Se a credencial tiver uma lista de IPs permitidos configurada, requisições fora dela são rejeitadas com `403`. Recomendado para credenciais com esta permissão.",
        "operationId": "ExternalWithdrawalsController_create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Chave única do cliente (8-255 chars) que torna a requisição idempotente. Retentativas com a mesma chave retornam a resposta cacheada (TTL 24h). Mesma chave com body diferente retorna 422.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            }
          },
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExternalWithdrawalInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saque criado com sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetExternalWithdrawalOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Criar um saque via PIX",
        "tags": ["External API - Withdrawals (Saques)"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/account": {
      "get": {
        "description": "Retorna os dados da conta, informações da empresa e saldo disponível.\n\n**Permissão requerida:** `ACCOUNT:READ` ou `FULL_ACCESS`",
        "operationId": "ExternalAccountController_getAccountInfo",
        "parameters": [
          {
            "$ref": "#/components/parameters/SubAccount"
          }
        ],
        "responses": {
          "200": {
            "description": "Dados da conta e saldo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAccountInfoOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Obter dados da conta e saldo",
        "tags": ["External API - Account (Conta)"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/sub-accounts": {
      "post": {
        "description": "Cria uma subconta com saldo próprio, totalmente independente do saldo da conta principal.\n\n**Permissão requerida:** `SUBACCOUNT:WRITE` ou `FULL_ACCESS`",
        "operationId": "ExternalSubAccountsController_createSubAccount",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubAccountInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subconta criada com sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSubAccountOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - `reference` já usado nesta conta (`SUB_ACCOUNT_REFERENCE_TAKEN`) ou limite de subcontas atingido (`SUB_ACCOUNT_QUOTA_EXCEEDED`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Criar uma subconta",
        "tags": ["External API - Sub-accounts (Subcontas)"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "description": "Retorna as subcontas da conta.\n\n**Permissão requerida:** `SUBACCOUNT:READ` ou `FULL_ACCESS`",
        "operationId": "ExternalSubAccountsController_getAllSubAccounts",
        "responses": {
          "200": {
            "description": "Lista de subcontas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAllSubAccountsOutput"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        },
        "summary": "Listar subcontas",
        "tags": ["External API - Sub-accounts (Subcontas)"],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Access token obtido no POST /auth (client_id + client_secret). Válido por 300 segundos."
      }
    },
    "parameters": {
      "SubAccount": {
        "name": "X-Sub-Account",
        "in": "header",
        "required": false,
        "description": "Reference da subconta em que a operação deve ser executada. Quando omitido, a operação acontece na conta principal; o valor reservado `principal` também resolve para a conta principal e é equivalente a omitir o header. Aceito em todos os endpoints, exceto `POST /auth` e os próprios endpoints de `/sub-accounts`, que sempre operam na conta principal.\n\nErros possíveis: `404 SUB_ACCOUNT_NOT_FOUND`, `403 SUB_ACCOUNT_FORBIDDEN`, `403 SUB_ACCOUNT_SUSPENDED`.\n\nExige que a credencial tenha o **acesso a subcontas** habilitado (Configurações → Integração → Credenciais de API). Ele nasce desligado e não é substituído por nenhuma permissão, nem por `FULL_ACCESS`: sem ele a resposta é `403 SUB_ACCOUNT_FORBIDDEN`.",
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9_-]{1,31}$",
          "example": "loja-centro"
        }
      }
    },
    "schemas": {
      "GetWebhookLogOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Webhook log ID"
          },
          "webhookEndpointId": {
            "type": "string",
            "description": "Webhook endpoint ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "eventType": {
            "type": "string",
            "description": "Event type"
          },
          "eventId": {
            "type": "string",
            "description": "Event ID"
          },
          "status": {
            "type": "string",
            "description": "Delivery status",
            "enum": ["success", "failed", "pending", "retrying"]
          },
          "url": {
            "type": "string",
            "description": "Target URL"
          },
          "httpStatus": {
            "type": "object",
            "description": "HTTP status code"
          },
          "requestHeaders": {
            "type": "object",
            "description": "Request headers"
          },
          "requestPayload": {
            "type": "object",
            "description": "Request payload"
          },
          "responseHeaders": {
            "type": "object",
            "description": "Response headers"
          },
          "responseBody": {
            "type": "object",
            "description": "Response body"
          },
          "attempts": {
            "type": "number",
            "description": "Number of delivery attempts"
          },
          "maxAttempts": {
            "type": "number",
            "description": "Maximum delivery attempts"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "lastAttemptAt": {
            "type": "object",
            "description": "Last attempt timestamp"
          },
          "nextRetryAt": {
            "type": "object",
            "description": "Next retry timestamp"
          },
          "durationMs": {
            "type": "object",
            "description": "Request duration in milliseconds"
          }
        },
        "required": [
          "id",
          "webhookEndpointId",
          "accountId",
          "eventType",
          "eventId",
          "status",
          "url",
          "requestHeaders",
          "requestPayload",
          "attempts",
          "maxAttempts",
          "createdAt"
        ]
      },
      "PaginationMeta": {
        "type": "object",
        "properties": {
          "page": {
            "type": "number",
            "example": 1,
            "description": "Current page number"
          },
          "limit": {
            "type": "number",
            "example": 20,
            "description": "Items per page"
          },
          "total": {
            "type": "number",
            "example": 100,
            "description": "Total number of items"
          },
          "totalPages": {
            "type": "number",
            "example": 5,
            "description": "Total number of pages"
          },
          "hasNextPage": {
            "type": "boolean",
            "example": true,
            "description": "Whether there is a next page"
          },
          "hasPreviousPage": {
            "type": "boolean",
            "example": false,
            "description": "Whether there is a previous page"
          }
        },
        "required": [
          "page",
          "limit",
          "total",
          "totalPages",
          "hasNextPage",
          "hasPreviousPage"
        ]
      },
      "GetAllWebhookLogsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of webhook logs",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWebhookLogOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "BadRequestErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "error": {
            "type": "string",
            "example": "BadRequest"
          },
          "message": {
            "type": "string",
            "example": "name must be longer than or equal to 2 characters"
          },
          "details": {
            "type": "object"
          },
          "timestamp": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "traceId": {
            "type": "string"
          }
        },
        "required": ["statusCode", "error", "message", "timestamp"]
      },
      "InternalServerErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 500
          },
          "error": {
            "type": "string",
            "example": "InternalError"
          },
          "message": {
            "type": "string",
            "example": "An unexpected error occurred"
          },
          "details": {
            "type": "object"
          },
          "timestamp": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "traceId": {
            "type": "string",
            "example": "2771463d58840c8e116dc6dda1e1e5d0"
          }
        },
        "required": ["statusCode", "error", "message", "timestamp"]
      },
      "NotFoundErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 404
          },
          "error": {
            "type": "string",
            "example": "NotFound"
          },
          "message": {
            "type": "string",
            "example": "Resource with id 550e8400-e29b-41d4-a716-446655440000 not found"
          },
          "details": {
            "type": "object",
            "example": {
              "resource": "Example",
              "id": "550e8400-e29b-41d4-a716-446655440000"
            }
          },
          "timestamp": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "traceId": {
            "type": "string"
          }
        },
        "required": ["statusCode", "error", "message", "timestamp"]
      },
      "CreateTransactionInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "paymentLinkId": {
            "type": "string",
            "description": "Payment link ID"
          },
          "subscriptionId": {
            "type": "string",
            "description": "Subscription ID"
          },
          "invoiceId": {
            "type": "string",
            "description": "Invoice ID"
          },
          "pspCredentialId": {
            "type": "string",
            "description": "PSP Credential ID that processed this transaction"
          },
          "date": {
            "type": "string",
            "description": "Transaction date"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents"
          },
          "feeAmount": {
            "type": "number",
            "description": "Fee amount in cents",
            "default": 0
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "default": "BRL"
          },
          "type": {
            "type": "string",
            "description": "Transaction type",
            "enum": [
              "payment",
              "fee",
              "refund",
              "chargeback",
              "withdrawal",
              "adjustment"
            ]
          },
          "status": {
            "type": "string",
            "description": "Transaction status",
            "enum": ["completed", "pending", "failed", "cancelled"]
          },
          "paymentMethod": {
            "type": "string",
            "description": "Payment method",
            "enum": ["ask_customer", "pix", "credit_card", "boleto"]
          },
          "installmentNumber": {
            "type": "number",
            "description": "Installment number"
          },
          "installmentTotal": {
            "type": "number",
            "description": "Total installments"
          },
          "description": {
            "type": "string",
            "description": "Transaction description"
          },
          "failureReason": {
            "type": "string",
            "description": "Failure reason (for failed transactions)"
          },
          "parentTransactionId": {
            "type": "string",
            "description": "Parent transaction ID (for fees linked to payments/withdrawals)"
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata"
          },
          "ledgerTransferId": {
            "type": "string",
            "description": "Ledger transfer ID"
          },
          "ledgerSyncStatus": {
            "type": "string",
            "description": "Ledger sync status",
            "enum": ["pending", "synced", "failed"]
          },
          "ledgerSyncedAt": {
            "type": "string",
            "description": "Ledger synced timestamp"
          }
        },
        "required": [
          "date",
          "amount",
          "netAmount",
          "type",
          "status",
          "description"
        ]
      },
      "GetTransactionOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID da transação",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "Status da transação",
            "enum": ["pending", "completed", "failed", "cancelled"]
          },
          "type": {
            "type": "string",
            "description": "Tipo da transação. `internal_transfer` é movimento entre contas da mesma titularidade — transferência interna ou perna de split — e não trafega no PIX.",
            "enum": [
              "payment",
              "fee",
              "refund",
              "chargeback",
              "withdrawal",
              "adjustment",
              "referral_commission",
              "internal_transfer"
            ]
          },
          "paymentMethod": {
            "type": "string",
            "description": "Método de pagamento utilizado",
            "enum": ["pix", "credit_card", "boleto"]
          },
          "amount": {
            "type": "number",
            "description": "Valor em BRL",
            "example": 150.75
          },
          "currency": {
            "type": "string",
            "description": "Código da moeda",
            "example": "BRL"
          },
          "description": {
            "type": "string",
            "description": "Descrição da transação"
          },
          "externalReference": {
            "type": "string",
            "description": "Seu ID de referência externa",
            "example": "pedido-12345"
          },
          "customerId": {
            "type": "string",
            "description": "ID do cliente",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "description": "ID do projeto",
            "format": "uuid"
          },
          "metadata": {
            "type": "object",
            "description": "Metadados personalizados (pares chave-valor)",
            "additionalProperties": true,
            "example": {
              "orderId": "12345",
              "source": "website"
            }
          },
          "pixCopyPaste": {
            "type": "string",
            "description": "Código PIX copia e cola (apenas para transações PIX pendentes)",
            "example": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "expiresAt": {
            "type": "string",
            "description": "Data de expiração (apenas para transações pendentes)",
            "format": "date-time"
          },
          "paidAt": {
            "type": "string",
            "description": "Data em que a transação foi paga",
            "format": "date-time"
          },
          "e2eId": {
            "type": "string",
            "description": "ID fim-a-fim da rede PIX (presente quando o PSP já confirmou)",
            "example": "E18189547202603160145ZYFfVx3jP8D"
          },
          "counterpartName": {
            "type": "string",
            "description": "Nome da contraparte conforme retornado pelo PSP (pagador no cash-in, destinatário no saque)",
            "example": "Maria Silva"
          },
          "counterpartDocument": {
            "type": "string",
            "description": "CPF/CNPJ da contraparte, sem máscara",
            "example": "12345678900"
          },
          "failureReason": {
            "type": "string",
            "description": "Motivo da falha (apenas quando status = failed)",
            "example": "Bloqueio de depósito: pagador CNPJ não permitido"
          },
          "blockedDeposit": {
            "type": "object",
            "nullable": true,
            "description": "Presente quando um depósito RECEBIDO foi bloqueado por política da conta (ex.: pagadores CNPJ não permitidos). O valor NÃO foi creditado; `refund` informa se o dinheiro voltou ao pagador (status pending/confirmed/failed), o E2E da devolução e quando liquidou.",
            "properties": {
              "reason": { "type": "string", "example": "cnpj_payer_not_allowed" },
              "refund": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "status": { "type": "string", "enum": ["pending", "confirmed", "failed"] },
                  "e2eId": { "type": "string", "nullable": true, "example": "D54811417202609082224L1aDrByinUX" },
                  "settledAt": { "type": "string", "format": "date-time", "nullable": true }
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "description": "Data de criação",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Data de atualização",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "status",
          "type",
          "paymentMethod",
          "amount",
          "currency",
          "createdAt"
        ]
      },
      "GetAllTransactionsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of transactions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetTransactionOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "LedgerAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Ledger account ID (PostgreSQL UUID)"
          },
          "accountId": {
            "type": "object",
            "description": "Account ID (null for system accounts)",
            "nullable": true
          },
          "type": {
            "type": "string",
            "description": "Account type",
            "enum": [
              "available",
              "held",
              "credits",
              "external_world",
              "treasury",
              "grants",
              "treasury_sandbox",
              "external_world_sandbox"
            ]
          },
          "tigerBeetleId": {
            "type": "string",
            "description": "TigerBeetle 128-bit account ID (as string)"
          },
          "ledger": {
            "type": "number",
            "description": "Ledger number"
          },
          "code": {
            "type": "number",
            "description": "Account code"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "type",
          "tigerBeetleId",
          "ledger",
          "code",
          "createdAt"
        ]
      },
      "CreateUserAccountsOutput": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "Account ID (from JWT)"
          },
          "available": {
            "description": "Available balance account",
            "allOf": [
              {
                "$ref": "#/components/schemas/LedgerAccountOutput"
              }
            ]
          },
          "held": {
            "description": "Held funds account",
            "allOf": [
              {
                "$ref": "#/components/schemas/LedgerAccountOutput"
              }
            ]
          },
          "credits": {
            "description": "Promotional credits account",
            "allOf": [
              {
                "$ref": "#/components/schemas/LedgerAccountOutput"
              }
            ]
          },
          "created": {
            "type": "boolean",
            "description": "Whether accounts were newly created or already existed"
          }
        },
        "required": ["accountId", "available", "held", "credits", "created"]
      },
      "UnauthorizedErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          },
          "message": {
            "type": "string",
            "example": "Authentication token is required"
          },
          "details": {
            "type": "object"
          },
          "timestamp": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "traceId": {
            "type": "string"
          }
        },
        "required": ["statusCode", "error", "message", "timestamp"]
      },
      "AccountBalanceOutput": {
        "type": "object",
        "properties": {
          "tigerBeetleId": {
            "type": "string",
            "description": "TigerBeetle account ID (as string)"
          },
          "type": {
            "type": "string",
            "description": "Account type"
          },
          "debitsPending": {
            "type": "string",
            "description": "Debits pending (in cents)"
          },
          "debitsPosted": {
            "type": "string",
            "description": "Debits posted (in cents)"
          },
          "creditsPending": {
            "type": "string",
            "description": "Credits pending (in cents)"
          },
          "creditsPosted": {
            "type": "string",
            "description": "Credits posted (in cents)"
          },
          "balance": {
            "type": "string",
            "description": "Available balance (credits_posted - debits_posted) in cents"
          }
        },
        "required": [
          "tigerBeetleId",
          "type",
          "debitsPending",
          "debitsPosted",
          "creditsPending",
          "creditsPosted",
          "balance"
        ]
      },
      "GetUserBalanceOutput": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "available": {
            "description": "Available balance account",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "held": {
            "description": "Held funds account",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "credits": {
            "description": "Promotional credits account",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "totalBalance": {
            "type": "string",
            "description": "Total available balance (available + credits) in cents"
          }
        },
        "required": [
          "accountId",
          "available",
          "held",
          "credits",
          "totalBalance"
        ]
      },
      "GetSystemBalanceOutput": {
        "type": "object",
        "properties": {
          "externalWorld": {
            "description": "External world account (source/sink for payments)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "externalWorldSandbox": {
            "description": "External world sandbox account (source/sink for sandbox payments)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "treasury": {
            "description": "Treasury account (platform fees)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "treasurySandbox": {
            "description": "Treasury sandbox account (platform fees from sandbox)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          },
          "grants": {
            "description": "Grants account (promotional credits)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountBalanceOutput"
              }
            ]
          }
        },
        "required": [
          "externalWorld",
          "externalWorldSandbox",
          "treasury",
          "treasurySandbox",
          "grants"
        ]
      },
      "CreateTransferInput": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Amount in cents",
            "example": 10000
          },
          "methodKey": {
            "type": "string",
            "description": "Payment method key",
            "example": "pix"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID for project-specific fee lookup"
          },
          "description": {
            "type": "string",
            "description": "Transfer description"
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata"
          }
        },
        "required": ["amount", "methodKey"]
      },
      "TransferOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Transfer ID (PostgreSQL UUID)"
          },
          "tigerBeetleId": {
            "type": "string",
            "description": "TigerBeetle transfer ID (as string)"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "type": {
            "type": "string",
            "description": "Transfer type",
            "enum": ["payment", "fee", "settlement"]
          },
          "status": {
            "type": "string",
            "description": "Transfer status",
            "enum": ["pending", "posted", "voided"]
          },
          "debitAccountId": {
            "type": "string",
            "description": "Debit ledger account ID"
          },
          "creditAccountId": {
            "type": "string",
            "description": "Credit ledger account ID"
          },
          "amount": {
            "type": "number",
            "description": "Gross amount in cents"
          },
          "feeAmount": {
            "type": "number",
            "description": "Fee amount in cents"
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount in cents (amount - feeAmount)"
          },
          "balanceImpact": {
            "type": "number",
            "description": "Balance impact in cents (withdrawals: amount + feeAmount debited, payments: netAmount credited)"
          },
          "methodKey": {
            "type": "object",
            "description": "Payment method key"
          },
          "description": {
            "type": "object",
            "description": "Transfer description"
          },
          "linkedTransferId": {
            "type": "object",
            "description": "Linked transfer ID (for fee transfers)"
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "postedAt": {
            "type": "object",
            "description": "Posted timestamp"
          },
          "voidedAt": {
            "type": "object",
            "description": "Voided timestamp"
          },
          "feeTransferId": {
            "type": "object",
            "description": "Fee transfer ID (if fee was charged)"
          }
        },
        "required": [
          "id",
          "tigerBeetleId",
          "accountId",
          "type",
          "status",
          "debitAccountId",
          "creditAccountId",
          "amount",
          "feeAmount",
          "netAmount",
          "balanceImpact",
          "createdAt"
        ]
      },
      "CreateLedgerWithdrawalInput": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Amount to withdraw in cents",
            "example": 10000
          },
          "methodKey": {
            "type": "string",
            "description": "Withdrawal method key",
            "example": "withdrawal"
          },
          "description": {
            "type": "string",
            "description": "Withdrawal description"
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata"
          },
          "timeout": {
            "type": "number",
            "description": "Timeout in seconds for pending withdrawal auto-void (0 = no timeout)",
            "example": 86400,
            "minimum": 0,
            "maximum": 2592000
          }
        },
        "required": ["amount", "methodKey"]
      },
      "CreateFeeInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID (optional, null for account-wide fee)"
          },
          "methodKey": {
            "type": "string",
            "description": "Fee method key",
            "enum": ["pix", "credit_card", "boleto", "withdrawal", "refund"],
            "example": "pix"
          },
          "methodDisplayName": {
            "type": "string",
            "description": "Display name for the payment method",
            "example": "PIX"
          },
          "fixedFee": {
            "type": "number",
            "description": "Fixed fee in cents",
            "default": 0,
            "example": 100
          },
          "percentFee": {
            "type": "string",
            "description": "Percentage fee (0.00 to 100.00)",
            "default": "0",
            "example": "2.50"
          },
          "minFee": {
            "type": "number",
            "description": "Minimum fee in cents",
            "example": 50
          },
          "maxFee": {
            "type": "number",
            "description": "Maximum fee in cents",
            "example": 5000
          },
          "settlementDays": {
            "type": "number",
            "description": "Settlement days",
            "default": 0,
            "example": 1
          },
          "isActive": {
            "type": "boolean",
            "description": "Is fee active",
            "default": true
          }
        },
        "required": ["methodKey", "methodDisplayName"]
      },
      "GetFeeOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Fee ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "projectId": {
            "type": "object",
            "description": "Project ID (null for account-wide fee)"
          },
          "methodKey": {
            "type": "string",
            "description": "Payment method key"
          },
          "methodDisplayName": {
            "type": "string",
            "description": "Display name for the payment method"
          },
          "fixedFee": {
            "type": "number",
            "description": "Fixed fee in cents"
          },
          "percentFee": {
            "type": "string",
            "description": "Percentage fee"
          },
          "minFee": {
            "type": "object",
            "description": "Minimum fee in cents"
          },
          "maxFee": {
            "type": "object",
            "description": "Maximum fee in cents"
          },
          "settlementDays": {
            "type": "number",
            "description": "Settlement days"
          },
          "isActive": {
            "type": "boolean",
            "description": "Is fee active"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "methodKey",
          "methodDisplayName",
          "fixedFee",
          "percentFee",
          "settlementDays",
          "isActive",
          "createdAt"
        ]
      },
      "ConflictErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 409
          },
          "error": {
            "type": "string",
            "example": "Conflict"
          },
          "message": {
            "type": "string",
            "example": "Resource with name 'Example' already exists"
          },
          "details": {
            "type": "object",
            "example": {
              "resource": "Example",
              "field": "name",
              "value": "Example"
            }
          },
          "timestamp": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "traceId": {
            "type": "string"
          }
        },
        "required": ["statusCode", "error", "message", "timestamp"]
      },
      "GetAllFeesOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of fees",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetFeeOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateFeeInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "object",
            "description": "Project ID (null for account-wide fee)"
          },
          "methodKey": {
            "type": "string",
            "description": "Fee method key",
            "enum": ["pix", "credit_card", "boleto", "withdrawal", "refund"],
            "example": "pix"
          },
          "methodDisplayName": {
            "type": "string",
            "description": "Display name for the payment method",
            "example": "PIX"
          },
          "fixedFee": {
            "type": "number",
            "description": "Fixed fee in cents",
            "example": 100
          },
          "percentFee": {
            "type": "string",
            "description": "Percentage fee (0.00 to 100.00)",
            "example": "2.50"
          },
          "minFee": {
            "type": "object",
            "description": "Minimum fee in cents",
            "example": 50
          },
          "maxFee": {
            "type": "object",
            "description": "Maximum fee in cents",
            "example": 5000
          },
          "settlementDays": {
            "type": "number",
            "description": "Settlement days",
            "example": 1
          },
          "isActive": {
            "type": "boolean",
            "description": "Is fee active"
          }
        }
      },
      "CreateAccountInput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Account status",
            "enum": ["approved", "pending", "rejected", "suspended"],
            "default": "pending",
            "example": "pending"
          }
        }
      },
      "CreateAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "status": {
            "type": "string",
            "example": "pending",
            "enum": ["approved", "pending", "rejected", "suspended"]
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": ["id", "status", "createdAt"]
      },
      "AccountItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "status": {
            "type": "string",
            "example": "pending",
            "enum": ["approved", "pending", "rejected", "suspended"]
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": ["id", "status", "createdAt"]
      },
      "GetAllAccountsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": ["items", "meta"]
      },
      "GetAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "status": {
            "type": "string",
            "example": "pending",
            "enum": ["approved", "pending", "rejected", "suspended"]
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": ["id", "status", "createdAt"]
      },
      "UpdateAccountInput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Account status",
            "enum": ["approved", "pending", "rejected", "suspended"],
            "example": "approved"
          }
        }
      },
      "AsaasCredentialsInput": {
        "type": "object",
        "properties": {
          "apiKey": {
            "type": "string",
            "description": "Asaas API key",
            "example": "$aact_YourApiKey"
          },
          "sandbox": {
            "type": "boolean",
            "description": "Use sandbox environment (homologation)",
            "default": false
          }
        },
        "required": ["apiKey"]
      },
      "PaymentMethodConfigOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Configuration ID",
            "format": "uuid"
          },
          "paymentMethod": {
            "type": "string",
            "enum": ["pix", "credit_card", "boleto"],
            "description": "Payment method"
          },
          "pspCredentialId": {
            "type": "string",
            "description": "PSP credential ID",
            "format": "uuid"
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Whether method is enabled"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the default PSP for the payment method"
          },
          "settings": {
            "type": "object",
            "description": "Method-specific settings"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "paymentMethod",
          "pspCredentialId",
          "isEnabled",
          "isDefault",
          "createdAt"
        ]
      },
      "GetAccountPaymentMethodsOutput": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "methods": {
            "description": "Configured payment methods",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentMethodConfigOutput"
            }
          }
        },
        "required": ["accountId", "methods"]
      },
      "PaymentMethodSettingsInput": {
        "type": "object",
        "properties": {
          "expirationMinutes": {
            "type": "number",
            "description": "PIX expiration time in minutes",
            "minimum": 5,
            "maximum": 1440
          },
          "maxInstallments": {
            "type": "number",
            "description": "Maximum installments allowed",
            "minimum": 1,
            "maximum": 12
          },
          "minInstallmentValue": {
            "type": "number",
            "description": "Minimum value per installment in cents",
            "minimum": 500
          },
          "daysUntilDue": {
            "type": "number",
            "description": "Days until boleto due date",
            "minimum": 1,
            "maximum": 30
          },
          "instructions": {
            "type": "string",
            "description": "Payment instructions",
            "maxLength": 500
          }
        }
      },
      "ConfigurePaymentMethodInput": {
        "type": "object",
        "properties": {
          "paymentMethod": {
            "type": "string",
            "enum": ["pix", "credit_card", "boleto"],
            "description": "Payment method to configure"
          },
          "pspCredentialId": {
            "type": "string",
            "description": "PSP credential ID to use for this method",
            "format": "uuid"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Set this configuration as default for the payment method",
            "default": false
          },
          "settings": {
            "description": "Method-specific settings",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodSettingsInput"
              }
            ]
          }
        },
        "required": ["paymentMethod", "pspCredentialId"]
      },
      "UpdatePaymentMethodInput": {
        "type": "object",
        "properties": {
          "pspCredentialId": {
            "type": "string",
            "description": "PSP credential ID to use for this method",
            "format": "uuid"
          },
          "settings": {
            "description": "Method-specific settings",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodSettingsInput"
              }
            ]
          }
        }
      },
      "SetDefaultPaymentMethodInput": {
        "type": "object",
        "properties": {
          "pspCredentialId": {
            "type": "string",
            "description": "PSP credential ID to set as default",
            "format": "uuid"
          }
        },
        "required": ["pspCredentialId"]
      },
      "CreateNotificationInput": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "description": "User ID to target specific user"
          },
          "type": {
            "type": "string",
            "description": "Notification type",
            "enum": [
              "payment",
              "refund",
              "chargeback",
              "withdrawal",
              "subscription",
              "system"
            ]
          },
          "title": {
            "type": "string",
            "description": "Notification title"
          },
          "description": {
            "type": "string",
            "description": "Notification description"
          },
          "amount": {
            "type": "number",
            "description": "Related amount in cents"
          },
          "entityType": {
            "type": "string",
            "description": "Related entity type"
          },
          "entityId": {
            "type": "string",
            "description": "Related entity ID"
          }
        },
        "required": ["type", "title", "description"]
      },
      "GetNotificationOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Notification ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "userId": {
            "type": "object",
            "description": "User ID"
          },
          "type": {
            "type": "string",
            "description": "Notification type",
            "enum": [
              "payment",
              "refund",
              "chargeback",
              "withdrawal",
              "subscription",
              "system"
            ]
          },
          "title": {
            "type": "string",
            "description": "Notification title"
          },
          "description": {
            "type": "string",
            "description": "Notification description"
          },
          "amount": {
            "type": "object",
            "description": "Related amount in cents"
          },
          "entityType": {
            "type": "object",
            "description": "Related entity type"
          },
          "entityId": {
            "type": "object",
            "description": "Related entity ID"
          },
          "read": {
            "type": "boolean",
            "description": "Read status"
          },
          "readAt": {
            "type": "object",
            "description": "Read timestamp"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "type",
          "title",
          "description",
          "read",
          "createdAt"
        ]
      },
      "GetAllNotificationsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of notifications",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetNotificationOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateNotificationInput": {
        "type": "object",
        "properties": {
          "read": {
            "type": "boolean",
            "description": "Mark as read"
          }
        }
      },
      "CreateWebhookEndpointInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Webhook endpoint name"
          },
          "environment": {
            "type": "string",
            "description": "Environment for this webhook",
            "enum": ["production", "sandbox"],
            "default": "production"
          },
          "url": {
            "type": "string",
            "description": "Webhook URL to receive events"
          },
          "secret": {
            "type": "string",
            "description": "Secret for signing payloads"
          },
          "events": {
            "description": "Events to subscribe to",
            "example": ["payment_completed", "subscription_created"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "headers": {
            "type": "object",
            "description": "Custom headers to send with webhook requests"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the endpoint is active",
            "default": true
          }
        },
        "required": ["name", "environment", "url", "secret", "events"]
      },
      "GetWebhookEndpointOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Webhook endpoint ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "name": {
            "type": "string",
            "description": "Webhook endpoint name"
          },
          "environment": {
            "type": "string",
            "description": "Environment",
            "enum": ["production", "sandbox"]
          },
          "url": {
            "type": "string",
            "description": "Webhook URL"
          },
          "secretPrefix": {
            "type": "string",
            "description": "Secret prefix (for display)"
          },
          "events": {
            "description": "Subscribed events",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "headers": {
            "type": "object",
            "description": "Custom headers"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the endpoint is active"
          },
          "failureCount": {
            "type": "number",
            "description": "Consecutive failure count"
          },
          "lastSuccessAt": {
            "type": "object",
            "description": "Last successful delivery timestamp"
          },
          "lastFailureAt": {
            "type": "object",
            "description": "Last failed delivery timestamp"
          },
          "disabledAt": {
            "type": "object",
            "description": "Disabled timestamp"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "environment",
          "url",
          "secretPrefix",
          "events",
          "isActive",
          "failureCount",
          "createdAt"
        ]
      },
      "GetAllWebhookEndpointsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of webhook endpoints",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWebhookEndpointOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateWebhookEndpointInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Webhook endpoint name"
          },
          "url": {
            "type": "string",
            "description": "Webhook URL"
          },
          "events": {
            "description": "Events to subscribe to",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "headers": {
            "type": "object",
            "description": "Custom headers"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the endpoint is active"
          }
        }
      },
      "CreatePaymentLinkInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID (for pre-assigned links)"
          },
          "name": {
            "type": "string",
            "description": "Payment link name",
            "example": "Premium Subscription"
          },
          "description": {
            "type": "string",
            "description": "Payment link description"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents (null for open amount)"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "default": "BRL"
          },
          "status": {
            "type": "string",
            "description": "Payment link status",
            "enum": ["active", "expired", "disabled", "paid"],
            "default": "active"
          },
          "slug": {
            "type": "string",
            "description": "Unique URL slug",
            "example": "premium-2024"
          },
          "paymentType": {
            "type": "string",
            "description": "Payment type",
            "enum": ["one_time", "subscription"]
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "example": ["pix", "credit_card"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxInstallments": {
            "type": "number",
            "description": "Maximum number of installments",
            "default": 1
          },
          "recurrenceInterval": {
            "type": "string",
            "description": "Recurrence interval (for subscriptions)",
            "enum": [
              "daily",
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "semiannual",
              "yearly"
            ]
          },
          "recurrenceCount": {
            "type": "number",
            "description": "Number of recurrence cycles (null for indefinite)"
          },
          "notifications": {
            "description": "Notification channels",
            "example": ["email", "whatsapp"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowCoupons": {
            "type": "boolean",
            "description": "Allow coupon codes",
            "default": true
          },
          "expiresAt": {
            "type": "string",
            "description": "Link expiration date"
          }
        },
        "required": [
          "projectId",
          "name",
          "slug",
          "paymentType",
          "paymentMethods",
          "notifications"
        ]
      },
      "GetPaymentLinkOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Payment link ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "clientId": {
            "type": "object",
            "description": "Client ID"
          },
          "name": {
            "type": "string",
            "description": "Payment link name"
          },
          "description": {
            "type": "object",
            "description": "Description"
          },
          "amount": {
            "type": "object",
            "description": "Amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "status": {
            "type": "string",
            "description": "Status",
            "enum": ["active", "expired", "disabled", "paid"]
          },
          "slug": {
            "type": "string",
            "description": "URL slug"
          },
          "paymentsCount": {
            "type": "number",
            "description": "Number of payments received"
          },
          "totalCollected": {
            "type": "number",
            "description": "Total amount collected in cents"
          },
          "paymentType": {
            "type": "string",
            "description": "Payment type",
            "enum": ["one_time", "subscription"]
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxInstallments": {
            "type": "number",
            "description": "Maximum installments"
          },
          "recurrenceInterval": {
            "type": "object",
            "description": "Recurrence interval"
          },
          "recurrenceCount": {
            "type": "object",
            "description": "Number of recurrence cycles"
          },
          "notifications": {
            "description": "Notification channels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowCoupons": {
            "type": "boolean",
            "description": "Allow coupons"
          },
          "expiresAt": {
            "type": "object",
            "description": "Expiration date"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "projectId",
          "name",
          "currency",
          "status",
          "slug",
          "paymentsCount",
          "totalCollected",
          "paymentType",
          "paymentMethods",
          "maxInstallments",
          "notifications",
          "allowCoupons",
          "createdAt"
        ]
      },
      "GetAllPaymentLinksOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of payment links",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetPaymentLinkOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdatePaymentLinkInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "clientId": {
            "type": "object",
            "description": "Client ID (for pre-assigned links)"
          },
          "name": {
            "type": "string",
            "description": "Payment link name",
            "example": "Premium Subscription"
          },
          "description": {
            "type": "object",
            "description": "Payment link description"
          },
          "amount": {
            "type": "object",
            "description": "Amount in cents (null for open amount)"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "status": {
            "type": "string",
            "description": "Payment link status",
            "enum": ["active", "expired", "disabled", "paid"]
          },
          "slug": {
            "type": "string",
            "description": "Unique URL slug",
            "example": "premium-2024"
          },
          "paymentType": {
            "type": "string",
            "description": "Payment type",
            "enum": ["one_time", "subscription"]
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "example": ["pix", "credit_card"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxInstallments": {
            "type": "number",
            "description": "Maximum number of installments"
          },
          "recurrenceInterval": {
            "type": "string",
            "description": "Recurrence interval (for subscriptions)",
            "enum": [
              "daily",
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "semiannual",
              "yearly"
            ]
          },
          "recurrenceCount": {
            "type": "object",
            "description": "Number of recurrence cycles"
          },
          "notifications": {
            "description": "Notification channels",
            "example": ["email", "whatsapp"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowCoupons": {
            "type": "boolean",
            "description": "Allow coupon codes"
          },
          "expiresAt": {
            "type": "object",
            "description": "Link expiration date"
          }
        }
      },
      "PublicCompanyInfoOutput": {
        "type": "object",
        "properties": {
          "razaoSocial": {
            "type": "string",
            "description": "Company legal name (Razão Social)"
          },
          "nomeFantasia": {
            "type": "object",
            "description": "Trade name (Nome Fantasia)"
          },
          "cnpj": {
            "type": "string",
            "description": "Company CNPJ"
          },
          "email": {
            "type": "string",
            "description": "Company email"
          },
          "phone": {
            "type": "string",
            "description": "Company phone"
          }
        },
        "required": ["razaoSocial", "cnpj", "email", "phone"]
      },
      "PublicProjectOutput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name"
          },
          "description": {
            "type": "object",
            "description": "Project description"
          },
          "color": {
            "type": "string",
            "description": "Project color"
          },
          "logoUrl": {
            "type": "object",
            "description": "Project logo URL"
          }
        },
        "required": ["name", "color"]
      },
      "GetPublicPaymentLinkOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Payment link ID"
          },
          "name": {
            "type": "string",
            "description": "Payment link name"
          },
          "status": {
            "type": "string",
            "description": "Payment link status",
            "enum": ["active", "expired", "disabled", "paid"]
          },
          "description": {
            "type": "object",
            "description": "Description"
          },
          "amount": {
            "type": "object",
            "description": "Amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "paymentType": {
            "type": "string",
            "description": "Payment type",
            "enum": ["one_time", "subscription"]
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxInstallments": {
            "type": "number",
            "description": "Maximum installments"
          },
          "allowCoupons": {
            "type": "boolean",
            "description": "Allow coupons"
          },
          "hasClient": {
            "type": "boolean",
            "description": "Whether a client is already associated with this payment link"
          },
          "clientId": {
            "type": "object",
            "description": "Client ID if already associated"
          },
          "expiresAt": {
            "type": "object",
            "description": "Expiration date"
          },
          "company": {
            "description": "Company information",
            "allOf": [
              {
                "$ref": "#/components/schemas/PublicCompanyInfoOutput"
              }
            ]
          },
          "project": {
            "description": "Project information",
            "allOf": [
              {
                "$ref": "#/components/schemas/PublicProjectOutput"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "currency",
          "paymentType",
          "paymentMethods",
          "maxInstallments",
          "allowCoupons",
          "hasClient",
          "company",
          "project"
        ]
      },
      "CreatePaymentLinkClientAddressInput": {
        "type": "object",
        "properties": {
          "zipCode": {
            "type": "string",
            "description": "ZIP code (CEP)",
            "example": "01234567",
            "minLength": 8,
            "maxLength": 8
          },
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "Rua das Flores",
            "maxLength": 255
          },
          "number": {
            "type": "string",
            "description": "Street number",
            "example": "123",
            "maxLength": 20
          },
          "complement": {
            "type": "string",
            "description": "Address complement (apartment, suite, etc.)",
            "example": "Apt 101",
            "maxLength": 100
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood",
            "example": "Centro",
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "description": "City name",
            "example": "São Paulo",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "description": "State code (UF)",
            "example": "SP",
            "minLength": 2,
            "maxLength": 2
          }
        },
        "required": [
          "zipCode",
          "street",
          "number",
          "neighborhood",
          "city",
          "state"
        ]
      },
      "CreatePaymentLinkClientInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Client name",
            "example": "João Silva",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "Client email",
            "example": "joao@email.com",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number",
            "example": "11999999999",
            "maxLength": 20
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"],
            "example": "cpf"
          },
          "document": {
            "type": "string",
            "description": "Document number (CPF or CNPJ)",
            "example": "12345678901",
            "maxLength": 14
          },
          "address": {
            "description": "Billing address",
            "allOf": [
              {
                "$ref": "#/components/schemas/CreatePaymentLinkClientAddressInput"
              }
            ]
          }
        },
        "required": [
          "name",
          "email",
          "phone",
          "documentType",
          "document",
          "address"
        ]
      },
      "CreatePaymentLinkClientOutput": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "Created client ID",
            "format": "uuid"
          },
          "paymentLinkId": {
            "type": "string",
            "description": "Payment link ID",
            "format": "uuid"
          }
        },
        "required": ["clientId", "paymentLinkId"]
      },
      "CreatePaymentLinkPixInput": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "Client ID making the payment",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents (optional, uses payment link amount if not provided)",
            "example": 10000,
            "minimum": 100
          }
        },
        "required": ["clientId"]
      },
      "CreatePaymentLinkPixOutput": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "Transaction ID in our system",
            "format": "uuid",
            "example": "770e8400-e29b-41d4-a716-446655440002"
          },
          "pixCopyPaste": {
            "type": "string",
            "description": "PIX copia-cola code for QR generation",
            "example": "00020126580014br.gov.bcb.pix..."
          },
          "expiresAt": {
            "type": "string",
            "description": "PIX expiration date",
            "example": "2024-01-15T23:59:59.000Z"
          }
        },
        "required": ["transactionId", "pixCopyPaste", "expiresAt"]
      },
      "GetTransactionStatusOutput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Transaction status",
            "enum": ["pending", "completed", "failed", "cancelled"],
            "example": "pending"
          },
          "completedAt": {
            "type": "string",
            "description": "Date when transaction was completed (if applicable)",
            "example": "2024-01-15T14:30:00.000Z"
          }
        },
        "required": ["status"]
      },
      "GetCompanyInfoOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Company info ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "addressId": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "razaoSocial": {
            "type": "string",
            "description": "Company legal name (Razao Social)"
          },
          "nomeFantasia": {
            "type": "string",
            "description": "Company trade name (Nome Fantasia)"
          },
          "cnpj": {
            "type": "string",
            "description": "Company CNPJ"
          },
          "email": {
            "type": "string",
            "description": "Company email address"
          },
          "phone": {
            "type": "string",
            "description": "Company phone number"
          },
          "status": {
            "type": "string",
            "description": "Company status",
            "enum": ["pending", "active", "suspended", "blocked"]
          },
          "statusUpdatedAt": {
            "type": "string",
            "description": "Status last updated timestamp",
            "format": "date-time"
          },
          "statusMessage": {
            "type": "string",
            "description": "Status change message"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "addressId",
          "razaoSocial",
          "cnpj",
          "email",
          "phone",
          "status",
          "statusUpdatedAt",
          "createdAt"
        ]
      },
      "UpsertCompanyInfoInput": {
        "type": "object",
        "properties": {
          "addressId": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "razaoSocial": {
            "type": "string",
            "description": "Company legal name (Razao Social)",
            "maxLength": 255
          },
          "nomeFantasia": {
            "type": "string",
            "description": "Company trade name (Nome Fantasia)",
            "maxLength": 255
          },
          "cnpj": {
            "type": "string",
            "description": "Company CNPJ (14 digits)",
            "maxLength": 14
          },
          "email": {
            "type": "string",
            "description": "Company email address",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Company phone number",
            "maxLength": 20
          },
          "status": {
            "type": "string",
            "description": "Company status",
            "enum": ["pending", "approved", "rejected", "suspended"]
          },
          "statusMessage": {
            "type": "string",
            "description": "Status change message"
          }
        },
        "required": ["addressId", "razaoSocial", "cnpj", "email", "phone"]
      },
      "CreateProjectInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do projeto",
            "maxLength": 255,
            "example": "Minha Loja"
          },
          "description": {
            "type": "string",
            "description": "Descrição do projeto",
            "example": "Loja virtual de eletrônicos"
          },
          "color": {
            "type": "string",
            "description": "Cor do projeto em formato hexadecimal",
            "pattern": "^#[0-9A-Fa-f]{6}$",
            "example": "#3B82F6"
          },
          "logoUrl": {
            "type": "string",
            "description": "URL do logo do projeto",
            "format": "uri",
            "example": "https://example.com/logo.png"
          }
        },
        "required": ["name", "color"]
      },
      "CreateProjectOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID do projeto",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Nome do projeto",
            "example": "Minha Loja"
          },
          "description": {
            "type": "string",
            "description": "Descrição do projeto",
            "example": "Loja virtual de eletrônicos"
          },
          "color": {
            "type": "string",
            "description": "Cor do projeto em formato hexadecimal",
            "example": "#3B82F6"
          },
          "logoUrl": {
            "type": "string",
            "description": "URL do logo do projeto",
            "format": "uri",
            "example": "https://example.com/logo.png"
          },
          "createdAt": {
            "type": "string",
            "description": "Data de criação",
            "format": "date-time"
          }
        },
        "required": ["id", "name", "color", "createdAt"]
      },
      "ProjectListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Project name"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex format)"
          },
          "defaultCurrency": {
            "type": "string",
            "description": "Default currency (ISO 4217)"
          },
          "description": {
            "type": "string",
            "description": "Project description"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "color",
          "defaultCurrency",
          "createdAt"
        ]
      },
      "GetAllProjectsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "Lista de projetos",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateProjectOutput"
            }
          },
          "total": {
            "type": "integer",
            "description": "Número total de projetos",
            "example": 100
          },
          "page": {
            "type": "integer",
            "description": "Página atual",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "description": "Itens por página",
            "example": 20
          },
          "totalPages": {
            "type": "integer",
            "description": "Número total de páginas",
            "example": 5
          }
        },
        "required": ["items", "total", "page", "limit", "totalPages"]
      },
      "GetProjectOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID do projeto",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Nome do projeto",
            "example": "Minha Loja"
          },
          "description": {
            "type": "string",
            "description": "Descrição do projeto",
            "example": "Loja virtual de eletrônicos"
          },
          "color": {
            "type": "string",
            "description": "Cor do projeto em formato hexadecimal",
            "example": "#3B82F6"
          },
          "logoUrl": {
            "type": "string",
            "description": "URL do logo do projeto",
            "format": "uri",
            "example": "https://example.com/logo.png"
          },
          "createdAt": {
            "type": "string",
            "description": "Data de criação",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Data de atualização",
            "format": "date-time"
          }
        },
        "required": ["id", "name", "color", "createdAt"]
      },
      "UpdateProjectInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "description": "Project description"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex format)",
            "example": "#3498db"
          },
          "logoUrl": {
            "type": "string",
            "description": "Project logo URL"
          },
          "defaultCurrency": {
            "type": "string",
            "description": "Default currency (ISO 4217)",
            "maxLength": 3
          }
        }
      },
      "CreateClientInput": {
        "type": "object",
        "properties": {
          "addressId": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "Client email",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number",
            "maxLength": 20
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "document": {
            "type": "string",
            "description": "Document number (CPF or CNPJ)",
            "maxLength": 14
          }
        },
        "required": ["name", "email", "phone", "documentType", "document"]
      },
      "CreateClientOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "addressId": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name"
          },
          "email": {
            "type": "string",
            "description": "Client email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number"
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "document": {
            "type": "string",
            "description": "Document number (masked)"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "email",
          "phone",
          "documentType",
          "document",
          "createdAt"
        ]
      },
      "ClientProjectItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Project name"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex)"
          }
        },
        "required": ["id", "name", "color"]
      },
      "ClientListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name"
          },
          "email": {
            "type": "string",
            "description": "Client email"
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "totalTransactions": {
            "type": "number",
            "description": "Total number of transactions"
          },
          "totalSpent": {
            "type": "number",
            "description": "Total amount spent (in cents)"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "projects": {
            "description": "Projects associated with the client",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientProjectItem"
            }
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "email",
          "documentType",
          "totalTransactions",
          "totalSpent",
          "createdAt",
          "projects"
        ]
      },
      "GetAllClientsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of clients",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientListItem"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "GetClientOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "addressId": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name"
          },
          "email": {
            "type": "string",
            "description": "Client email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number"
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "document": {
            "type": "string",
            "description": "Document number (masked)"
          },
          "totalTransactions": {
            "type": "number",
            "description": "Total number of transactions"
          },
          "totalSpent": {
            "type": "number",
            "description": "Total amount spent (in cents)"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "email",
          "phone",
          "documentType",
          "document",
          "totalTransactions",
          "totalSpent",
          "createdAt"
        ]
      },
      "UpdateClientInput": {
        "type": "object",
        "properties": {
          "addressId": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "Client email",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number",
            "maxLength": 20
          }
        }
      },
      "LinkClientProjectInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID to link",
            "format": "uuid"
          }
        },
        "required": ["projectId"]
      },
      "ClientProjectOutput": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "description": "Link creation timestamp",
            "format": "date-time"
          }
        },
        "required": ["clientId", "projectId", "createdAt"]
      },
      "ClientProjectsListOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of client-project links",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientProjectOutput"
            }
          }
        },
        "required": ["items"]
      },
      "CreateAddressInput": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "Rua das Flores",
            "maxLength": 255
          },
          "number": {
            "type": "string",
            "description": "Street number",
            "example": "123",
            "maxLength": 20
          },
          "complement": {
            "type": "string",
            "description": "Address complement (apartment, suite, etc.)",
            "example": "Apt 101",
            "maxLength": 100
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood",
            "example": "Centro",
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "description": "City name",
            "example": "São Paulo",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "description": "State code (UF)",
            "example": "SP",
            "minLength": 2,
            "maxLength": 2
          },
          "zipCode": {
            "type": "string",
            "description": "ZIP code (CEP)",
            "example": "01234567",
            "minLength": 8,
            "maxLength": 8
          },
          "country": {
            "type": "string",
            "description": "Country code (ISO 3166-1 alpha-2)",
            "example": "BR",
            "default": "BR",
            "minLength": 2,
            "maxLength": 2
          }
        },
        "required": [
          "street",
          "number",
          "neighborhood",
          "city",
          "state",
          "zipCode"
        ]
      },
      "CreateAddressOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "street": {
            "type": "string",
            "example": "Rua das Flores"
          },
          "number": {
            "type": "string",
            "example": "123"
          },
          "complement": {
            "type": "string",
            "example": "Apt 101"
          },
          "neighborhood": {
            "type": "string",
            "example": "Centro"
          },
          "city": {
            "type": "string",
            "example": "São Paulo"
          },
          "state": {
            "type": "string",
            "example": "SP"
          },
          "zipCode": {
            "type": "string",
            "example": "01234567"
          },
          "country": {
            "type": "string",
            "example": "BR"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": [
          "id",
          "street",
          "number",
          "neighborhood",
          "city",
          "state",
          "zipCode",
          "country",
          "createdAt"
        ]
      },
      "AddressItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "street": {
            "type": "string",
            "example": "Rua das Flores"
          },
          "number": {
            "type": "string",
            "example": "123"
          },
          "complement": {
            "type": "string",
            "example": "Apt 101"
          },
          "neighborhood": {
            "type": "string",
            "example": "Centro"
          },
          "city": {
            "type": "string",
            "example": "São Paulo"
          },
          "state": {
            "type": "string",
            "example": "SP"
          },
          "zipCode": {
            "type": "string",
            "example": "01234567"
          },
          "country": {
            "type": "string",
            "example": "BR"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": [
          "id",
          "street",
          "number",
          "neighborhood",
          "city",
          "state",
          "zipCode",
          "country",
          "createdAt"
        ]
      },
      "GetAllAddressesOutput": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressItem"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": ["items", "meta"]
      },
      "GetAddressOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "street": {
            "type": "string",
            "example": "Rua das Flores"
          },
          "number": {
            "type": "string",
            "example": "123"
          },
          "complement": {
            "type": "string",
            "example": "Apt 101"
          },
          "neighborhood": {
            "type": "string",
            "example": "Centro"
          },
          "city": {
            "type": "string",
            "example": "São Paulo"
          },
          "state": {
            "type": "string",
            "example": "SP"
          },
          "zipCode": {
            "type": "string",
            "example": "01234567"
          },
          "country": {
            "type": "string",
            "example": "BR"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": [
          "id",
          "street",
          "number",
          "neighborhood",
          "city",
          "state",
          "zipCode",
          "country",
          "createdAt"
        ]
      },
      "UpdateAddressInput": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "Rua das Flores",
            "maxLength": 255
          },
          "number": {
            "type": "string",
            "description": "Street number",
            "example": "123",
            "maxLength": 20
          },
          "complement": {
            "type": "string",
            "description": "Address complement (apartment, suite, etc.)",
            "example": "Apt 101",
            "maxLength": 100
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood",
            "example": "Centro",
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "description": "City name",
            "example": "São Paulo",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "description": "State code (UF)",
            "example": "SP",
            "minLength": 2,
            "maxLength": 2
          },
          "zipCode": {
            "type": "string",
            "description": "ZIP code (CEP)",
            "example": "01234567",
            "minLength": 8,
            "maxLength": 8
          },
          "country": {
            "type": "string",
            "description": "Country code (ISO 3166-1 alpha-2)",
            "example": "BR",
            "minLength": 2,
            "maxLength": 2
          }
        }
      },
      "LineItemInput": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Item description"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price in cents"
          },
          "total": {
            "type": "number",
            "description": "Total in cents"
          }
        },
        "required": ["description", "quantity", "unitPrice", "total"]
      },
      "CreateInvoiceInput": {
        "type": "object",
        "properties": {
          "subscriptionId": {
            "type": "string",
            "description": "Subscription ID"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "paymentLinkId": {
            "type": "string",
            "description": "Payment link ID"
          },
          "invoiceNumber": {
            "type": "string",
            "description": "Invoice number",
            "example": "INV-2024-001"
          },
          "amount": {
            "type": "number",
            "description": "Total amount in cents"
          },
          "discountAmount": {
            "type": "number",
            "description": "Discount amount in cents",
            "default": 0
          },
          "finalAmount": {
            "type": "number",
            "description": "Final amount after discounts in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "default": "BRL"
          },
          "status": {
            "type": "string",
            "description": "Invoice status",
            "enum": [
              "draft",
              "pending",
              "paid",
              "overdue",
              "cancelled",
              "refunded"
            ],
            "default": "pending"
          },
          "dueDate": {
            "type": "string",
            "description": "Due date"
          },
          "couponId": {
            "type": "string",
            "description": "Coupon ID"
          },
          "billingPeriodStart": {
            "type": "string",
            "description": "Billing period start"
          },
          "billingPeriodEnd": {
            "type": "string",
            "description": "Billing period end"
          },
          "lineItems": {
            "description": "Line items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineItemInput"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata"
          }
        },
        "required": [
          "clientId",
          "projectId",
          "invoiceNumber",
          "amount",
          "finalAmount",
          "dueDate",
          "lineItems"
        ]
      },
      "LineItemOutput": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unitPrice": {
            "type": "number"
          },
          "total": {
            "type": "number"
          }
        },
        "required": ["description", "quantity", "unitPrice", "total"]
      },
      "GetInvoiceOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Invoice ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "subscriptionId": {
            "type": "object",
            "description": "Subscription ID"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "paymentLinkId": {
            "type": "object",
            "description": "Payment link ID"
          },
          "invoiceNumber": {
            "type": "string",
            "description": "Invoice number"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents"
          },
          "discountAmount": {
            "type": "number",
            "description": "Discount amount in cents"
          },
          "finalAmount": {
            "type": "number",
            "description": "Final amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "status": {
            "type": "string",
            "description": "Status"
          },
          "dueDate": {
            "type": "string",
            "description": "Due date"
          },
          "paidAt": {
            "type": "object",
            "description": "Payment date"
          },
          "cancelledAt": {
            "type": "object",
            "description": "Cancellation date"
          },
          "couponId": {
            "type": "object",
            "description": "Coupon ID"
          },
          "billingPeriodStart": {
            "type": "object",
            "description": "Billing period start"
          },
          "billingPeriodEnd": {
            "type": "object",
            "description": "Billing period end"
          },
          "lineItems": {
            "description": "Line items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineItemOutput"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Metadata"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "clientId",
          "projectId",
          "invoiceNumber",
          "amount",
          "discountAmount",
          "finalAmount",
          "currency",
          "status",
          "dueDate",
          "lineItems",
          "createdAt"
        ]
      },
      "GetAllInvoicesOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of invoices",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetInvoiceOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateInvoiceInput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Invoice status",
            "enum": [
              "draft",
              "pending",
              "paid",
              "overdue",
              "cancelled",
              "refunded"
            ]
          },
          "dueDate": {
            "type": "string",
            "description": "Due date"
          },
          "lineItems": {
            "description": "Line items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineItemInput"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata"
          }
        }
      },
      "CreateExampleInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the example",
            "example": "My Example",
            "minLength": 2,
            "maxLength": 100
          }
        },
        "required": ["name"]
      },
      "CreateExampleOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "name": {
            "type": "string",
            "example": "My Example"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": ["id", "name", "createdAt"]
      },
      "ExampleItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "name": {
            "type": "string",
            "example": "My Example"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": ["id", "name", "createdAt"]
      },
      "GetAllExamplesOutput": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExampleItem"
            }
          },
          "total": {
            "type": "number",
            "example": 1
          }
        },
        "required": ["items", "total"]
      },
      "GetExampleOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "name": {
            "type": "string",
            "example": "My Example"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          }
        },
        "required": ["id", "name", "createdAt", "updatedAt"]
      },
      "CreateAccountUserInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "User full name",
            "maxLength": 255
          },
          "password": {
            "type": "string",
            "description": "User password",
            "minLength": 8
          },
          "email": {
            "type": "string",
            "description": "User email address",
            "format": "email"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"],
            "default": "member"
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active", "suspended"],
            "default": "pending"
          },
          "avatarUrl": {
            "type": "string",
            "description": "User avatar URL"
          },
          "twoFactorEnabled": {
            "type": "boolean",
            "description": "Whether two-factor authentication is enabled",
            "default": false
          }
        },
        "required": ["name", "password", "email"]
      },
      "CreateAccountUserOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account user ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "keycloakId": {
            "type": "string",
            "description": "Keycloak user ID"
          },
          "name": {
            "type": "string",
            "description": "User full name"
          },
          "email": {
            "type": "string",
            "description": "User email address"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"]
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active", "suspended"]
          },
          "avatarUrl": {
            "type": "string",
            "description": "User avatar URL"
          },
          "twoFactorEnabled": {
            "type": "boolean",
            "description": "Whether two-factor authentication is enabled"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "email",
          "role",
          "status",
          "twoFactorEnabled",
          "createdAt"
        ]
      },
      "AccountUserListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account user ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "User full name"
          },
          "email": {
            "type": "string",
            "description": "User email address"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"]
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active", "suspended"]
          },
          "twoFactorEnabled": {
            "type": "boolean",
            "description": "Whether two-factor authentication is enabled"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "email",
          "role",
          "status",
          "twoFactorEnabled",
          "createdAt"
        ]
      },
      "GetAllAccountUsersOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of account users",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountUserListItem"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "GetAccountUserOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account user ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "keycloakId": {
            "type": "string",
            "description": "Keycloak user ID"
          },
          "name": {
            "type": "string",
            "description": "User full name"
          },
          "email": {
            "type": "string",
            "description": "User email address"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"]
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active", "suspended"]
          },
          "avatarUrl": {
            "type": "string",
            "description": "User avatar URL"
          },
          "twoFactorEnabled": {
            "type": "boolean",
            "description": "Whether two-factor authentication is enabled"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": "string",
            "description": "Last login timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "email",
          "role",
          "status",
          "twoFactorEnabled",
          "createdAt"
        ]
      },
      "UpdateAccountUserInput": {
        "type": "object",
        "properties": {
          "keycloakId": {
            "type": "string",
            "description": "Keycloak user ID"
          },
          "name": {
            "type": "string",
            "description": "User full name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "User email address",
            "format": "email"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"]
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active", "suspended"]
          },
          "avatarUrl": {
            "type": "string",
            "description": "User avatar URL"
          },
          "twoFactorEnabled": {
            "type": "boolean",
            "description": "Whether two-factor authentication is enabled"
          }
        }
      },
      "GetIntegrationKeysOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Integration keys ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "productionKeyPrefix": {
            "type": "string",
            "description": "Production API key prefix (visible part)"
          },
          "sandboxKeyPrefix": {
            "type": "string",
            "description": "Sandbox API key prefix (visible part)"
          },
          "productionKeyLastUsedAt": {
            "type": "string",
            "description": "Last time production key was used",
            "format": "date-time"
          },
          "sandboxKeyLastUsedAt": {
            "type": "string",
            "description": "Last time sandbox key was used",
            "format": "date-time"
          },
          "version": {
            "type": "number",
            "description": "Key version number"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "productionKeyPrefix",
          "sandboxKeyPrefix",
          "version",
          "createdAt"
        ]
      },
      "RegenerateKeysInput": {
        "type": "object",
        "properties": {
          "keyType": {
            "type": "string",
            "description": "Which key to regenerate (production, sandbox, or both)",
            "enum": ["production", "sandbox", "both"],
            "default": "both"
          }
        }
      },
      "RegenerateKeysOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Integration keys ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "productionKey": {
            "type": "string",
            "description": "New production API key (only shown once)"
          },
          "sandboxKey": {
            "type": "string",
            "description": "New sandbox API key (only shown once)"
          },
          "version": {
            "type": "number",
            "description": "Key version number"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "productionKey",
          "sandboxKey",
          "version",
          "createdAt"
        ]
      },
      "GetCustomizationOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Customization ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "logoUrl": {
            "type": "string",
            "description": "Logo URL"
          },
          "faviconUrl": {
            "type": "string",
            "description": "Favicon URL"
          },
          "primaryColor": {
            "type": "string",
            "description": "Primary brand color (hex format)"
          },
          "secondaryColor": {
            "type": "string",
            "description": "Secondary brand color (hex format)"
          },
          "checkoutTitle": {
            "type": "string",
            "description": "Custom checkout page title"
          },
          "checkoutMessage": {
            "type": "string",
            "description": "Custom checkout page message"
          },
          "successTitle": {
            "type": "string",
            "description": "Custom success page title"
          },
          "successMessage": {
            "type": "string",
            "description": "Custom success page message"
          },
          "supportEmail": {
            "type": "string",
            "description": "Support email address"
          },
          "supportPhone": {
            "type": "string",
            "description": "Support phone number"
          },
          "termsUrl": {
            "type": "string",
            "description": "Terms of service URL"
          },
          "privacyUrl": {
            "type": "string",
            "description": "Privacy policy URL"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": ["id", "accountId", "primaryColor", "createdAt"]
      },
      "UpsertCustomizationInput": {
        "type": "object",
        "properties": {
          "logoUrl": {
            "type": "string",
            "description": "Logo URL"
          },
          "faviconUrl": {
            "type": "string",
            "description": "Favicon URL"
          },
          "primaryColor": {
            "type": "string",
            "description": "Primary brand color (hex format)",
            "example": "#000000"
          },
          "secondaryColor": {
            "type": "string",
            "description": "Secondary brand color (hex format)",
            "example": "#ffffff"
          },
          "checkoutTitle": {
            "type": "string",
            "description": "Custom checkout page title",
            "maxLength": 255
          },
          "checkoutMessage": {
            "type": "string",
            "description": "Custom checkout page message"
          },
          "successTitle": {
            "type": "string",
            "description": "Custom success page title",
            "maxLength": 255
          },
          "successMessage": {
            "type": "string",
            "description": "Custom success page message"
          },
          "supportEmail": {
            "type": "string",
            "description": "Support email address"
          },
          "supportPhone": {
            "type": "string",
            "description": "Support phone number",
            "maxLength": 20
          },
          "termsUrl": {
            "type": "string",
            "description": "Terms of service URL"
          },
          "privacyUrl": {
            "type": "string",
            "description": "Privacy policy URL"
          }
        }
      },
      "CreateCompanyDocumentInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Document name",
            "maxLength": 255
          },
          "type": {
            "type": "string",
            "description": "Document type",
            "enum": [
              "contract",
              "address_proof",
              "partner_id",
              "tax_certificate",
              "other"
            ]
          },
          "fileUrl": {
            "type": "string",
            "description": "File URL"
          },
          "fileHash": {
            "type": "string",
            "description": "File hash for integrity verification",
            "maxLength": 64
          }
        },
        "required": ["name", "type", "fileUrl"]
      },
      "CreateCompanyDocumentOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Document ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Document name"
          },
          "type": {
            "type": "string",
            "description": "Document type",
            "enum": [
              "social_contract",
              "proof_of_address",
              "identity_document",
              "other"
            ]
          },
          "fileUrl": {
            "type": "string",
            "description": "File URL"
          },
          "fileHash": {
            "type": "string",
            "description": "File hash"
          },
          "status": {
            "type": "string",
            "description": "Document status",
            "enum": ["pending", "approved", "rejected"]
          },
          "uploadedAt": {
            "type": "string",
            "description": "Upload timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "type",
          "fileUrl",
          "status",
          "uploadedAt"
        ]
      },
      "CompanyDocumentListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Document ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Document name"
          },
          "type": {
            "type": "string",
            "description": "Document type",
            "enum": [
              "social_contract",
              "proof_of_address",
              "identity_document",
              "other"
            ]
          },
          "status": {
            "type": "string",
            "description": "Document status",
            "enum": ["pending", "approved", "rejected"]
          },
          "uploadedAt": {
            "type": "string",
            "description": "Upload timestamp",
            "format": "date-time"
          }
        },
        "required": ["id", "accountId", "name", "type", "status", "uploadedAt"]
      },
      "GetAllCompanyDocumentsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of company documents",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyDocumentListItem"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "GetCompanyDocumentOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Document ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Document name"
          },
          "type": {
            "type": "string",
            "description": "Document type",
            "enum": [
              "social_contract",
              "proof_of_address",
              "identity_document",
              "other"
            ]
          },
          "fileUrl": {
            "type": "string",
            "description": "File URL"
          },
          "fileHash": {
            "type": "string",
            "description": "File hash"
          },
          "status": {
            "type": "string",
            "description": "Document status",
            "enum": ["pending", "approved", "rejected"]
          },
          "uploadedAt": {
            "type": "string",
            "description": "Upload timestamp",
            "format": "date-time"
          },
          "reviewedAt": {
            "type": "string",
            "description": "Review timestamp",
            "format": "date-time"
          },
          "reviewedBy": {
            "type": "string",
            "description": "Reviewer user ID",
            "format": "uuid"
          },
          "rejectionReason": {
            "type": "string",
            "description": "Rejection reason (if rejected)"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "type",
          "fileUrl",
          "status",
          "uploadedAt"
        ]
      },
      "UpdateCompanyDocumentInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Document name",
            "maxLength": 255
          },
          "fileUrl": {
            "type": "string",
            "description": "File URL"
          },
          "fileHash": {
            "type": "string",
            "description": "File hash for integrity verification",
            "maxLength": 64
          }
        }
      },
      "CreateCouponInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID to scope the coupon"
          },
          "code": {
            "type": "string",
            "description": "Unique coupon code",
            "example": "SUMMER20"
          },
          "description": {
            "type": "string",
            "description": "Coupon description"
          },
          "type": {
            "type": "string",
            "description": "Discount type",
            "enum": ["percentage", "fixed_amount"]
          },
          "value": {
            "type": "number",
            "description": "Discount value (percentage or amount in cents)",
            "example": 20
          },
          "minAmount": {
            "type": "number",
            "description": "Minimum order amount in cents to apply coupon"
          },
          "maxDiscount": {
            "type": "number",
            "description": "Maximum discount amount in cents (for percentage coupons)"
          },
          "usageLimit": {
            "type": "number",
            "description": "Maximum total uses for this coupon"
          },
          "perClientLimit": {
            "type": "number",
            "description": "Maximum uses per client",
            "default": 1
          },
          "status": {
            "type": "string",
            "description": "Coupon status",
            "enum": ["active", "expired", "depleted", "disabled"],
            "default": "active"
          },
          "validFrom": {
            "type": "string",
            "description": "Start date for coupon validity"
          },
          "validUntil": {
            "type": "string",
            "description": "End date for coupon validity"
          }
        },
        "required": ["code", "type", "value", "validFrom"]
      },
      "GetCouponOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Coupon ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "projectId": {
            "type": "object",
            "description": "Project ID"
          },
          "code": {
            "type": "string",
            "description": "Coupon code"
          },
          "description": {
            "type": "object",
            "description": "Coupon description"
          },
          "type": {
            "type": "string",
            "description": "Discount type",
            "enum": ["percentage", "fixed_amount"]
          },
          "value": {
            "type": "number",
            "description": "Discount value"
          },
          "minAmount": {
            "type": "object",
            "description": "Minimum order amount in cents"
          },
          "maxDiscount": {
            "type": "object",
            "description": "Maximum discount amount in cents"
          },
          "usageLimit": {
            "type": "object",
            "description": "Maximum total uses"
          },
          "usageCount": {
            "type": "number",
            "description": "Current usage count"
          },
          "perClientLimit": {
            "type": "object",
            "description": "Maximum uses per client"
          },
          "status": {
            "type": "string",
            "description": "Coupon status",
            "enum": ["active", "expired", "depleted", "disabled"]
          },
          "validFrom": {
            "type": "string",
            "description": "Validity start date"
          },
          "validUntil": {
            "type": "object",
            "description": "Validity end date"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "code",
          "type",
          "value",
          "usageCount",
          "status",
          "validFrom",
          "createdAt"
        ]
      },
      "GetAllCouponsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of coupons",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetCouponOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateCouponInput": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "object",
            "description": "Project ID to scope the coupon"
          },
          "code": {
            "type": "string",
            "description": "Unique coupon code",
            "example": "SUMMER20"
          },
          "description": {
            "type": "object",
            "description": "Coupon description"
          },
          "type": {
            "type": "string",
            "description": "Discount type",
            "enum": ["percentage", "fixed_amount"]
          },
          "value": {
            "type": "number",
            "description": "Discount value (percentage or amount in cents)",
            "example": 20
          },
          "minAmount": {
            "type": "object",
            "description": "Minimum order amount in cents to apply coupon"
          },
          "maxDiscount": {
            "type": "object",
            "description": "Maximum discount amount in cents (for percentage coupons)"
          },
          "usageLimit": {
            "type": "object",
            "description": "Maximum total uses for this coupon"
          },
          "perClientLimit": {
            "type": "object",
            "description": "Maximum uses per client",
            "default": 1
          },
          "status": {
            "type": "string",
            "description": "Coupon status",
            "enum": ["active", "expired", "depleted", "disabled"]
          },
          "validFrom": {
            "type": "string",
            "description": "Start date for coupon validity"
          },
          "validUntil": {
            "type": "object",
            "description": "End date for coupon validity"
          }
        }
      },
      "CreateBankAccountInput": {
        "type": "object",
        "properties": {
          "accountMode": {
            "type": "string",
            "description": "Account mode: PIX or traditional bank account",
            "enum": ["pix", "traditional"]
          },
          "bankName": {
            "type": "string",
            "description": "Bank name (required for traditional)",
            "example": "Banco do Brasil"
          },
          "bankCode": {
            "type": "string",
            "description": "Bank code (COMPE) (required for traditional)",
            "example": "001"
          },
          "agency": {
            "type": "string",
            "description": "Agency number (required for traditional)",
            "example": "1234"
          },
          "agencyDigit": {
            "type": "string",
            "description": "Agency check digit",
            "example": "5"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number (required for traditional)",
            "example": "12345678"
          },
          "accountDigit": {
            "type": "string",
            "description": "Account check digit (required for traditional)",
            "example": "9"
          },
          "type": {
            "type": "string",
            "description": "Account type (required for traditional)",
            "enum": ["checking", "savings"]
          },
          "pixKey": {
            "type": "string",
            "description": "PIX key (required for pix mode)",
            "example": "12345678901"
          },
          "pixKeyType": {
            "type": "string",
            "description": "PIX key type (required for pix mode)",
            "enum": ["cpf", "cnpj", "email", "phone", "random"]
          },
          "isDefault": {
            "type": "boolean",
            "description": "Set as default bank account",
            "default": false
          },
          "holderName": {
            "type": "string",
            "description": "Account holder name",
            "example": "John Doe"
          },
          "holderDocument": {
            "type": "string",
            "description": "Account holder document (CPF/CNPJ)",
            "example": "12345678901"
          },
          "holderDocumentType": {
            "type": "string",
            "description": "Holder document type",
            "enum": ["cpf", "cnpj"]
          }
        },
        "required": [
          "accountMode",
          "holderName",
          "holderDocument",
          "holderDocumentType"
        ]
      },
      "GetBankAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Bank account ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "accountMode": {
            "type": "string",
            "description": "Account mode",
            "enum": ["pix", "traditional"]
          },
          "bankName": {
            "type": "object",
            "description": "Bank name"
          },
          "bankCode": {
            "type": "object",
            "description": "Bank code"
          },
          "agency": {
            "type": "object",
            "description": "Agency number"
          },
          "agencyDigit": {
            "type": "object",
            "description": "Agency check digit"
          },
          "accountNumber": {
            "type": "object",
            "description": "Account number (masked)"
          },
          "accountDigit": {
            "type": "object",
            "description": "Account check digit"
          },
          "type": {
            "type": "string",
            "description": "Account type",
            "enum": ["checking", "savings"]
          },
          "pixKey": {
            "type": "object",
            "description": "PIX key"
          },
          "pixKeyType": {
            "type": "string",
            "description": "PIX key type",
            "enum": ["cpf", "cnpj", "email", "phone", "random"]
          },
          "isDefault": {
            "type": "boolean",
            "description": "Is default bank account"
          },
          "holderName": {
            "type": "string",
            "description": "Account holder name"
          },
          "holderDocument": {
            "type": "string",
            "description": "Holder document (masked)"
          },
          "holderDocumentType": {
            "type": "string",
            "description": "Holder document type",
            "enum": ["cpf", "cnpj"]
          },
          "verifiedAt": {
            "type": "object",
            "description": "Verification timestamp"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "accountMode",
          "isDefault",
          "holderName",
          "holderDocument",
          "holderDocumentType",
          "createdAt"
        ]
      },
      "GetAllBankAccountsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of bank accounts",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetBankAccountOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateBankAccountInput": {
        "type": "object",
        "properties": {
          "bankName": {
            "type": "string",
            "description": "Bank name",
            "example": "Banco do Brasil"
          },
          "bankCode": {
            "type": "string",
            "description": "Bank code (COMPE)",
            "example": "001"
          },
          "agency": {
            "type": "string",
            "description": "Agency number",
            "example": "1234"
          },
          "agencyDigit": {
            "type": "object",
            "description": "Agency check digit",
            "example": "5"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number",
            "example": "12345678"
          },
          "accountDigit": {
            "type": "string",
            "description": "Account check digit",
            "example": "9"
          },
          "type": {
            "type": "string",
            "description": "Account type",
            "enum": ["checking", "savings"]
          },
          "isDefault": {
            "type": "boolean",
            "description": "Set as default bank account"
          },
          "holderName": {
            "type": "string",
            "description": "Account holder name",
            "example": "John Doe"
          },
          "holderDocument": {
            "type": "string",
            "description": "Account holder document (CPF/CNPJ)",
            "example": "12345678901"
          },
          "holderDocumentType": {
            "type": "string",
            "description": "Holder document type",
            "enum": ["cpf", "cnpj"]
          },
          "pixKey": {
            "type": "object",
            "description": "PIX key"
          },
          "pixKeyType": {
            "type": "object",
            "description": "PIX key type",
            "example": "cpf"
          }
        }
      },
      "CreateSubscriptionInput": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "paymentLinkId": {
            "type": "string",
            "description": "Payment link ID (if originated from a link)"
          },
          "planName": {
            "type": "string",
            "description": "Plan name",
            "example": "Premium Monthly"
          },
          "description": {
            "type": "string",
            "description": "Plan description"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents",
            "example": 9900
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "default": "BRL"
          },
          "cycle": {
            "type": "string",
            "description": "Billing cycle",
            "enum": [
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "semiannual",
              "yearly"
            ]
          },
          "status": {
            "type": "string",
            "description": "Subscription status",
            "enum": ["active", "cancelled", "paused", "past_due"],
            "default": "active"
          },
          "currentPeriodStart": {
            "type": "string",
            "description": "Current period start date"
          },
          "currentPeriodEnd": {
            "type": "string",
            "description": "Current period end date"
          },
          "nextBillingDate": {
            "type": "string",
            "description": "Next billing date"
          },
          "startDate": {
            "type": "string",
            "description": "Subscription start date"
          },
          "trialEndDate": {
            "type": "string",
            "description": "Trial end date"
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "example": ["pix", "credit_card"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recurrenceCount": {
            "type": "number",
            "description": "Number of cycles (null for indefinite)"
          },
          "notifications": {
            "description": "Notification channels",
            "example": ["email", "whatsapp"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxRetries": {
            "type": "number",
            "description": "Maximum payment retries",
            "default": 3
          }
        },
        "required": [
          "clientId",
          "planName",
          "amount",
          "cycle",
          "currentPeriodStart",
          "currentPeriodEnd",
          "nextBillingDate",
          "startDate",
          "paymentMethods",
          "notifications"
        ]
      },
      "GetSubscriptionOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Subscription ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "paymentLinkId": {
            "type": "object",
            "description": "Payment link ID"
          },
          "planName": {
            "type": "string",
            "description": "Plan name"
          },
          "description": {
            "type": "object",
            "description": "Description"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "cycle": {
            "type": "string",
            "description": "Billing cycle"
          },
          "status": {
            "type": "string",
            "description": "Status"
          },
          "currentPeriodStart": {
            "type": "string",
            "description": "Current period start"
          },
          "currentPeriodEnd": {
            "type": "string",
            "description": "Current period end"
          },
          "nextBillingDate": {
            "type": "string",
            "description": "Next billing date"
          },
          "startDate": {
            "type": "string",
            "description": "Start date"
          },
          "trialEndDate": {
            "type": "object",
            "description": "Trial end date"
          },
          "paymentMethods": {
            "description": "Payment methods",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recurrenceCount": {
            "type": "object",
            "description": "Total recurrence count"
          },
          "completedCycles": {
            "type": "number",
            "description": "Completed billing cycles"
          },
          "notifications": {
            "description": "Notification channels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retryCount": {
            "type": "number",
            "description": "Current retry count"
          },
          "maxRetries": {
            "type": "number",
            "description": "Maximum retries"
          },
          "pausedAt": {
            "type": "object",
            "description": "Paused at timestamp"
          },
          "cancelledAt": {
            "type": "object",
            "description": "Cancelled at timestamp"
          },
          "cancellationReason": {
            "type": "object",
            "description": "Cancellation reason"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "clientId",
          "projectId",
          "planName",
          "amount",
          "currency",
          "cycle",
          "status",
          "currentPeriodStart",
          "currentPeriodEnd",
          "nextBillingDate",
          "startDate",
          "paymentMethods",
          "completedCycles",
          "notifications",
          "retryCount",
          "maxRetries",
          "createdAt"
        ]
      },
      "GetAllSubscriptionsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of subscriptions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetSubscriptionOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "UpdateSubscriptionInput": {
        "type": "object",
        "properties": {
          "planName": {
            "type": "string",
            "description": "Plan name",
            "example": "Premium Monthly"
          },
          "description": {
            "type": "object",
            "description": "Plan description"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents",
            "example": 9900
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "cycle": {
            "type": "string",
            "description": "Billing cycle",
            "enum": [
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "semiannual",
              "yearly"
            ]
          },
          "status": {
            "type": "string",
            "description": "Subscription status",
            "enum": ["active", "cancelled", "paused", "past_due"]
          },
          "currentPeriodStart": {
            "type": "string",
            "description": "Current period start date"
          },
          "currentPeriodEnd": {
            "type": "string",
            "description": "Current period end date"
          },
          "nextBillingDate": {
            "type": "string",
            "description": "Next billing date"
          },
          "trialEndDate": {
            "type": "object",
            "description": "Trial end date"
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "example": ["pix", "credit_card"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recurrenceCount": {
            "type": "object",
            "description": "Number of cycles (null for indefinite)"
          },
          "notifications": {
            "description": "Notification channels",
            "example": ["email", "whatsapp"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxRetries": {
            "type": "number",
            "description": "Maximum payment retries"
          },
          "cancellationReason": {
            "type": "string",
            "description": "Cancellation reason (when cancelling)"
          }
        }
      },
      "CreateWithdrawalInput": {
        "type": "object",
        "properties": {
          "bankAccountId": {
            "type": "string",
            "description": "Bank account ID for the withdrawal"
          },
          "amount": {
            "type": "number",
            "description": "Withdrawal amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "default": "BRL"
          }
        },
        "required": ["bankAccountId", "amount"]
      },
      "GetWithdrawalOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Withdrawal ID"
          },
          "ledgerTransferId": {
            "type": "object",
            "description": "Ledger transfer ID"
          },
          "ledgerSyncStatus": {
            "type": "string",
            "description": "Ledger sync status",
            "enum": ["pending", "synced", "failed"]
          },
          "ledgerSyncedAt": {
            "type": "object",
            "description": "Ledger synced timestamp"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "bankAccountId": {
            "type": "string",
            "description": "Bank account ID"
          },
          "amount": {
            "type": "number",
            "description": "Withdrawal amount in cents"
          },
          "feeAmount": {
            "type": "number",
            "description": "Fee amount in cents"
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "status": {
            "type": "string",
            "description": "Withdrawal status",
            "enum": ["pending", "processing", "completed", "failed"]
          },
          "requestedAt": {
            "type": "string",
            "description": "Request timestamp"
          },
          "processedAt": {
            "type": "object",
            "description": "Processing timestamp"
          },
          "failureReason": {
            "type": "object",
            "description": "Failure reason"
          },
          "pspReference": {
            "type": "object",
            "description": "PSP reference"
          },
          "snapshotAccountMode": {
            "type": "string",
            "description": "Snapshot: Account mode",
            "enum": ["pix", "traditional"]
          },
          "snapshotBankName": {
            "type": "object",
            "description": "Snapshot: Bank name (traditional accounts only)"
          },
          "snapshotBankCode": {
            "type": "object",
            "description": "Snapshot: Bank code (traditional accounts only)"
          },
          "snapshotAgency": {
            "type": "object",
            "description": "Snapshot: Agency (traditional accounts only)"
          },
          "snapshotAccount": {
            "type": "object",
            "description": "Snapshot: Account number (traditional accounts only)"
          },
          "snapshotAccountType": {
            "type": "string",
            "description": "Snapshot: Account type (traditional accounts only)",
            "enum": ["checking", "savings"]
          },
          "snapshotPixKey": {
            "type": "object",
            "description": "Snapshot: PIX key (PIX accounts only)"
          },
          "snapshotPixKeyType": {
            "type": "string",
            "description": "Snapshot: PIX key type (PIX accounts only)",
            "enum": ["cpf", "cnpj", "email", "phone", "random"]
          },
          "snapshotHolderName": {
            "type": "string",
            "description": "Snapshot: Holder name"
          },
          "snapshotHolderDocument": {
            "type": "string",
            "description": "Snapshot: Holder document"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "ledgerSyncStatus",
          "accountId",
          "bankAccountId",
          "amount",
          "feeAmount",
          "netAmount",
          "currency",
          "status",
          "requestedAt",
          "snapshotAccountMode",
          "snapshotHolderName",
          "snapshotHolderDocument",
          "createdAt"
        ]
      },
      "GetAllWithdrawalsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of withdrawals",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetWithdrawalOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "CreateReferralInput": {
        "type": "object",
        "properties": {
          "referredName": {
            "type": "string",
            "description": "Name of the referred person"
          },
          "referredEmail": {
            "type": "string",
            "description": "Email of the referred person"
          },
          "bonusAmount": {
            "type": "number",
            "description": "Bonus amount in cents"
          },
          "qualificationCriteria": {
            "type": "object",
            "description": "Qualification criteria"
          },
          "expiresAt": {
            "type": "string",
            "description": "Expiration date (ISO 8601)"
          }
        },
        "required": ["referredName", "referredEmail", "bonusAmount"]
      },
      "GetReferralOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Referral ID"
          },
          "referralProgramId": {
            "type": "string",
            "description": "Referral program ID"
          },
          "referredAccountId": {
            "type": "object",
            "description": "Referred account ID"
          },
          "referredName": {
            "type": "string",
            "description": "Referred person name"
          },
          "referredEmail": {
            "type": "string",
            "description": "Referred person email"
          },
          "status": {
            "type": "string",
            "description": "Referral status",
            "enum": ["pending", "qualified", "paid", "expired"]
          },
          "bonusAmount": {
            "type": "number",
            "description": "Bonus amount in cents"
          },
          "qualificationCriteria": {
            "type": "object",
            "description": "Qualification criteria"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "qualifiedAt": {
            "type": "object",
            "description": "Qualification timestamp"
          },
          "paidAt": {
            "type": "object",
            "description": "Payment timestamp"
          },
          "expiresAt": {
            "type": "object",
            "description": "Expiration timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "referralProgramId",
          "referredName",
          "referredEmail",
          "status",
          "bonusAmount",
          "createdAt"
        ]
      },
      "GetAllReferralsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of referrals",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetReferralOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "GetAuditLogOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Audit log ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "userId": {
            "type": "object",
            "description": "User ID who performed the action"
          },
          "action": {
            "type": "string",
            "description": "Action type",
            "enum": [
              "create",
              "update",
              "delete",
              "login",
              "logout",
              "password_change",
              "api_key_regenerate",
              "withdrawal_request",
              "settings_change"
            ]
          },
          "entityType": {
            "type": "string",
            "description": "Entity type affected"
          },
          "entityId": {
            "type": "string",
            "description": "Entity ID affected"
          },
          "oldValues": {
            "type": "object",
            "description": "Old values before change"
          },
          "newValues": {
            "type": "object",
            "description": "New values after change"
          },
          "ipAddress": {
            "type": "object",
            "description": "IP address of the request"
          },
          "userAgent": {
            "type": "object",
            "description": "User agent of the request"
          },
          "requestId": {
            "type": "object",
            "description": "Request ID for tracing"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "action",
          "entityType",
          "entityId",
          "createdAt"
        ]
      },
      "GetAllAuditLogsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of audit logs",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetAuditLogOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "BffCreateWithdrawalInput": {
        "type": "object",
        "properties": {
          "bankAccountId": {
            "type": "string",
            "description": "Bank account ID for the withdrawal"
          },
          "amount": {
            "type": "number",
            "description": "Withdrawal amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "default": "BRL"
          }
        },
        "required": ["bankAccountId", "amount"]
      },
      "BffWithdrawalBankAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Bank account ID",
            "format": "uuid"
          },
          "bankName": {
            "type": "string",
            "description": "Bank name"
          },
          "bankCode": {
            "type": "string",
            "description": "Bank code"
          },
          "agency": {
            "type": "string",
            "description": "Agency number"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number (masked)"
          },
          "type": {
            "type": "string",
            "description": "Account type",
            "enum": ["checking", "savings"]
          },
          "holderName": {
            "type": "string",
            "description": "Account holder name"
          }
        },
        "required": [
          "id",
          "bankName",
          "bankCode",
          "agency",
          "accountNumber",
          "type",
          "holderName"
        ]
      },
      "BffGetWithdrawalOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Withdrawal ID"
          },
          "ledgerTransferId": {
            "type": "object",
            "description": "Ledger transfer ID"
          },
          "ledgerSyncStatus": {
            "type": "string",
            "description": "Ledger sync status",
            "enum": ["pending", "synced", "failed"]
          },
          "ledgerSyncedAt": {
            "type": "object",
            "description": "Ledger synced timestamp"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "bankAccount": {
            "description": "Bank account details",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffWithdrawalBankAccountOutput"
              }
            ]
          },
          "amount": {
            "type": "number",
            "description": "Withdrawal amount in cents"
          },
          "feeAmount": {
            "type": "number",
            "description": "Fee amount in cents"
          },
          "totalAmount": {
            "type": "number",
            "description": "Total amount in cents (amount + feeAmount)"
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "status": {
            "type": "string",
            "description": "Withdrawal status",
            "enum": ["pending", "processing", "completed", "failed"]
          },
          "requestedAt": {
            "type": "string",
            "description": "Request timestamp"
          },
          "processedAt": {
            "type": "object",
            "description": "Processing timestamp"
          },
          "failureReason": {
            "type": "object",
            "description": "Failure reason"
          },
          "pspReference": {
            "type": "object",
            "description": "PSP reference"
          },
          "snapshotAccountMode": {
            "type": "string",
            "description": "Snapshot: Account mode",
            "enum": ["pix", "traditional"]
          },
          "snapshotBankName": {
            "type": "object",
            "description": "Snapshot: Bank name (traditional accounts only)"
          },
          "snapshotBankCode": {
            "type": "object",
            "description": "Snapshot: Bank code (traditional accounts only)"
          },
          "snapshotAgency": {
            "type": "object",
            "description": "Snapshot: Agency (traditional accounts only)"
          },
          "snapshotAccount": {
            "type": "object",
            "description": "Snapshot: Account (traditional accounts only)"
          },
          "snapshotAccountType": {
            "type": "string",
            "description": "Snapshot: Account type (traditional accounts only)",
            "enum": ["checking", "savings"]
          },
          "snapshotPixKey": {
            "type": "object",
            "description": "Snapshot: PIX key (PIX accounts only)"
          },
          "snapshotPixKeyType": {
            "type": "string",
            "description": "Snapshot: PIX key type (PIX accounts only)",
            "enum": ["cpf", "cnpj", "email", "phone", "random"]
          },
          "snapshotHolderName": {
            "type": "string",
            "description": "Snapshot: Holder name"
          },
          "snapshotHolderDocument": {
            "type": "string",
            "description": "Snapshot: Holder document"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "ledgerSyncStatus",
          "accountId",
          "amount",
          "feeAmount",
          "totalAmount",
          "netAmount",
          "currency",
          "status",
          "requestedAt",
          "snapshotAccountMode",
          "snapshotHolderName",
          "snapshotHolderDocument",
          "createdAt"
        ]
      },
      "BffGetAllWithdrawalsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of withdrawals",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BffGetWithdrawalOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "WithdrawalTotalItem": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Total amount in cents"
          },
          "amountFormatted": {
            "type": "string",
            "description": "Total amount formatted (e.g., R$ 3.643,99)"
          },
          "count": {
            "type": "number",
            "description": "Number of withdrawals"
          }
        },
        "required": ["amount", "amountFormatted", "count"]
      },
      "GetWithdrawalTotalsOutput": {
        "type": "object",
        "properties": {
          "processing": {
            "description": "Withdrawals in processing (pending + processing)",
            "allOf": [
              {
                "$ref": "#/components/schemas/WithdrawalTotalItem"
              }
            ]
          },
          "completed": {
            "description": "Completed withdrawals",
            "allOf": [
              {
                "$ref": "#/components/schemas/WithdrawalTotalItem"
              }
            ]
          },
          "failed": {
            "description": "Failed withdrawals",
            "allOf": [
              {
                "$ref": "#/components/schemas/WithdrawalTotalItem"
              }
            ]
          }
        },
        "required": ["processing", "completed", "failed"]
      },
      "BffAddressInput": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "Rua das Flores",
            "maxLength": 255
          },
          "number": {
            "type": "string",
            "description": "Street number",
            "example": "123",
            "maxLength": 20
          },
          "complement": {
            "type": "string",
            "description": "Address complement (apartment, suite, etc.)",
            "example": "Apt 101",
            "maxLength": 100
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood",
            "example": "Centro",
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "description": "City name",
            "example": "Sao Paulo",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "description": "State code (UF)",
            "example": "SP",
            "minLength": 2,
            "maxLength": 2
          },
          "zipCode": {
            "type": "string",
            "description": "ZIP code (CEP)",
            "example": "01234567",
            "minLength": 8,
            "maxLength": 8
          },
          "country": {
            "type": "string",
            "description": "Country code (ISO 3166-1 alpha-2)",
            "example": "BR",
            "default": "BR",
            "minLength": 2,
            "maxLength": 2
          }
        },
        "required": [
          "street",
          "number",
          "neighborhood",
          "city",
          "state",
          "zipCode"
        ]
      },
      "BffCreateClientInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Client name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "Client email",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number",
            "maxLength": 20
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "document": {
            "type": "string",
            "description": "Document number (CPF or CNPJ)",
            "maxLength": 14
          },
          "address": {
            "description": "Client address",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffAddressInput"
              }
            ]
          },
          "projectIds": {
            "description": "Project IDs to associate with the client",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "name",
          "email",
          "phone",
          "documentType",
          "document",
          "address"
        ]
      },
      "BffAddressOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Address ID",
            "format": "uuid"
          },
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "Rua das Flores"
          },
          "number": {
            "type": "string",
            "description": "Street number",
            "example": "123"
          },
          "complement": {
            "type": "string",
            "description": "Address complement",
            "example": "Apt 101"
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood",
            "example": "Centro"
          },
          "city": {
            "type": "string",
            "description": "City",
            "example": "Sao Paulo"
          },
          "state": {
            "type": "string",
            "description": "State code",
            "example": "SP"
          },
          "zipCode": {
            "type": "string",
            "description": "ZIP code",
            "example": "01234567"
          },
          "country": {
            "type": "string",
            "description": "Country code",
            "example": "BR"
          }
        },
        "required": [
          "id",
          "street",
          "number",
          "neighborhood",
          "city",
          "state",
          "zipCode",
          "country"
        ]
      },
      "BffProjectOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Project name"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex)",
            "example": "#FF5733"
          }
        },
        "required": ["id", "name", "color"]
      },
      "BffGetClientOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID",
            "format": "uuid"
          },
          "address": {
            "description": "Client address",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffAddressOutput"
              }
            ]
          },
          "projects": {
            "description": "Projects associated with the client",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BffProjectOutput"
            }
          },
          "name": {
            "type": "string",
            "description": "Client name"
          },
          "email": {
            "type": "string",
            "description": "Client email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number"
          },
          "documentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "document": {
            "type": "string",
            "description": "Document number (masked)"
          },
          "totalTransactions": {
            "type": "number",
            "description": "Total number of transactions"
          },
          "totalSpent": {
            "type": "number",
            "description": "Total amount spent (in cents)"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "accountId",
          "projects",
          "name",
          "email",
          "phone",
          "documentType",
          "document",
          "totalTransactions",
          "totalSpent",
          "createdAt"
        ]
      },
      "BffUpdateAddressInput": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "Rua das Flores",
            "maxLength": 255
          },
          "number": {
            "type": "string",
            "description": "Street number",
            "example": "123",
            "maxLength": 20
          },
          "complement": {
            "type": "string",
            "description": "Address complement (apartment, suite, etc.)",
            "example": "Apt 101",
            "maxLength": 100
          },
          "neighborhood": {
            "type": "string",
            "description": "Neighborhood",
            "example": "Centro",
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "description": "City name",
            "example": "Sao Paulo",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "description": "State code (UF)",
            "example": "SP",
            "minLength": 2,
            "maxLength": 2
          },
          "zipCode": {
            "type": "string",
            "description": "ZIP code (CEP)",
            "example": "01234567",
            "minLength": 8,
            "maxLength": 8
          },
          "country": {
            "type": "string",
            "description": "Country code (ISO 3166-1 alpha-2)",
            "example": "BR",
            "minLength": 2,
            "maxLength": 2
          }
        }
      },
      "BffUpdateClientInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Client name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "Client email",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "description": "Client phone number",
            "maxLength": 20
          },
          "address": {
            "description": "Client address updates",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffUpdateAddressInput"
              }
            ]
          },
          "projectIds": {
            "description": "Project IDs to associate with the client",
            "example": ["uuid-1", "uuid-2"],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BffSubscriptionClientOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name"
          },
          "email": {
            "type": "string",
            "description": "Client email"
          }
        },
        "required": ["id", "name", "email"]
      },
      "BffSubscriptionProjectOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Project name"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex)",
            "example": "#FF5733"
          }
        },
        "required": ["id", "name", "color"]
      },
      "BffGetSubscriptionOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Subscription ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "client": {
            "description": "Client details",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffSubscriptionClientOutput"
              }
            ]
          },
          "project": {
            "description": "Project details",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffSubscriptionProjectOutput"
              }
            ]
          },
          "paymentLinkId": {
            "type": "object",
            "description": "Payment link ID"
          },
          "planName": {
            "type": "string",
            "description": "Plan name"
          },
          "description": {
            "type": "object",
            "description": "Description"
          },
          "amount": {
            "type": "number",
            "description": "Amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "cycle": {
            "type": "string",
            "description": "Billing cycle"
          },
          "status": {
            "type": "string",
            "description": "Status"
          },
          "currentPeriodStart": {
            "type": "string",
            "description": "Current period start"
          },
          "currentPeriodEnd": {
            "type": "string",
            "description": "Current period end"
          },
          "nextBillingDate": {
            "type": "string",
            "description": "Next billing date"
          },
          "startDate": {
            "type": "string",
            "description": "Start date"
          },
          "trialEndDate": {
            "type": "object",
            "description": "Trial end date"
          },
          "paymentMethods": {
            "description": "Payment methods",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recurrenceCount": {
            "type": "object",
            "description": "Total recurrence count"
          },
          "completedCycles": {
            "type": "number",
            "description": "Completed billing cycles"
          },
          "notifications": {
            "description": "Notification channels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retryCount": {
            "type": "number",
            "description": "Current retry count"
          },
          "maxRetries": {
            "type": "number",
            "description": "Maximum retries"
          },
          "pausedAt": {
            "type": "object",
            "description": "Paused at timestamp"
          },
          "cancelledAt": {
            "type": "object",
            "description": "Cancelled at timestamp"
          },
          "cancellationReason": {
            "type": "object",
            "description": "Cancellation reason"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "planName",
          "amount",
          "currency",
          "cycle",
          "status",
          "currentPeriodStart",
          "currentPeriodEnd",
          "nextBillingDate",
          "startDate",
          "paymentMethods",
          "completedCycles",
          "notifications",
          "retryCount",
          "maxRetries",
          "createdAt"
        ]
      },
      "BffGetAllSubscriptionsOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of subscriptions",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BffGetSubscriptionOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "BffSubscriptionCountOutput": {
        "type": "object",
        "properties": {
          "count": {
            "type": "number",
            "description": "Number of subscriptions matching the criteria"
          }
        },
        "required": ["count"]
      },
      "BffCancelSubscriptionInput": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Cancellation reason"
          }
        }
      },
      "BffPaymentLinkProjectOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Project name"
          },
          "color": {
            "type": "string",
            "description": "Project color"
          }
        },
        "required": ["id", "name", "color"]
      },
      "BffPaymentLinkClientOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Client name"
          },
          "email": {
            "type": "string",
            "description": "Client email"
          }
        },
        "required": ["id", "name", "email"]
      },
      "BffGetPaymentLinkOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Payment link ID"
          },
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "project": {
            "description": "Project details",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffPaymentLinkProjectOutput"
              }
            ]
          },
          "client": {
            "description": "Client details",
            "allOf": [
              {
                "$ref": "#/components/schemas/BffPaymentLinkClientOutput"
              }
            ]
          },
          "name": {
            "type": "string",
            "description": "Payment link name"
          },
          "description": {
            "type": "object",
            "description": "Description"
          },
          "amount": {
            "type": "object",
            "description": "Amount in cents"
          },
          "currency": {
            "type": "string",
            "description": "Currency code"
          },
          "status": {
            "type": "string",
            "description": "Status",
            "enum": ["active", "expired", "disabled", "paid"]
          },
          "slug": {
            "type": "string",
            "description": "URL slug"
          },
          "paymentsCount": {
            "type": "number",
            "description": "Number of payments received"
          },
          "totalCollected": {
            "type": "number",
            "description": "Total amount collected in cents"
          },
          "paymentType": {
            "type": "string",
            "description": "Payment type",
            "enum": ["one_time", "subscription"]
          },
          "paymentMethods": {
            "description": "Accepted payment methods",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxInstallments": {
            "type": "number",
            "description": "Maximum installments"
          },
          "recurrenceInterval": {
            "type": "object",
            "description": "Recurrence interval"
          },
          "recurrenceCount": {
            "type": "object",
            "description": "Number of recurrence cycles"
          },
          "notifications": {
            "description": "Notification channels",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowCoupons": {
            "type": "boolean",
            "description": "Allow coupons"
          },
          "expiresAt": {
            "type": "object",
            "description": "Expiration date"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp"
          },
          "updatedAt": {
            "type": "object",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "id",
          "accountId",
          "name",
          "currency",
          "status",
          "slug",
          "paymentsCount",
          "totalCollected",
          "paymentType",
          "paymentMethods",
          "maxInstallments",
          "notifications",
          "allowCoupons",
          "createdAt"
        ]
      },
      "BffGetAllPaymentLinksOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "List of payment links",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BffGetPaymentLinkOutput"
            }
          },
          "meta": {
            "description": "Pagination metadata",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaginationMeta"
              }
            ]
          }
        },
        "required": ["items", "meta"]
      },
      "BffCreateBankAccountInput": {
        "type": "object",
        "properties": {
          "accountMode": {
            "type": "string",
            "description": "Account mode: PIX or traditional bank account",
            "enum": ["pix", "traditional"]
          },
          "bankName": {
            "type": "string",
            "description": "Bank name (required for traditional)",
            "example": "Banco do Brasil"
          },
          "bankCode": {
            "type": "string",
            "description": "Bank code (COMPE) (required for traditional)",
            "example": "001"
          },
          "agency": {
            "type": "string",
            "description": "Agency number (required for traditional)",
            "example": "1234"
          },
          "agencyDigit": {
            "type": "string",
            "description": "Agency check digit",
            "example": "5"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number (required for traditional)",
            "example": "12345678"
          },
          "accountDigit": {
            "type": "string",
            "description": "Account check digit (required for traditional)",
            "example": "9"
          },
          "type": {
            "type": "string",
            "description": "Account type (required for traditional)",
            "enum": ["checking", "savings"]
          },
          "pixKey": {
            "type": "string",
            "description": "PIX key (required for pix mode)",
            "example": "12345678901"
          },
          "pixKeyType": {
            "type": "string",
            "description": "PIX key type (required for pix mode)",
            "enum": ["cpf", "cnpj", "email", "phone", "random"]
          },
          "isDefault": {
            "type": "boolean",
            "description": "Set as default bank account",
            "default": false
          },
          "holderName": {
            "type": "string",
            "description": "Account holder name",
            "example": "John Doe"
          },
          "holderDocument": {
            "type": "string",
            "description": "Account holder document (CPF/CNPJ)",
            "example": "12345678901"
          },
          "holderDocumentType": {
            "type": "string",
            "description": "Holder document type",
            "enum": ["cpf", "cnpj"]
          }
        },
        "required": [
          "accountMode",
          "holderName",
          "holderDocument",
          "holderDocumentType"
        ]
      },
      "BffCreateProjectInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "description": "Project description"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex format)",
            "example": "#3498db"
          },
          "logoUrl": {
            "type": "string",
            "description": "Project logo URL"
          },
          "defaultCurrency": {
            "type": "string",
            "description": "Default currency (ISO 4217)",
            "default": "BRL",
            "maxLength": 3
          }
        },
        "required": ["name", "color"]
      },
      "BffUpdateProjectInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "description": "Project description"
          },
          "color": {
            "type": "string",
            "description": "Project color (hex format)",
            "example": "#3498db"
          },
          "logoUrl": {
            "type": "string",
            "description": "Project logo URL"
          },
          "defaultCurrency": {
            "type": "string",
            "description": "Default currency (ISO 4217)",
            "maxLength": 3
          }
        }
      },
      "MarkAllReadOutput": {
        "type": "object",
        "properties": {
          "count": {
            "type": "number",
            "description": "Number of notifications marked as read"
          }
        },
        "required": ["count"]
      },
      "BalanceDetail": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Balance in cents"
          },
          "amountFormatted": {
            "type": "number",
            "description": "Balance formatted in currency (amount / 100)"
          }
        },
        "required": ["amount", "amountFormatted"]
      },
      "GetBalanceOutput": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "Account ID"
          },
          "mainAccount": {
            "description": "Main account balance",
            "allOf": [
              {
                "$ref": "#/components/schemas/BalanceDetail"
              }
            ]
          },
          "promotionalAccount": {
            "description": "Promotional account balance (used to pay fees)",
            "allOf": [
              {
                "$ref": "#/components/schemas/BalanceDetail"
              }
            ]
          },
          "total": {
            "description": "Total balance (main + promotional)",
            "allOf": [
              {
                "$ref": "#/components/schemas/BalanceDetail"
              }
            ]
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "example": "BRL"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp"
          }
        },
        "required": [
          "accountId",
          "mainAccount",
          "promotionalAccount",
          "total",
          "currency",
          "updatedAt"
        ]
      },
      "BffDashboardResumeOutput": {
        "type": "object",
        "properties": {
          "clients": {
            "type": "number",
            "description": "Total number of clients"
          },
          "activeSubscriptions": {
            "type": "number",
            "description": "Number of active subscriptions"
          },
          "pendingWithdrawals": {
            "type": "number",
            "description": "Number of pending withdrawals"
          },
          "activePaymentLinks": {
            "type": "number",
            "description": "Number of active payment links"
          }
        },
        "required": [
          "clients",
          "activeSubscriptions",
          "pendingWithdrawals",
          "activePaymentLinks"
        ]
      },
      "TransactionDailyAggregateOutput": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date (YYYY-MM-DD)"
          },
          "payments": {
            "type": "number",
            "description": "Total payments in cents"
          },
          "fees": {
            "type": "number",
            "description": "Total fees in cents (includes payment and withdrawal fees)"
          },
          "refunds": {
            "type": "number",
            "description": "Total refunds in cents"
          },
          "withdrawals": {
            "type": "number",
            "description": "Total withdrawals in cents"
          }
        },
        "required": ["date", "payments", "fees", "refunds", "withdrawals"]
      },
      "BffTransactionsGraphOutput": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionDailyAggregateOutput"
            }
          }
        },
        "required": ["items"]
      },
      "GetProfileOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "User ID"
          },
          "name": {
            "type": "string",
            "description": "User full name"
          },
          "email": {
            "type": "string",
            "description": "User email address"
          },
          "avatarUrl": {
            "type": "string",
            "description": "User avatar URL"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"]
          },
          "createdAt": {
            "type": "string",
            "description": "Date when user was created"
          }
        },
        "required": ["id", "name", "email", "role", "createdAt"]
      },
      "UpdateProfileInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "User full name",
            "maxLength": 255
          }
        }
      },
      "ChangePasswordInput": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "description": "Current password"
          },
          "newPassword": {
            "type": "string",
            "description": "New password",
            "minLength": 8
          }
        },
        "required": ["currentPassword", "newPassword"]
      },
      "AccountStatusOutput": {
        "type": "object",
        "properties": {}
      },
      "RejectWithdrawalInput": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Reason for rejection"
          }
        }
      },
      "AsaasPspCredentialInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Friendly name for the credential",
            "maxLength": 100
          },
          "credentials": {
            "description": "Asaas API credentials (will be encrypted)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AsaasCredentialsInput"
              }
            ]
          },
          "enabledMethods": {
            "type": "array",
            "description": "Payment methods to enable (Asaas supports: pix, credit_card, boleto)",
            "example": ["pix", "credit_card", "boleto"],
            "items": {
              "type": "string",
              "enum": ["pix", "credit_card", "boleto"]
            }
          }
        },
        "required": ["name", "credentials", "enabledMethods"]
      },
      "PaymentMethodFeeInput": {
        "type": "object",
        "properties": {
          "fixedFee": {
            "type": "number",
            "description": "Fixed fee in cents",
            "example": 100,
            "default": 0
          },
          "percentFee": {
            "type": "string",
            "description": "Percentage fee (0.00 to 100.00)",
            "example": "2.50",
            "default": "0"
          },
          "minFee": {
            "type": "number",
            "description": "Minimum fee in cents",
            "example": 50
          },
          "maxFee": {
            "type": "number",
            "description": "Maximum fee in cents",
            "example": 5000
          },
          "settlementDays": {
            "type": "number",
            "description": "Settlement days",
            "example": 1,
            "default": 0
          }
        }
      },
      "PaymentMethodFeesInput": {
        "type": "object",
        "properties": {
          "pix": {
            "description": "PIX fee configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodFeeInput"
              }
            ]
          },
          "credit_card": {
            "description": "Credit card fee configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodFeeInput"
              }
            ]
          },
          "boleto": {
            "description": "Boleto fee configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodFeeInput"
              }
            ]
          },
          "withdrawal": {
            "description": "Withdrawal fee configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodFeeInput"
              }
            ]
          },
          "refund": {
            "description": "Refund fee configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodFeeInput"
              }
            ]
          }
        }
      },
      "AdminUserInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "User name",
            "maxLength": 255
          },
          "email": {
            "type": "string",
            "description": "User email",
            "format": "email"
          },
          "password": {
            "type": "string",
            "description": "User password",
            "minLength": 8
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"],
            "default": "member"
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active"],
            "default": "active"
          }
        },
        "required": ["name", "email", "password"]
      },
      "AdminBankAccountInput": {
        "type": "object",
        "properties": {
          "bankName": {
            "type": "string",
            "description": "Bank name",
            "maxLength": 100
          },
          "bankCode": {
            "type": "string",
            "description": "Bank code",
            "maxLength": 10
          },
          "agency": {
            "type": "string",
            "description": "Agency number",
            "maxLength": 10
          },
          "agencyDigit": {
            "type": "string",
            "description": "Agency digit",
            "maxLength": 2
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number",
            "maxLength": 20
          },
          "accountDigit": {
            "type": "string",
            "description": "Account digit",
            "maxLength": 2
          },
          "type": {
            "type": "string",
            "description": "Account type",
            "enum": ["checking", "savings"]
          },
          "holderName": {
            "type": "string",
            "description": "Account holder name",
            "maxLength": 255
          },
          "holderDocument": {
            "type": "string",
            "description": "Account holder document (CPF/CNPJ)",
            "maxLength": 14
          },
          "holderDocumentType": {
            "type": "string",
            "description": "Document type",
            "enum": ["cpf", "cnpj"]
          },
          "isDefault": {
            "type": "boolean",
            "description": "Set as default bank account",
            "default": false
          },
          "pixKey": {
            "type": "string",
            "description": "PIX key",
            "maxLength": 255
          },
          "pixKeyType": {
            "type": "string",
            "description": "PIX key type",
            "maxLength": 10
          }
        },
        "required": [
          "bankName",
          "bankCode",
          "agency",
          "accountNumber",
          "accountDigit",
          "type",
          "holderName",
          "holderDocument",
          "holderDocumentType"
        ]
      },
      "AdminWebhookInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Webhook name"
          },
          "url": {
            "type": "string",
            "description": "Webhook URL",
            "format": "url"
          },
          "secret": {
            "type": "string",
            "description": "Webhook secret (used for signature verification)"
          },
          "events": {
            "description": "Events to subscribe to",
            "example": ["payment.created", "payment.completed"],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "environment": {
            "type": "string",
            "description": "Environment",
            "enum": ["production", "sandbox"],
            "default": "production"
          },
          "headers": {
            "type": "object",
            "description": "Custom HTTP headers",
            "additionalProperties": true
          },
          "isActive": {
            "type": "boolean",
            "description": "Is webhook active",
            "default": true
          }
        },
        "required": ["name", "url", "secret", "events"]
      },
      "AdminCreateAccountCompanyInfoOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Company info ID",
            "format": "uuid"
          },
          "razaoSocial": {
            "type": "string",
            "description": "Company legal name (Razao Social)"
          },
          "cnpj": {
            "type": "string",
            "description": "Company CNPJ"
          },
          "email": {
            "type": "string",
            "description": "Company email"
          },
          "phone": {
            "type": "string",
            "description": "Company phone"
          }
        },
        "required": ["id", "razaoSocial", "cnpj", "email", "phone"]
      },
      "AdminCreateAccountIntegrationKeysOutput": {
        "type": "object",
        "properties": {
          "productionKey": {
            "type": "string",
            "description": "Production API key (only shown once)"
          },
          "sandboxKey": {
            "type": "string",
            "description": "Sandbox API key (only shown once)"
          }
        },
        "required": ["productionKey", "sandboxKey"]
      },
      "AdminCreateAccountLedgerAccountsOutput": {
        "type": "object",
        "properties": {
          "available": {
            "type": "string",
            "description": "Available balance ledger account ID"
          },
          "held": {
            "type": "string",
            "description": "Held funds ledger account ID"
          },
          "credits": {
            "type": "string",
            "description": "Credits ledger account ID"
          }
        },
        "required": ["available", "held", "credits"]
      },
      "AdminPspCredentialOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "PSP credential ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Friendly name"
          }
        },
        "required": ["id", "name"]
      },
      "AdminPaymentMethodFeeOutput": {
        "type": "object",
        "properties": {
          "fixedFee": {
            "type": "number",
            "description": "Fixed fee in cents"
          },
          "percentFee": {
            "type": "string",
            "description": "Percentage fee"
          },
          "settlementDays": {
            "type": "number",
            "description": "Settlement days"
          }
        },
        "required": ["fixedFee", "percentFee", "settlementDays"]
      },
      "AdminPaymentMethodOutput": {
        "type": "object",
        "properties": {
          "pspCredentialId": {
            "type": "string",
            "description": "PSP credential ID used for this method",
            "format": "uuid"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the default PSP for this payment method"
          },
          "fee": {
            "description": "Fee configuration (if provided)",
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminPaymentMethodFeeOutput"
              }
            ]
          }
        },
        "required": ["pspCredentialId", "isDefault"]
      },
      "AdminPaymentMethodsOutput": {
        "type": "object",
        "properties": {
          "pix": {
            "description": "PIX payment method configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminPaymentMethodOutput"
              }
            ]
          },
          "credit_card": {
            "description": "Credit card payment method configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminPaymentMethodOutput"
              }
            ]
          },
          "boleto": {
            "description": "Boleto payment method configuration",
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminPaymentMethodOutput"
              }
            ]
          }
        }
      },
      "AdminUserOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "User ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "User name"
          },
          "email": {
            "type": "string",
            "description": "User email"
          },
          "role": {
            "type": "string",
            "description": "User role",
            "enum": ["owner", "admin", "member"]
          },
          "status": {
            "type": "string",
            "description": "User status",
            "enum": ["pending", "active"]
          }
        },
        "required": ["id", "name", "email", "role", "status"]
      },
      "AdminBankAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Bank account ID",
            "format": "uuid"
          },
          "bankName": {
            "type": "object",
            "description": "Bank name"
          },
          "bankCode": {
            "type": "object",
            "description": "Bank code"
          },
          "agency": {
            "type": "object",
            "description": "Agency number"
          },
          "accountNumber": {
            "type": "object",
            "description": "Account number (masked)"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is the default bank account"
          }
        },
        "required": ["id", "isDefault"]
      },
      "AdminWebhookOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Webhook endpoint ID",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Webhook name"
          },
          "url": {
            "type": "string",
            "description": "Webhook URL"
          },
          "environment": {
            "type": "string",
            "description": "Environment",
            "enum": ["production", "sandbox"]
          },
          "events": {
            "description": "Subscribed events",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the webhook is active"
          }
        },
        "required": ["id", "name", "url", "environment", "events", "isActive"]
      },
      "CustomerDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do pagador",
            "maxLength": 255,
            "example": "João da Silva"
          },
          "document": {
            "type": "string",
            "description": "CPF ou CNPJ do pagador, apenas números (opcional)",
            "maxLength": 20,
            "example": "12345678909"
          },
          "email": {
            "type": "string",
            "description": "E-mail do pagador",
            "format": "email",
            "maxLength": 255
          },
          "phone": {
            "type": "string",
            "description": "Telefone do pagador (formato livre)",
            "maxLength": 20,
            "example": "+5511999998888"
          }
        }
      },
      "CreatePixChargeInput": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Valor em BRL (ex: 100.50 para R$ 100,50)",
            "minimum": 1,
            "example": 150.75
          },
          "description": {
            "type": "string",
            "description": "Descrição da cobrança",
            "maxLength": 255,
            "example": "Pagamento do pedido #12345"
          },
          "customer": {
            "description": "Dados do pagador (todos opcionais).",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerDto"
              }
            ]
          },
          "projectId": {
            "type": "string",
            "description": "ID do projeto para associar a transação. Se não informado e a conta tiver um único projeto, a cobrança herda esse projeto; com mais de um, a cobrança fica sem projeto.",
            "format": "uuid"
          },
          "pspCredentialId": {
            "type": "string",
            "description": "Fixa a instituição que emite esta cobrança, ignorando o roteamento configurado. Use o ID que aparece em Configurações → Roteamento no painel. Precisa ser uma instituição habilitada e ativa da sua conta. Se ela estiver fora do ar ou sem capacidade, a cobrança FALHA — não cai para outra: você pediu esta. Disponível para contas com a escolha de instituição habilitada.",
            "format": "uuid",
            "example": "6e307aa4-4772-4230-a648-d88cee308f54"
          },
          "expiresIn": {
            "type": "integer",
            "description": "Segundos até expiração (padrão: 86400 = 24h)",
            "minimum": 300,
            "maximum": 604800,
            "example": 3600
          },
          "externalReference": {
            "type": "string",
            "description": "Seu ID de referência externa",
            "maxLength": 255,
            "example": "pedido-12345"
          },
          "metadata": {
            "type": "object",
            "description": "Metadados customizados (pares chave-valor)",
            "additionalProperties": true,
            "example": {
              "orderId": "12345",
              "source": "website"
            }
          },
          "split": {
            "type": "array",
            "description": "Reparte parte do valor com outras subcontas da mesma conta, na liquidação. Quem cria a cobrança é o originador: recebe o valor bruto, paga a taxa cheia e só então reparte — a taxa não é rateada entre os destinatários. A soma do split não pode exceder o líquido (valor da cobrança menos a taxa). Estorno e MED debitam apenas o originador; quem recebeu rateio nunca é debitado.",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/PixSplitAllocationInput"
            }
          }
        },
        "required": ["amount", "description"]
      },
      "CreatePixChargeOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID da cobrança (ID da transação)",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "Status da cobrança",
            "enum": ["pending", "completed", "failed", "cancelled"]
          },
          "amount": {
            "type": "number",
            "description": "Valor em BRL",
            "example": 150.75
          },
          "currency": {
            "type": "string",
            "description": "Código da moeda",
            "example": "BRL"
          },
          "pixCopyPaste": {
            "type": "string",
            "description": "Código PIX copia e cola",
            "example": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "qrCodeBase64": {
            "type": "string",
            "description": "QR Code do PIX em formato data URI (data:image/png;base64,...)"
          },
          "pspPaymentId": {
            "type": "string",
            "description": "ID da transação no provedor de pagamento (PSP). Use para conciliação; ausente se o PSP não retornou o ID na criação.",
            "example": "de3516a2-c63a-4c02-b132-a239bf42e183"
          },
          "expiresAt": {
            "type": "string",
            "description": "Data de expiração",
            "format": "date-time"
          },
          "pspCredentialId": {
            "type": "string",
            "description": "Instituição que emitiu esta cobrança. Só vem quando você fixou a instituição no request (`pspCredentialId`), como recibo de que ela foi respeitada.",
            "format": "uuid",
            "example": "6e307aa4-4772-4230-a648-d88cee308f54"
          },
          "externalReference": {
            "type": "string",
            "description": "Seu ID de referência externa",
            "example": "pedido-12345"
          },
          "createdAt": {
            "type": "string",
            "description": "Data de criação",
            "format": "date-time"
          },
          "split": {
            "type": "array",
            "description": "Rateio aceito, em reais. Presente apenas quando a cobrança foi criada com split — se veio na resposta, as subcontas existiam e a soma cabia no líquido. O que foi efetivamente distribuído chega no webhook payment_completed.",
            "items": {
              "$ref": "#/components/schemas/PixSplitAllocationOutput"
            }
          }
        },
        "required": [
          "id",
          "status",
          "amount",
          "currency",
          "pixCopyPaste",
          "expiresAt",
          "createdAt"
        ]
      },
      "PixSplitAllocationInput": {
        "type": "object",
        "properties": {
          "subAccount": {
            "type": "string",
            "description": "Reference de uma subconta ativa da mesma conta que recebe o rateio. A palavra reservada `principal` endereça a conta principal — use quando a cobrança for originada por uma subconta (header `X-Sub-Account`); uma cobrança criada pela própria conta principal não pode ratear para `principal`.",
            "pattern": "^[a-z0-9][a-z0-9_-]{1,31}$",
            "example": "loja-centro"
          },
          "amount": {
            "type": "number",
            "description": "Valor em BRL destinado a essa carteira. Valor fixo — percentual não é aceito. No máximo 2 casas decimais.",
            "minimum": 0.01,
            "example": 30
          }
        },
        "required": ["subAccount", "amount"]
      },
      "PixSplitAllocationOutput": {
        "type": "object",
        "properties": {
          "subAccount": {
            "type": "string",
            "description": "Reference da subconta que recebe o rateio, ou `principal` quando o destino é a conta principal",
            "example": "loja-centro"
          },
          "amount": {
            "type": "number",
            "description": "Valor em BRL destinado a essa carteira",
            "example": 30
          }
        },
        "required": ["subAccount", "amount"]
      },
      "ExternalBalanceBlockOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID do bloqueio"
          },
          "transactionId": {
            "type": "string",
            "format": "uuid",
            "description": "ID da transação bloqueada"
          },
          "externalReference": {
            "type": "string",
            "nullable": true,
            "description": "Referência externa da transação original (se houver)"
          },
          "e2eId": {
            "type": "string",
            "nullable": true,
            "description": "ID fim-a-fim da rede PIX da transação original (se houver)"
          },
          "amount": {
            "type": "number",
            "description": "Valor bloqueado em BRL",
            "example": 150.5
          },
          "status": {
            "type": "string",
            "enum": ["awaiting_response", "defended", "approved", "rejected"],
            "description": "Status do bloqueio",
            "example": "awaiting_response"
          },
          "blockType": {
            "type": "string",
            "enum": ["med", "judicial", "administrative"],
            "description": "Tipo do bloqueio",
            "example": "med"
          },
          "referenceNumber": {
            "type": "string",
            "description": "Número de referência do bloqueio"
          },
          "reason": {
            "type": "string",
            "description": "Motivo do bloqueio"
          },
          "resolutionReason": {
            "type": "string",
            "nullable": true,
            "description": "Motivo da resolução (presente quando o bloqueio já foi resolvido)"
          },
          "resolvedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data/hora da resolução em ISO 8601 (presente quando o bloqueio já foi resolvido)"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data/hora da criação em ISO 8601"
          }
        },
        "required": [
          "id",
          "transactionId",
          "amount",
          "status",
          "blockType",
          "referenceNumber",
          "reason",
          "createdAt"
        ]
      },
      "GetAllExternalBalanceBlocksOutput": {
        "type": "object",
        "properties": {
          "items": {
            "description": "Lista de bloqueios de saldo da conta",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalBalanceBlockOutput"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total de bloqueios retornados",
            "example": 3
          }
        },
        "required": ["items", "total"]
      },
      "CreateExternalWithdrawalInput": {
        "type": "object",
        "description": "Dados para criar um saque via PIX. Informe **exatamente um** entre `amount` (valor bruto debitado do saldo) **ou** `netAmount` (valor líquido que o destinatário deve receber).",
        "properties": {
          "projectId": {
            "type": "string",
            "format": "uuid",
            "description": "ID do projeto ao qual o saque pertence. Se não informado e a conta tiver um único projeto, o saque herda esse projeto; com mais de um projeto, o saque fica sem projeto — mesmo comportamento da criação de cobrança PIX.",
            "example": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          },
          "amount": {
            "type": "number",
            "minimum": 1,
            "description": "Valor **bruto** em BRL debitado do saldo. O destinatário recebe `amount - feeAmount`. Mínimo R$ 1,00. Informe `amount` OU `netAmount` — nunca os dois.",
            "example": 150.75
          },
          "netAmount": {
            "type": "number",
            "minimum": 1,
            "description": "Valor **líquido** em BRL que o destinatário deve receber. A API calcula o gross necessário (`gross = netAmount + feeAmount`) e debita esse total do saldo. Mínimo R$ 1,00. Informe `amount` OU `netAmount` — nunca os dois.",
            "example": 150.0
          },
          "pixKey": {
            "type": "string",
            "description": "Chave PIX do destinatário.",
            "example": "12345678901"
          },
          "pixKeyType": {
            "type": "string",
            "enum": ["cpf", "cnpj", "email", "phone", "random"],
            "description": "Tipo da chave PIX.",
            "example": "cpf"
          },
          "holderName": {
            "type": "string",
            "description": "Nome do titular da conta PIX.",
            "example": "João da Silva"
          },
          "holderDocument": {
            "type": "string",
            "description": "CPF ou CNPJ do titular.",
            "example": "12345678901"
          },
          "holderDocumentType": {
            "type": "string",
            "enum": ["cpf", "cnpj"],
            "description": "Tipo do documento do titular.",
            "example": "cpf"
          },
          "externalReference": {
            "type": "string",
            "maxLength": 255,
            "description": "Seu ID de referência externa (opcional). É devolvido no response e nos webhooks `withdrawal_completed` e `withdrawal_failed` para facilitar a reconciliação com seus sistemas internos.",
            "example": "saque-empresa-001"
          }
        },
        "required": [
          "pixKey",
          "pixKeyType",
          "holderName",
          "holderDocument",
          "holderDocumentType"
        ]
      },
      "GetExternalWithdrawalOutput": {
        "type": "object",
        "description": "Dados do saque criado.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID do saque",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "projectId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "ID do projeto do saque (null quando não informado na criação e a conta tem 2+ projetos)",
            "example": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          },
          "amount": {
            "type": "number",
            "description": "Valor do saque em BRL",
            "example": 150.75
          },
          "feeAmount": {
            "type": "number",
            "description": "Valor da taxa em BRL",
            "example": 2.5
          },
          "netAmount": {
            "type": "number",
            "description": "Valor líquido em BRL",
            "example": 148.25
          },
          "status": {
            "type": "string",
            "enum": ["pending", "processing", "completed", "failed"],
            "description": "Status do saque",
            "example": "completed"
          },
          "snapshotPixKey": {
            "type": "string",
            "nullable": true,
            "description": "Chave PIX usada no momento do saque",
            "example": "12345678901"
          },
          "snapshotPixKeyType": {
            "type": "string",
            "enum": ["cpf", "cnpj", "email", "phone", "random"],
            "nullable": true,
            "description": "Tipo da chave PIX usada no momento do saque",
            "example": "cpf"
          },
          "snapshotHolderName": {
            "type": "string",
            "description": "Nome do titular no momento do saque",
            "example": "João da Silva"
          },
          "snapshotHolderDocument": {
            "type": "string",
            "description": "Documento do titular no momento do saque",
            "example": "12345678901"
          },
          "failureReason": {
            "type": "string",
            "nullable": true,
            "description": "Motivo da falha (quando status = failed)",
            "example": null
          },
          "pspReference": {
            "type": "string",
            "nullable": true,
            "description": "Referência do PSP (provedor de pagamento)",
            "example": null
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data de criação",
            "example": "2026-02-10T14:30:00.000Z"
          },
          "processedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Data de processamento",
            "example": "2026-02-10T14:30:01.000Z"
          },
          "externalReference": {
            "type": "string",
            "nullable": true,
            "description": "Sua referência externa enviada na criação do saque (opcional)",
            "example": "saque-empresa-001"
          }
        },
        "required": [
          "id",
          "amount",
          "feeAmount",
          "netAmount",
          "status",
          "snapshotHolderName",
          "snapshotHolderDocument",
          "createdAt"
        ]
      },
      "RequestRefundInput": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 255,
            "description": "Motivo do reembolso (opcional, máximo 255 caracteres)",
            "example": "Cliente solicitou cancelamento"
          }
        }
      },
      "RequestRefundOutput": {
        "type": "object",
        "properties": {
          "originalTransactionId": {
            "type": "string",
            "format": "uuid",
            "description": "ID da transação original que está sendo reembolsada"
          },
          "pspProvider": {
            "type": "string",
            "description": "Provedor PSP que processou o reembolso"
          },
          "pspRefundTransactionId": {
            "type": "string",
            "description": "ID da transação de reembolso no PSP"
          },
          "status": {
            "type": "string",
            "enum": ["PENDING", "CONFIRMED", "ERROR"],
            "description": "Status retornado pelo PSP. PENDING significa que o reembolso foi aceito mas ainda não foi confirmado — a confirmação chega via webhook `refund_completed`.",
            "example": "PENDING"
          }
        },
        "required": [
          "originalTransactionId",
          "pspProvider",
          "pspRefundTransactionId",
          "status"
        ]
      },
      "BalanceAmountDetail": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Saldo em centavos",
            "example": 150000
          },
          "amountFormatted": {
            "type": "number",
            "description": "Saldo formatado em reais (amount / 100)",
            "example": 1500.0
          }
        },
        "required": ["amount", "amountFormatted"]
      },
      "AccountInfoDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID da conta"
          },
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "pending",
              "pending_documents",
              "pending_approval",
              "rejected",
              "suspended"
            ],
            "description": "Status da conta"
          }
        },
        "required": ["id", "status"]
      },
      "BalanceInfoDetail": {
        "type": "object",
        "properties": {
          "available": {
            "$ref": "#/components/schemas/BalanceAmountDetail",
            "description": "Saldo disponível (conta principal)"
          },
          "promotional": {
            "$ref": "#/components/schemas/BalanceAmountDetail",
            "description": "Saldo promocional"
          },
          "held": {
            "$ref": "#/components/schemas/BalanceAmountDetail",
            "description": "Saldo bloqueado"
          },
          "total": {
            "$ref": "#/components/schemas/BalanceAmountDetail",
            "description": "Saldo total (disponível + promocional)"
          },
          "currency": {
            "type": "string",
            "description": "Código da moeda",
            "example": "BRL"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data da última atualização do saldo"
          }
        },
        "required": [
          "available",
          "promotional",
          "held",
          "total",
          "currency",
          "updatedAt"
        ]
      },
      "GetAccountInfoOutput": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/AccountInfoDetail",
            "description": "Dados da conta"
          },
          "balance": {
            "$ref": "#/components/schemas/BalanceInfoDetail",
            "description": "Saldo da conta"
          }
        },
        "required": ["account", "balance"]
      },
      "ForbiddenErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 403
          },
          "error": {
            "type": "string",
            "example": "Forbidden"
          },
          "message": {
            "type": "string",
            "example": "You do not have permission to access this resource"
          },
          "details": {
            "type": "object"
          },
          "timestamp": {
            "type": "string",
            "example": "2025-12-15T22:00:00.000Z"
          },
          "traceId": {
            "type": "string"
          }
        },
        "required": ["statusCode", "error", "message", "timestamp"]
      },
      "CreateSubAccountInput": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "description": "Identificador da subconta definido por você. Único dentro da conta e imutável depois da criação. `principal` é palavra reservada da conta principal e não pode ser usada: devolve `400 SUB_ACCOUNT_INVALID_REFERENCE`.",
            "pattern": "^[a-z0-9][a-z0-9_-]{1,31}$",
            "example": "loja-centro"
          },
          "name": {
            "type": "string",
            "description": "Nome de exibição da subconta",
            "maxLength": 255,
            "example": "Loja Centro"
          }
        },
        "required": ["reference", "name"]
      },
      "CreateSubAccountOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID da subconta",
            "format": "uuid"
          },
          "reference": {
            "type": "string",
            "description": "Reference da subconta",
            "example": "loja-centro"
          },
          "name": {
            "type": "string",
            "description": "Nome da subconta",
            "example": "Loja Centro"
          },
          "status": {
            "type": "string",
            "description": "Status da subconta",
            "example": "approved"
          },
          "createdAt": {
            "type": "string",
            "description": "Data de criação",
            "format": "date-time"
          }
        },
        "required": ["id", "reference", "name", "status", "createdAt"]
      },
      "GetAllSubAccountsOutput": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Lista de subcontas da conta",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateSubAccountOutput"
            }
          }
        },
        "required": ["data"]
      }
    }
  }
}
