{
  "components" : {
    "responses" : {
      "AssinaturaBloqueada" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "Assinatura bloqueada"
      },
      "DadoInvalido" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "Dado inválido ou faltando (a frase em `message` diz qual)"
      },
      "LimiteDeUso" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "Limite de uso: espere os segundos do cabeçalho `Retry-After`"
      },
      "NaoEncontrado" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "Não encontrado"
      },
      "RegraNaoDeixa" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "A regra não deixa (por exemplo, excluir uma conta paga)"
      },
      "SemChave" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "Chave inválida, vencida ou desligada"
      },
      "SemPermissao" : {
        "content" : {
          "application/json" : {
            "schema" : {
              "$ref" : "#/components/schemas/Erro"
            }
          }
        },
        "description" : "Sem a permissão ou fora do plano"
      }
    },
    "schemas" : {
      "AccountRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "categoryId" : {
            "description" : "A categoria (veja GET /v1/categories).",
            "format" : "uuid",
            "type" : "string"
          },
          "categoryName" : {
            "description" : "Ou o nome da categoria, no lugar do `categoryId`.",
            "type" : "string"
          },
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          },
          "customerName" : {
            "description" : "Ou o nome do cliente, no lugar do `customerId`.",
            "type" : "string"
          },
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "dueDate" : {
            "description" : "Vencimento (AAAA-MM-DD).",
            "type" : "string"
          },
          "supplierId" : {
            "description" : "O fornecedor (conta a pagar).",
            "format" : "uuid",
            "type" : "string"
          },
          "supplierName" : {
            "description" : "Ou o nome do fornecedor, no lugar do `supplierId`.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "AccountView" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "bankAccount" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "category" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "counterpart" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "description" : {
            "type" : "string"
          },
          "dueDate" : {
            "format" : "date",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "settledAmount" : {
            "type" : "number"
          },
          "settledAt" : {
            "format" : "date",
            "type" : "string"
          },
          "settlementMethod" : {
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "statusLabel" : {
            "type" : "string"
          },
          "writeOffReason" : {
            "type" : "string"
          },
          "writtenOffAt" : {
            "format" : "date",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "BalancesView" : {
        "properties" : {
          "date" : {
            "format" : "date",
            "type" : "string"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/BankAccountView"
            },
            "type" : "array"
          },
          "total" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "BankAccountView" : {
        "properties" : {
          "balance" : {
            "type" : "number"
          },
          "bank" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "integrated" : {
            "type" : "boolean"
          },
          "name" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CancelInvoiceRequest" : {
        "properties" : {
          "reason" : {
            "description" : "O motivo do cancelamento, com 15 letras ou mais.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CancelRequest" : {
        "properties" : {
          "date" : {
            "description" : "Data (AAAA-MM-DD). Padrão: hoje.",
            "type" : "string"
          },
          "reason" : {
            "description" : "O motivo.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CashFlowPeriod" : {
        "properties" : {
          "balance" : {
            "type" : "number"
          },
          "date" : {
            "format" : "date",
            "type" : "string"
          },
          "inflows" : {
            "type" : "number"
          },
          "outflows" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "CashFlowView" : {
        "properties" : {
          "finalBalance" : {
            "type" : "number"
          },
          "from" : {
            "format" : "date",
            "type" : "string"
          },
          "grouping" : {
            "type" : "string"
          },
          "initialBalance" : {
            "type" : "number"
          },
          "periods" : {
            "items" : {
              "$ref" : "#/components/schemas/CashFlowPeriod"
            },
            "type" : "array"
          },
          "to" : {
            "format" : "date",
            "type" : "string"
          },
          "totalInflows" : {
            "type" : "number"
          },
          "totalOutflows" : {
            "type" : "number"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CategoryView" : {
        "properties" : {
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CodeMatch" : {
        "properties" : {
          "brand" : {
            "type" : "string"
          },
          "code" : {
            "type" : "string"
          },
          "label" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CodeView" : {
        "properties" : {
          "brand" : {
            "type" : "string"
          },
          "code" : {
            "type" : "string"
          },
          "type" : {
            "enum" : [ "COMMERCIAL", "OEM", "MANUFACTURER", "UNIVERSAL", "OTHER" ],
            "type" : "string"
          },
          "typeLabel" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "ConversationDetailView" : {
        "properties" : {
          "conversation" : {
            "$ref" : "#/components/schemas/ConversationView"
          },
          "hasMore" : {
            "type" : "boolean"
          },
          "messages" : {
            "items" : {
              "$ref" : "#/components/schemas/MessageView"
            },
            "type" : "array"
          }
        },
        "type" : "object"
      },
      "ConversationView" : {
        "properties" : {
          "assignee" : {
            "type" : "string"
          },
          "contactName" : {
            "type" : "string"
          },
          "contactPhone" : {
            "type" : "string"
          },
          "customerId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "lastMessageAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "lastMessagePreview" : {
            "type" : "string"
          },
          "opportunityId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "unreadCount" : {
            "format" : "int32",
            "type" : "integer"
          },
          "windowClosesAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "windowOpen" : {
            "type" : "boolean"
          }
        },
        "type" : "object"
      },
      "ConvertCustomerInput" : {
        "properties" : {
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "ConvertRequest" : {
        "properties" : {
          "to" : {
            "description" : "SALE (pedido de venda, o padrão) ou SERVICE (ordem de serviço).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CostCenterView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "code" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CreditNoteRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "kind" : {
            "type" : "string"
          },
          "reason" : {
            "description" : "O motivo.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CustomerCreateInput" : {
        "properties" : {
          "city" : {
            "description" : "Cidade.",
            "type" : "string"
          },
          "document" : {
            "description" : "CPF ou CNPJ, com ou sem pontuação.",
            "type" : "string"
          },
          "email" : {
            "description" : "E-mail.",
            "type" : "string"
          },
          "name" : {
            "description" : "Nome (ou razão social).",
            "type" : "string"
          },
          "personType" : {
            "description" : "FISICA ou JURIDICA (ou PF e PJ). Sem ele, vale o tamanho do documento.",
            "type" : "string"
          },
          "phone" : {
            "description" : "Telefone.",
            "type" : "string"
          },
          "state" : {
            "description" : "UF, com duas letras.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "CustomerView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "city" : {
            "type" : "string"
          },
          "document" : {
            "type" : "string"
          },
          "email" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          },
          "personType" : {
            "type" : "string"
          },
          "phone" : {
            "type" : "string"
          },
          "state" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "DebitNoteRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "kind" : {
            "type" : "string"
          },
          "receivableId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "saleId" : {
            "description" : "O pedido de venda ou a ordem de serviço de origem.",
            "format" : "uuid",
            "type" : "string"
          },
          "stockAdjustmentId" : {
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "DreCategory" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "name" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "DreGroup" : {
        "properties" : {
          "categories" : {
            "items" : {
              "$ref" : "#/components/schemas/DreCategory"
            },
            "type" : "array"
          },
          "line" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "Erro" : {
        "description" : "O erro: o código HTTP e uma frase em `message`.",
        "properties" : {
          "error" : {
            "description" : "O código do erro",
            "type" : "string"
          },
          "message" : {
            "description" : "O que aconteceu, em português",
            "type" : "string"
          },
          "status" : {
            "description" : "O código HTTP",
            "type" : "integer"
          }
        },
        "required" : [ "message" ],
        "type" : "object"
      },
      "Forecast" : {
        "properties" : {
          "bySalesperson" : {
            "items" : {
              "$ref" : "#/components/schemas/ForecastGroup"
            },
            "type" : "array"
          },
          "endDate" : {
            "format" : "date",
            "type" : "string"
          },
          "lines" : {
            "items" : {
              "$ref" : "#/components/schemas/ForecastLine"
            },
            "type" : "array"
          },
          "months" : {
            "items" : {
              "$ref" : "#/components/schemas/ForecastMonth"
            },
            "type" : "array"
          },
          "pipelineId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "pipelineName" : {
            "type" : "string"
          },
          "startDate" : {
            "format" : "date",
            "type" : "string"
          },
          "totals" : {
            "$ref" : "#/components/schemas/ForecastTotals"
          }
        },
        "type" : "object"
      },
      "ForecastGroup" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "count" : {
            "format" : "int64",
            "type" : "integer"
          },
          "name" : {
            "type" : "string"
          },
          "weighted" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "ForecastLine" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "bucket" : {
            "type" : "string"
          },
          "expectedCloseDate" : {
            "format" : "date",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "party" : {
            "type" : "string"
          },
          "probability" : {
            "format" : "int32",
            "type" : "integer"
          },
          "salesperson" : {
            "type" : "string"
          },
          "stage" : {
            "type" : "string"
          },
          "title" : {
            "type" : "string"
          },
          "weighted" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "ForecastMonth" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "count" : {
            "format" : "int64",
            "type" : "integer"
          },
          "month" : {
            "type" : "string"
          },
          "weighted" : {
            "type" : "number"
          },
          "wonAmount" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "ForecastTotals" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "count" : {
            "format" : "int64",
            "type" : "integer"
          },
          "overdueAmount" : {
            "type" : "number"
          },
          "overdueCount" : {
            "format" : "int64",
            "type" : "integer"
          },
          "overdueWeighted" : {
            "type" : "number"
          },
          "undatedAmount" : {
            "type" : "number"
          },
          "undatedCount" : {
            "format" : "int64",
            "type" : "integer"
          },
          "undatedWeighted" : {
            "type" : "number"
          },
          "weighted" : {
            "type" : "number"
          },
          "wonAmount" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "IncomeStatementView" : {
        "properties" : {
          "breakdown" : {
            "items" : {
              "$ref" : "#/components/schemas/DreGroup"
            },
            "type" : "array"
          },
          "contributionMargin" : {
            "type" : "number"
          },
          "contributionMarginPercent" : {
            "type" : "number"
          },
          "costs" : {
            "type" : "number"
          },
          "deductions" : {
            "type" : "number"
          },
          "grossRevenue" : {
            "type" : "number"
          },
          "mode" : {
            "type" : "string"
          },
          "month" : {
            "format" : "int32",
            "type" : "integer"
          },
          "netResult" : {
            "type" : "number"
          },
          "netRevenue" : {
            "type" : "number"
          },
          "nonOperatingExpenses" : {
            "type" : "number"
          },
          "nonOperatingRevenue" : {
            "type" : "number"
          },
          "operatingExpenses" : {
            "type" : "number"
          },
          "operatingResult" : {
            "type" : "number"
          },
          "previousMonthNetResult" : {
            "type" : "number"
          },
          "year" : {
            "format" : "int32",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "InstallmentRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "dueDate" : {
            "description" : "Vencimento (AAAA-MM-DD).",
            "format" : "date",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "InvoiceInput" : {
        "properties" : {
          "bankAccountId" : {
            "description" : "A conta bancária (veja GET /v1/bank-accounts).",
            "format" : "uuid",
            "type" : "string"
          },
          "billingType" : {
            "description" : "Na cobrança pelo banco: BOLETO, PIX, CREDIT_CARD ou UNDEFINED (o cliente escolhe).",
            "type" : "string"
          },
          "chargeCategoryId" : {
            "description" : "A categoria da conta a receber da cobrança.",
            "format" : "uuid",
            "type" : "string"
          },
          "chargeMethod" : {
            "description" : "Como o cliente paga: BANK (cobrança pelo banco), PIX_KEY (PIX pela chave) ou NONE (sem cobrança). Sem ele, o que está no pedido.",
            "type" : "string"
          },
          "invoiceNoteWhen" : {
            "description" : "A nota: APPROVAL (sai ao faturar) ou ON_PAYMENT (quando o cliente pagar). Sem ele, não emite. Precisa da permissão `invoices:issue`.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "InvoiceItemRequest" : {
        "properties" : {
          "description" : {
            "description" : "Outra descrição na nota (opcional; padrão: o nome do produto).",
            "type" : "string"
          },
          "discount" : {
            "description" : "Desconto em reais.",
            "type" : "number"
          },
          "productId" : {
            "description" : "O produto (os dados fiscais vêm do cadastro).",
            "format" : "uuid",
            "type" : "string"
          },
          "quantity" : {
            "description" : "Quantidade.",
            "type" : "number"
          },
          "unitPrice" : {
            "description" : "Preço unitário. Padrão: o preço do cadastro.",
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "InvoicePreview" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "bankAccount" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "canInvoice" : {
            "type" : "boolean"
          },
          "chargeCategory" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "chargeMethod" : {
            "type" : "string"
          },
          "invoiceNoteWhen" : {
            "type" : "string"
          },
          "nextStep" : {
            "type" : "string"
          },
          "sale" : {
            "$ref" : "#/components/schemas/SaleView"
          },
          "warnings" : {
            "items" : {
              "type" : "string"
            },
            "type" : "array"
          }
        },
        "type" : "object"
      },
      "InvoiceView" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "issuedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "kind" : {
            "type" : "string"
          },
          "number" : {
            "type" : "string"
          },
          "recipient" : {
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "test" : {
            "type" : "boolean"
          }
        },
        "type" : "object"
      },
      "ItemInput" : {
        "properties" : {
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "discount" : {
            "description" : "Desconto em reais.",
            "type" : "number"
          },
          "productId" : {
            "description" : "O produto.",
            "format" : "uuid",
            "type" : "string"
          },
          "quantity" : {
            "description" : "Quantidade.",
            "type" : "number"
          },
          "serviceId" : {
            "description" : "O serviço.",
            "format" : "uuid",
            "type" : "string"
          },
          "type" : {
            "description" : "Só no item sem cadastro: PRODUCT ou SERVICE (o padrão). Com `productId` ou `serviceId`, vale o cadastro.",
            "type" : "string"
          },
          "unitPrice" : {
            "description" : "Preço unitário.",
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "ItemView" : {
        "properties" : {
          "description" : {
            "type" : "string"
          },
          "discount" : {
            "type" : "number"
          },
          "productId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "quantity" : {
            "type" : "number"
          },
          "serviceId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "total" : {
            "type" : "number"
          },
          "type" : {
            "type" : "string"
          },
          "unit" : {
            "type" : "string"
          },
          "unitPrice" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "Me" : {
        "properties" : {
          "access" : {
            "type" : "string"
          },
          "account" : {
            "type" : "string"
          },
          "environment" : {
            "type" : "string"
          },
          "role" : {
            "type" : "string"
          },
          "scopes" : {
            "items" : {
              "type" : "string"
            },
            "type" : "array"
          },
          "user" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "MessageView" : {
        "properties" : {
          "author" : {
            "type" : "string"
          },
          "direction" : {
            "type" : "string"
          },
          "fileName" : {
            "type" : "string"
          },
          "hasMedia" : {
            "type" : "boolean"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "sentAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "text" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "MoveInput" : {
        "properties" : {
          "lostNote" : {
            "description" : "Anotação da perda.",
            "type" : "string"
          },
          "lostReasonId" : {
            "description" : "O motivo da perda (para marcar como perdida).",
            "format" : "uuid",
            "type" : "string"
          },
          "stage" : {
            "description" : "Ou o nome da etapa, no lugar do `stageId`.",
            "type" : "string"
          },
          "stageId" : {
            "description" : "A etapa (veja GET /v1/opportunities/stages).",
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "MovementInput" : {
        "properties" : {
          "date" : {
            "description" : "Data (AAAA-MM-DD). Padrão: hoje.",
            "format" : "date",
            "type" : "string"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          },
          "productId" : {
            "description" : "O produto.",
            "format" : "uuid",
            "type" : "string"
          },
          "quantity" : {
            "description" : "Quantidade.",
            "type" : "number"
          },
          "type" : {
            "description" : "in (entrada) ou out (saída).",
            "type" : "string"
          },
          "unitCost" : {
            "description" : "Custo unitário (opcional).",
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "MovementView" : {
        "properties" : {
          "by" : {
            "type" : "string"
          },
          "date" : {
            "format" : "date-time",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "notes" : {
            "type" : "string"
          },
          "product" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "quantity" : {
            "type" : "number"
          },
          "resultingBalance" : {
            "type" : "number"
          },
          "source" : {
            "type" : "string"
          },
          "totalCost" : {
            "type" : "number"
          },
          "type" : {
            "type" : "string"
          },
          "unitCost" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "NfcePaymentRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "method" : {
            "description" : "CASH, PIX, CREDIT_CARD, DEBIT_CARD, MEAL_VOUCHER, FOOD_VOUCHER, GIFT_CARD, FUEL_VOUCHER, STORE_CREDIT, CHECK, BOLETO, DEPOSIT, BANK_TRANSFER, PIX_STATIC, LOYALTY ou OTHER (ou o código de dois dígitos da SEFAZ).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "NfceRequest" : {
        "properties" : {
          "companyId" : {
            "description" : "A empresa que emite (quando a conta tem mais de uma).",
            "format" : "uuid",
            "type" : "string"
          },
          "consumerDocument" : {
            "description" : "CPF ou CNPJ do consumidor (opcional).",
            "type" : "string"
          },
          "discount" : {
            "description" : "Desconto em reais.",
            "type" : "number"
          },
          "items" : {
            "description" : "Os itens. No PATCH, a lista troca todos os itens.",
            "items" : {
              "$ref" : "#/components/schemas/InvoiceItemRequest"
            },
            "type" : "array"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          },
          "payments" : {
            "description" : "Como o consumidor pagou: `method` e `amount`. Uma forma só sem `amount` vale o total; o que passar do total vira troco.",
            "items" : {
              "$ref" : "#/components/schemas/NfcePaymentRequest"
            },
            "type" : "array"
          }
        },
        "type" : "object"
      },
      "NfeDraftRequest" : {
        "properties" : {
          "bankAccountId" : {
            "description" : "A conta bancária das contas a receber (opcional).",
            "format" : "uuid",
            "type" : "string"
          },
          "categoryId" : {
            "description" : "A categoria das contas a receber da nota (veja GET /v1/categories).",
            "format" : "uuid",
            "type" : "string"
          },
          "companyId" : {
            "description" : "A empresa que emite (quando a conta tem mais de uma).",
            "format" : "uuid",
            "type" : "string"
          },
          "createReceivables" : {
            "description" : "Lança as contas a receber na autorização (padrão true).",
            "type" : "boolean"
          },
          "customerId" : {
            "description" : "O cliente (nota sem pedido).",
            "format" : "uuid",
            "type" : "string"
          },
          "discount" : {
            "description" : "Desconto na nota, em reais.",
            "type" : "number"
          },
          "freight" : {
            "description" : "Frete, em reais.",
            "type" : "number"
          },
          "installments" : {
            "description" : "As parcelas: `dueDate` e `amount`. Sem elas, à vista.",
            "items" : {
              "$ref" : "#/components/schemas/InstallmentRequest"
            },
            "type" : "array"
          },
          "items" : {
            "description" : "Os produtos (nota sem pedido).",
            "items" : {
              "$ref" : "#/components/schemas/InvoiceItemRequest"
            },
            "type" : "array"
          },
          "natureId" : {
            "description" : "A natureza de operação. Padrão: a da empresa em Configurações NF.",
            "format" : "uuid",
            "type" : "string"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          },
          "paymentMethod" : {
            "description" : "Como o cliente paga: PIX, BOLETO, CREDIT_CARD, DEBIT_CARD, BANK_TRANSFER ou CASH.",
            "type" : "string"
          },
          "saleId" : {
            "description" : "O pedido de venda (no lugar de `customerId` e `items`).",
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "NfeView" : {
        "properties" : {
          "accessKey" : {
            "type" : "string"
          },
          "cancellableUntil" : {
            "format" : "date-time",
            "type" : "string"
          },
          "creditDebitLabel" : {
            "type" : "string"
          },
          "creditDebitType" : {
            "type" : "string"
          },
          "customer" : {
            "type" : "string"
          },
          "customerId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "environment" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "issuedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "model" : {
            "type" : "string"
          },
          "number" : {
            "format" : "int64",
            "type" : "integer"
          },
          "originAccessKey" : {
            "type" : "string"
          },
          "originId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "problems" : {
            "items" : {
              "type" : "string"
            },
            "type" : "array"
          },
          "purpose" : {
            "type" : "string"
          },
          "saleId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "series" : {
            "format" : "int32",
            "type" : "integer"
          },
          "status" : {
            "type" : "string"
          },
          "statusMessage" : {
            "type" : "string"
          },
          "total" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "NfseDraftRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "companyId" : {
            "description" : "A empresa que emite (quando a conta tem mais de uma).",
            "format" : "uuid",
            "type" : "string"
          },
          "competenceDate" : {
            "description" : "Competência (AAAA-MM-DD). Padrão: hoje.",
            "format" : "date",
            "type" : "string"
          },
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          },
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "saleId" : {
            "description" : "O pedido de venda ou a ordem de serviço de origem.",
            "format" : "uuid",
            "type" : "string"
          },
          "serviceId" : {
            "description" : "O serviço.",
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "NfseView" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "company" : {
            "type" : "string"
          },
          "competenceDate" : {
            "format" : "date",
            "type" : "string"
          },
          "customer" : {
            "type" : "string"
          },
          "customerId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "description" : {
            "type" : "string"
          },
          "homologation" : {
            "type" : "boolean"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "issAmount" : {
            "type" : "number"
          },
          "issuedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "netAmount" : {
            "type" : "number"
          },
          "number" : {
            "type" : "string"
          },
          "pdfUrl" : {
            "type" : "string"
          },
          "portalErrors" : {
            "type" : "string"
          },
          "problems" : {
            "items" : {
              "type" : "string"
            },
            "type" : "array"
          },
          "saleId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "OpportunityContact" : {
        "properties" : {
          "company" : {
            "type" : "string"
          },
          "email" : {
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          },
          "phone" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "OpportunityInput" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "contact" : {
            "$ref" : "#/components/schemas/OpportunityContact"
          },
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          },
          "expectedCloseDate" : {
            "description" : "Previsão de fechamento (AAAA-MM-DD).",
            "format" : "date",
            "type" : "string"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          },
          "pipeline" : {
            "description" : "Ou o nome do funil, no lugar do `pipelineId`.",
            "type" : "string"
          },
          "pipelineId" : {
            "description" : "O funil (veja GET /v1/opportunities/pipelines). Sem ele, o padrão.",
            "format" : "uuid",
            "type" : "string"
          },
          "stageId" : {
            "description" : "A etapa (veja GET /v1/opportunities/stages).",
            "format" : "uuid",
            "type" : "string"
          },
          "title" : {
            "description" : "Título.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "OpportunityView" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "closedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "contact" : {
            "$ref" : "#/components/schemas/OpportunityContact"
          },
          "customer" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "expectedCloseDate" : {
            "format" : "date",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "idleDays" : {
            "format" : "int32",
            "type" : "integer"
          },
          "lastTouchedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "pipeline" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "probability" : {
            "format" : "int32",
            "type" : "integer"
          },
          "quotationId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "salesperson" : {
            "type" : "string"
          },
          "stage" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "stageCategory" : {
            "type" : "string"
          },
          "stale" : {
            "type" : "boolean"
          },
          "title" : {
            "type" : "string"
          },
          "weightedAmount" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "Option" : {
        "properties" : {
          "available" : {
            "type" : "boolean"
          },
          "code" : {
            "type" : "string"
          },
          "label" : {
            "type" : "string"
          },
          "maxAmount" : {
            "type" : "number"
          },
          "reason" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "Outcome" : {
        "properties" : {
          "invoice" : {
            "type" : "object"
          },
          "message" : {
            "type" : "string"
          },
          "simulated" : {
            "type" : "boolean"
          }
        },
        "type" : "object"
      },
      "PageResultAccountView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/AccountView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultConversationView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/ConversationView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultCustomerView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/CustomerView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultInvoiceView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/InvoiceView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultMovementView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/MovementView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultOpportunityView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/OpportunityView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultProductView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/ProductView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultPurchaseSummaryView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/PurchaseSummaryView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultQuotationView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/QuotationView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultSaleSummary" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/SaleSummary"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultServiceView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/ServiceView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultStatementEntryView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/StatementEntryView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PageResultSupplierView" : {
        "properties" : {
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/SupplierView"
            },
            "type" : "array"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PatchRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "categoryId" : {
            "description" : "A categoria (veja GET /v1/categories).",
            "format" : "uuid",
            "type" : "string"
          },
          "categoryName" : {
            "description" : "Ou o nome da categoria, no lugar do `categoryId`.",
            "type" : "string"
          },
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          },
          "customerName" : {
            "description" : "Ou o nome do cliente, no lugar do `customerId`.",
            "type" : "string"
          },
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "dueDate" : {
            "description" : "Vencimento (AAAA-MM-DD).",
            "type" : "string"
          },
          "supplierId" : {
            "description" : "O fornecedor (conta a pagar).",
            "format" : "uuid",
            "type" : "string"
          },
          "supplierName" : {
            "description" : "Ou o nome do fornecedor, no lugar do `supplierId`.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "PersonInput" : {
        "properties" : {
          "city" : {
            "description" : "Cidade.",
            "type" : "string"
          },
          "complement" : {
            "description" : "Complemento.",
            "type" : "string"
          },
          "district" : {
            "description" : "Bairro.",
            "type" : "string"
          },
          "document" : {
            "description" : "CPF ou CNPJ, com ou sem pontuação.",
            "type" : "string"
          },
          "email" : {
            "description" : "E-mail.",
            "type" : "string"
          },
          "name" : {
            "description" : "Nome (ou razão social).",
            "type" : "string"
          },
          "number" : {
            "description" : "Número.",
            "type" : "string"
          },
          "personType" : {
            "description" : "FISICA ou JURIDICA (ou PF e PJ). Sem ele, vale o tamanho do documento.",
            "type" : "string"
          },
          "phone" : {
            "description" : "Telefone.",
            "type" : "string"
          },
          "state" : {
            "description" : "UF, com duas letras.",
            "type" : "string"
          },
          "stateRegistration" : {
            "description" : "Inscrição estadual.",
            "type" : "string"
          },
          "street" : {
            "description" : "Rua.",
            "type" : "string"
          },
          "tradeName" : {
            "description" : "Nome fantasia.",
            "type" : "string"
          },
          "zipCode" : {
            "description" : "CEP.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "PipelineStageView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "category" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          },
          "probability" : {
            "format" : "int32",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PipelineView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "isDefault" : {
            "type" : "boolean"
          },
          "name" : {
            "type" : "string"
          },
          "stages" : {
            "items" : {
              "$ref" : "#/components/schemas/PipelineStageView"
            },
            "type" : "array"
          },
          "staleDays" : {
            "format" : "int32",
            "type" : "integer"
          }
        },
        "type" : "object"
      },
      "PositionPageView" : {
        "properties" : {
          "belowMinimum" : {
            "format" : "int64",
            "type" : "integer"
          },
          "hasMore" : {
            "type" : "boolean"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/PositionView"
            },
            "type" : "array"
          },
          "negative" : {
            "format" : "int64",
            "type" : "integer"
          },
          "page" : {
            "format" : "int32",
            "type" : "integer"
          },
          "size" : {
            "format" : "int32",
            "type" : "integer"
          },
          "total" : {
            "format" : "int64",
            "type" : "integer"
          },
          "totalValue" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "PositionView" : {
        "properties" : {
          "available" : {
            "type" : "number"
          },
          "averageCost" : {
            "type" : "number"
          },
          "balance" : {
            "type" : "number"
          },
          "code" : {
            "type" : "string"
          },
          "lastMovement" : {
            "format" : "date-time",
            "type" : "string"
          },
          "minimum" : {
            "type" : "number"
          },
          "name" : {
            "type" : "string"
          },
          "productId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "reserved" : {
            "type" : "number"
          },
          "situation" : {
            "type" : "string"
          },
          "unit" : {
            "type" : "string"
          },
          "value" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "Preview" : {
        "properties" : {
          "invoice" : {
            "type" : "object"
          },
          "nextStep" : {
            "type" : "string"
          },
          "problems" : {
            "items" : {
              "type" : "string"
            },
            "type" : "array"
          },
          "ready" : {
            "type" : "boolean"
          },
          "sandbox" : {
            "type" : "boolean"
          },
          "taxes" : {
            "type" : "object"
          }
        },
        "type" : "object"
      },
      "ProductInput" : {
        "properties" : {
          "code" : {
            "description" : "Código interno.",
            "type" : "string"
          },
          "cost" : {
            "description" : "Custo.",
            "type" : "number"
          },
          "gtin" : {
            "description" : "Código de barras (GTIN/EAN).",
            "type" : "string"
          },
          "minimumStock" : {
            "description" : "Estoque mínimo (abaixo dele, o produto aparece em below_minimum).",
            "type" : "number"
          },
          "name" : {
            "description" : "Nome (ou razão social).",
            "type" : "string"
          },
          "ncm" : {
            "description" : "NCM, com 8 dígitos.",
            "type" : "string"
          },
          "price" : {
            "description" : "Preço de venda.",
            "type" : "number"
          },
          "stockControl" : {
            "description" : "Controla o estoque deste produto.",
            "type" : "boolean"
          },
          "unit" : {
            "description" : "Unidade (UN, KG, H...).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "ProductView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "available" : {
            "type" : "number"
          },
          "balance" : {
            "type" : "number"
          },
          "code" : {
            "type" : "string"
          },
          "cost" : {
            "type" : "number"
          },
          "gtin" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "matchedCode" : {
            "$ref" : "#/components/schemas/CodeMatch"
          },
          "minimumStock" : {
            "type" : "number"
          },
          "name" : {
            "type" : "string"
          },
          "ncm" : {
            "type" : "string"
          },
          "otherCodes" : {
            "items" : {
              "$ref" : "#/components/schemas/CodeView"
            },
            "type" : "array"
          },
          "price" : {
            "type" : "number"
          },
          "stockControl" : {
            "type" : "boolean"
          },
          "unit" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "PurchaseInput" : {
        "properties" : {
          "deliveryDate" : {
            "description" : "Previsão de entrega (AAAA-MM-DD).",
            "format" : "date",
            "type" : "string"
          },
          "items" : {
            "description" : "Os itens. No PATCH, a lista troca todos os itens.",
            "items" : {
              "$ref" : "#/components/schemas/PurchaseItemInput"
            },
            "type" : "array"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          },
          "paymentTerms" : {
            "description" : "Condição de pagamento (texto livre, como 30/60 dias).",
            "type" : "string"
          },
          "supplierId" : {
            "description" : "O fornecedor (conta a pagar).",
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "PurchaseItemInput" : {
        "properties" : {
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "productId" : {
            "description" : "O produto.",
            "format" : "uuid",
            "type" : "string"
          },
          "quantity" : {
            "description" : "Quantidade.",
            "type" : "number"
          },
          "unitPrice" : {
            "description" : "Preço unitário.",
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "PurchaseItemView" : {
        "properties" : {
          "description" : {
            "type" : "string"
          },
          "product" : {
            "type" : "string"
          },
          "productId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "quantity" : {
            "type" : "number"
          },
          "receivedQuantity" : {
            "type" : "number"
          },
          "total" : {
            "type" : "number"
          },
          "unit" : {
            "type" : "string"
          },
          "unitPrice" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "PurchaseSendInput" : {
        "properties" : {
          "email" : {
            "description" : "Para quem vai. Padrão: o contato do pedido ou o e-mail do fornecedor.",
            "type" : "string"
          },
          "message" : {
            "description" : "Mensagem que vai no e-mail (opcional).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "PurchaseSummaryView" : {
        "properties" : {
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "itemCount" : {
            "format" : "int32",
            "type" : "integer"
          },
          "late" : {
            "type" : "boolean"
          },
          "nextDelivery" : {
            "format" : "date",
            "type" : "string"
          },
          "number" : {
            "format" : "int64",
            "type" : "integer"
          },
          "status" : {
            "type" : "string"
          },
          "supplier" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "total" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "PurchaseView" : {
        "properties" : {
          "createdAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/PurchaseItemView"
            },
            "type" : "array"
          },
          "notes" : {
            "type" : "string"
          },
          "number" : {
            "format" : "int64",
            "type" : "integer"
          },
          "paymentTerms" : {
            "type" : "string"
          },
          "sentAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "supplier" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "total" : {
            "type" : "number"
          }
        },
        "type" : "object"
      },
      "QuotationInputApi" : {
        "properties" : {
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          },
          "customerNotes" : {
            "description" : "Observações para o cliente (saem no fim do PDF e do link do orçamento).",
            "type" : "string"
          },
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "discount" : {
            "description" : "Desconto em reais.",
            "type" : "number"
          },
          "installments" : {
            "description" : "Número de parcelas da cobrança.",
            "format" : "int32",
            "type" : "integer"
          },
          "items" : {
            "description" : "Os itens. No PATCH, a lista troca todos os itens.",
            "items" : {
              "$ref" : "#/components/schemas/ItemInput"
            },
            "type" : "array"
          },
          "notes" : {
            "description" : "Observações internas (não saem no documento).",
            "type" : "string"
          },
          "title" : {
            "description" : "Título.",
            "type" : "string"
          },
          "validUntil" : {
            "description" : "Validade (AAAA-MM-DD).",
            "format" : "date",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "QuotationView" : {
        "properties" : {
          "approvedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "convertedId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "convertedTo" : {
            "type" : "string"
          },
          "customer" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "customerNotes" : {
            "type" : "string"
          },
          "discount" : {
            "type" : "number"
          },
          "generatesCharges" : {
            "type" : "boolean"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "invoiceNoteWhen" : {
            "type" : "string"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/ItemView"
            },
            "type" : "array"
          },
          "nextStep" : {
            "type" : "string"
          },
          "number" : {
            "format" : "int32",
            "type" : "integer"
          },
          "status" : {
            "type" : "string"
          },
          "title" : {
            "type" : "string"
          },
          "total" : {
            "type" : "number"
          },
          "validUntil" : {
            "format" : "date",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "Ref" : {
        "properties" : {
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "Result" : {
        "properties" : {
          "id" : {
            "type" : "string"
          },
          "title" : {
            "type" : "string"
          },
          "url" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SaleInput" : {
        "properties" : {
          "customerId" : {
            "description" : "O cliente.",
            "format" : "uuid",
            "type" : "string"
          },
          "discount" : {
            "description" : "Desconto em reais.",
            "type" : "number"
          },
          "expectedDate" : {
            "description" : "Data prevista (AAAA-MM-DD).",
            "format" : "date",
            "type" : "string"
          },
          "internalNotes" : {
            "description" : "Observações internas (não saem no documento).",
            "type" : "string"
          },
          "items" : {
            "description" : "Os itens. No PATCH, a lista troca todos os itens.",
            "items" : {
              "$ref" : "#/components/schemas/ItemInput"
            },
            "type" : "array"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          },
          "salespersonId" : {
            "description" : "O vendedor (para a comissão).",
            "format" : "uuid",
            "type" : "string"
          },
          "statusId" : {
            "description" : "O status (veja GET /v1/sales/statuses).",
            "format" : "uuid",
            "type" : "string"
          },
          "type" : {
            "description" : "SALE (pedido de venda, o padrão) ou SERVICE (ordem de serviço).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SalePatch" : {
        "properties" : {
          "discount" : {
            "description" : "Desconto em reais.",
            "type" : "number"
          },
          "expectedDate" : {
            "description" : "Data prevista (AAAA-MM-DD).",
            "format" : "date",
            "type" : "string"
          },
          "internalNotes" : {
            "description" : "Observações internas (não saem no documento).",
            "type" : "string"
          },
          "items" : {
            "description" : "Os itens. No PATCH, a lista troca todos os itens.",
            "items" : {
              "$ref" : "#/components/schemas/ItemInput"
            },
            "type" : "array"
          },
          "notes" : {
            "description" : "Observações.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SaleSummary" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "customer" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "issueDate" : {
            "format" : "date",
            "type" : "string"
          },
          "number" : {
            "format" : "int64",
            "type" : "integer"
          },
          "salesperson" : {
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SaleView" : {
        "properties" : {
          "bankAccount" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "chargeCategory" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "chargeMethod" : {
            "type" : "string"
          },
          "customer" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "discount" : {
            "type" : "number"
          },
          "expectedDate" : {
            "format" : "date",
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "invoiceNoteWhen" : {
            "type" : "string"
          },
          "invoicedAt" : {
            "format" : "date-time",
            "type" : "string"
          },
          "invoicedBy" : {
            "type" : "string"
          },
          "issueDate" : {
            "format" : "date",
            "type" : "string"
          },
          "items" : {
            "items" : {
              "$ref" : "#/components/schemas/ItemView"
            },
            "type" : "array"
          },
          "notes" : {
            "type" : "string"
          },
          "number" : {
            "format" : "int64",
            "type" : "integer"
          },
          "productsTotal" : {
            "type" : "number"
          },
          "quotationId" : {
            "format" : "uuid",
            "type" : "string"
          },
          "salesperson" : {
            "type" : "string"
          },
          "servicesTotal" : {
            "type" : "number"
          },
          "shipping" : {
            "type" : "number"
          },
          "status" : {
            "$ref" : "#/components/schemas/Ref"
          },
          "statusCategory" : {
            "type" : "string"
          },
          "total" : {
            "type" : "number"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SendInput" : {
        "properties" : {
          "text" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SendQuotationRequest" : {
        "properties" : {
          "email" : {
            "description" : "Para quem vai. Padrão: o e-mail do cliente.",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SendResult" : {
        "properties" : {
          "document" : {
            "type" : "object"
          },
          "link" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          },
          "simulated" : {
            "type" : "boolean"
          },
          "to" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "ServiceInput" : {
        "properties" : {
          "defaultPrice" : {
            "description" : "Preço.",
            "type" : "number"
          },
          "description" : {
            "description" : "Descrição.",
            "type" : "string"
          },
          "name" : {
            "description" : "Nome (ou razão social).",
            "type" : "string"
          },
          "nationalTaxCode" : {
            "description" : "Código de tributação nacional da NFS-e.",
            "type" : "string"
          },
          "nbsCode" : {
            "description" : "Código NBS.",
            "type" : "string"
          },
          "unit" : {
            "description" : "Unidade (UN, KG, H...).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "ServiceView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "defaultPrice" : {
            "type" : "number"
          },
          "description" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          },
          "nationalTaxCode" : {
            "type" : "string"
          },
          "nbsCode" : {
            "type" : "string"
          },
          "unit" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SettleRequest" : {
        "properties" : {
          "amount" : {
            "description" : "Valor, com ponto (1500.00).",
            "type" : "number"
          },
          "bankAccountId" : {
            "description" : "A conta bancária (veja GET /v1/bank-accounts).",
            "format" : "uuid",
            "type" : "string"
          },
          "bankAccountName" : {
            "description" : "Ou o nome da conta bancária, no lugar do `bankAccountId`.",
            "type" : "string"
          },
          "date" : {
            "description" : "Data (AAAA-MM-DD). Padrão: hoje.",
            "type" : "string"
          },
          "method" : {
            "description" : "Forma: pix (padrão), dinheiro, cartao_de_credito, cartao_de_debito, transferencia, boleto ou cheque.",
            "type" : "string"
          },
          "remainder" : {
            "description" : "Na baixa parcial: open (o restante fica em aberto numa conta nova, o padrão) ou discount (o restante vira desconto).",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SettleResult" : {
        "properties" : {
          "account" : {
            "$ref" : "#/components/schemas/AccountView"
          },
          "remainder" : {
            "$ref" : "#/components/schemas/AccountView"
          }
        },
        "type" : "object"
      },
      "StatementEntryView" : {
        "properties" : {
          "amount" : {
            "type" : "number"
          },
          "awaitingStatement" : {
            "type" : "boolean"
          },
          "balance" : {
            "type" : "number"
          },
          "counterpart" : {
            "type" : "string"
          },
          "date" : {
            "format" : "date",
            "type" : "string"
          },
          "description" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "StatusInput" : {
        "properties" : {
          "note" : {
            "description" : "Anotação que fica no histórico.",
            "type" : "string"
          },
          "status" : {
            "description" : "Ou o nome do status, no lugar do `statusId`.",
            "type" : "string"
          },
          "statusId" : {
            "description" : "O status (veja GET /v1/sales/statuses).",
            "format" : "uuid",
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "SummaryView" : {
        "properties" : {
          "bankBalance" : {
            "type" : "number"
          },
          "date" : {
            "format" : "date",
            "type" : "string"
          },
          "payablesDueToday" : {
            "$ref" : "#/components/schemas/Totals"
          },
          "payablesNext7Days" : {
            "$ref" : "#/components/schemas/Totals"
          },
          "payablesOverdue" : {
            "$ref" : "#/components/schemas/Totals"
          },
          "receivablesDueToday" : {
            "$ref" : "#/components/schemas/Totals"
          },
          "receivablesNext7Days" : {
            "$ref" : "#/components/schemas/Totals"
          },
          "receivablesOverdue" : {
            "$ref" : "#/components/schemas/Totals"
          }
        },
        "type" : "object"
      },
      "SupplierView" : {
        "properties" : {
          "active" : {
            "type" : "boolean"
          },
          "city" : {
            "type" : "string"
          },
          "document" : {
            "type" : "string"
          },
          "email" : {
            "type" : "string"
          },
          "id" : {
            "format" : "uuid",
            "type" : "string"
          },
          "name" : {
            "type" : "string"
          },
          "personType" : {
            "type" : "string"
          },
          "phone" : {
            "type" : "string"
          },
          "state" : {
            "type" : "string"
          }
        },
        "type" : "object"
      },
      "Totals" : {
        "properties" : {
          "count" : {
            "format" : "int64",
            "type" : "integer"
          },
          "total" : {
            "type" : "number"
          }
        },
        "type" : "object"
      }
    },
    "securitySchemes" : {
      "chave" : {
        "bearerFormat" : "wzk_live_... ou wzk_test_...",
        "description" : "A chave da API (Configurações › API e conectores). O Claude e o ChatGPT entram pelo conector, com OAuth, no endereço /api/mcp.",
        "scheme" : "bearer",
        "type" : "http"
      }
    }
  },
  "info" : {
    "contact" : {
      "name" : "WizGestor",
      "url" : "https://wizgestor.com.br/desenvolvedores"
    },
    "description" : "A API do WizGestor: contas a pagar e a receber, financeiro, cadastros, vendas, estoque e notas fiscais.\n\n**Chave:** crie em Configurações › API e conectores e mande no cabeçalho `Authorization: Bearer wzk_...`. A chave `wzk_test_` usa o ambiente de testes (dados de exemplo, notas simuladas); a `wzk_live_`, a empresa de verdade. A resposta diz o ambiente no cabeçalho `X-WizGestor-Environment`.\n\n**Formato:** JSON, datas AAAA-MM-DD, valores com ponto (`1500.00`). Listas em páginas: `page` (começa em 0) e `size` (até 100); a resposta traz `items`, `total` e `hasMore`.\n\n**Limites:** 60 pedidos por minuto por chave e 10.000 por dia na conta. Passou, volta 429 com `Retry-After`.\n\n**Pedido repetido:** nas gravações, mande `Idempotency-Key` (um UUID). O mesmo código em até 48 horas devolve a primeira resposta, com `Idempotent-Replayed: true`.\n\n**Escritório (contador ou BPO):** a chave de produção do escritório age na conta de um cliente com o             cabeçalho `X-Client-Account: <id>` (os ids vêm de `GET /v1/clients`). Só nos clientes que ligaram o acesso             pela IA e pelas chaves, e com o menor entre as permissões da chave e o perfil que o cliente deu.\n\n**Nunca pela API:** pagar boleto ou fazer transferência pelo banco. Pagar e receber aqui só registram o que já aconteceu.",
    "title" : "API do WizGestor",
    "version" : "1"
  },
  "openapi" : "3.1.0",
  "paths" : {
    "/v1/accounts-payable" : {
      "get" : {
        "description" : "Permissão: `accounts:read`.",
        "operationId" : "payables",
        "parameters" : [ {
          "description" : "open (em aberto, o padrão), overdue (vencidas), paid (pagas), written_off (Baixado) ou all.",
          "in" : "query",
          "name" : "status",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Vencimento a partir de (AAAA-MM-DD).",
          "in" : "query",
          "name" : "dueFrom",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Vencimento até (AAAA-MM-DD).",
          "in" : "query",
          "name" : "dueTo",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Parte da descrição ou do nome da outra parte.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultAccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista as contas a pagar",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:read"
      },
      "post" : {
        "description" : "Categoria por `categoryId` ou `categoryName`; o fornecedor por `supplierId` ou `supplierName` (opcional). O nome precisa existir; com mais de um parecido, volta 400 pedindo o id.\n\nPermissão: `accounts:write`.",
        "operationId" : "createPayable",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/AccountRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lança uma conta a pagar",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:write"
      }
    },
    "/v1/accounts-payable/{id}" : {
      "delete" : {
        "description" : "A conta paga ou com Baixado não pode ser excluída (volta 422).\n\nPermissão: `accounts:delete`.",
        "operationId" : "deletePayable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "type" : "object"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Exclui uma conta a pagar em aberto",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:delete"
      },
      "get" : {
        "description" : "Permissão: `accounts:read`.",
        "operationId" : "payable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Uma conta a pagar, com a baixa e o Baixado",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:read"
      },
      "patch" : {
        "description" : "Mande só os campos que mudam.\n\nPermissão: `accounts:write`.",
        "operationId" : "updatePayable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PatchRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera uma conta a pagar",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:write"
      }
    },
    "/v1/accounts-payable/{id}/cancel" : {
      "delete" : {
        "description" : "Permissão: `accounts:delete`.",
        "operationId" : "undoCancelPayable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desfaz o Baixado",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:delete"
      },
      "post" : {
        "description" : "`reason` é obrigatório; `date` é opcional (padrão hoje).\n\nPermissão: `accounts:delete`.",
        "operationId" : "cancelPayable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CancelRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Marca como Baixado (não vai ser paga)",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:delete"
      }
    },
    "/v1/accounts-payable/{id}/settle" : {
      "delete" : {
        "description" : "Permissão: `accounts:settle`.",
        "operationId" : "undoSettlePayable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desfaz o pagamento",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:settle"
      },
      "post" : {
        "description" : "Tudo é opcional: `date` (padrão hoje), `amount` (menor que o da conta = parcial), `method`, `bankAccountId` ou `bankAccountName`. Na parcial, `remainder` diz o que fazer com o restante: open (fica em aberto numa conta nova, o padrão) ou discount (vira desconto). Só registra: nenhum valor é pago ou movimentado no banco.\n\nPermissão: `accounts:settle`.",
        "operationId" : "settlePayable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SettleRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SettleResult"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Registra o pagamento",
        "tags" : [ "Contas a pagar" ],
        "x-wizgestor-scope" : "accounts:settle"
      }
    },
    "/v1/accounts-receivable" : {
      "get" : {
        "description" : "Permissão: `accounts:read`.",
        "operationId" : "receivables",
        "parameters" : [ {
          "description" : "open (em aberto, o padrão), overdue (vencidas), paid (pagas), written_off (Baixado) ou all.",
          "in" : "query",
          "name" : "status",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Vencimento a partir de (AAAA-MM-DD).",
          "in" : "query",
          "name" : "dueFrom",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Vencimento até (AAAA-MM-DD).",
          "in" : "query",
          "name" : "dueTo",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Parte da descrição ou do nome da outra parte.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultAccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista as contas a receber",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:read"
      },
      "post" : {
        "description" : "Categoria por `categoryId` ou `categoryName`; o cliente por `customerId` ou `customerName` (opcional). O nome precisa existir; com mais de um parecido, volta 400 pedindo o id.\n\nPermissão: `accounts:write`.",
        "operationId" : "createReceivable",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/AccountRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lança uma conta a receber",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:write"
      }
    },
    "/v1/accounts-receivable/{id}" : {
      "delete" : {
        "description" : "A conta paga ou com Baixado não pode ser excluída (volta 422).\n\nPermissão: `accounts:delete`.",
        "operationId" : "deleteReceivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "type" : "object"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Exclui uma conta a receber em aberto",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:delete"
      },
      "get" : {
        "description" : "Permissão: `accounts:read`.",
        "operationId" : "receivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Uma conta a receber, com a baixa e o Baixado",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:read"
      },
      "patch" : {
        "description" : "Mande só os campos que mudam.\n\nPermissão: `accounts:write`.",
        "operationId" : "updateReceivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PatchRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera uma conta a receber",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:write"
      }
    },
    "/v1/accounts-receivable/{id}/cancel" : {
      "delete" : {
        "description" : "Permissão: `accounts:delete`.",
        "operationId" : "undoCancelReceivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desfaz o Baixado",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:delete"
      },
      "post" : {
        "description" : "`reason` é obrigatório; `date` é opcional (padrão hoje).\n\nPermissão: `accounts:delete`.",
        "operationId" : "cancelReceivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CancelRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Marca como Baixado (não vai ser recebida)",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:delete"
      }
    },
    "/v1/accounts-receivable/{id}/settle" : {
      "delete" : {
        "description" : "Permissão: `accounts:settle`.",
        "operationId" : "undoSettleReceivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desfaz o recebimento",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:settle"
      },
      "post" : {
        "description" : "Tudo é opcional: `date` (padrão hoje), `amount` (menor que o da conta = parcial), `method`, `bankAccountId` ou `bankAccountName`. Na parcial, `remainder` diz o que fazer com o restante: open (fica em aberto numa conta nova, o padrão) ou discount (vira desconto). Só registra: nenhum valor é pago ou movimentado no banco.\n\nPermissão: `accounts:settle`.",
        "operationId" : "settleReceivable",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SettleRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SettleResult"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Registra o recebimento",
        "tags" : [ "Contas a receber" ],
        "x-wizgestor-scope" : "accounts:settle"
      }
    },
    "/v1/bank-accounts" : {
      "get" : {
        "description" : "As contas bancárias ativas, com o saldo de cada uma e o total.\n\nPermissão: `finance:read`.",
        "operationId" : "bankAccounts",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BalancesView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Contas bancárias e saldos",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "finance:read"
      }
    },
    "/v1/bank-accounts/{id}/statement" : {
      "get" : {
        "description" : "Permissão: `finance:read`.",
        "operationId" : "statement",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "A partir de (AAAA-MM-DD).",
          "in" : "query",
          "name" : "from",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Até (AAAA-MM-DD).",
          "in" : "query",
          "name" : "to",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Parte da descrição do lançamento.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultStatementEntryView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Extrato de uma conta bancária",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "finance:read"
      }
    },
    "/v1/cash-flow" : {
      "get" : {
        "description" : "Entradas, saídas e saldo por dia, semana ou mês. Até um ano por pedido.\n\nPermissão: `finance:read`.",
        "operationId" : "cashFlow",
        "parameters" : [ {
          "description" : "A partir de (AAAA-MM-DD). Padrão: hoje.",
          "in" : "query",
          "name" : "from",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Até (AAAA-MM-DD). Padrão: 30 dias a partir de `from`.",
          "in" : "query",
          "name" : "to",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "daily, weekly ou monthly. Sem ele: até 31 dias, por dia; até 92, por semana; depois, por mês.",
          "in" : "query",
          "name" : "grouping",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "projected (pelo vencimento) ou actual (o que foi pago e recebido). Sem ele: actual para um período que já passou, projected para o resto.",
          "in" : "query",
          "name" : "type",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Saldo inicial do período. Padrão: no projected que começa até hoje, o saldo das contas bancárias; no resto, zero.",
          "in" : "query",
          "name" : "initialBalance",
          "required" : false,
          "schema" : {
            "type" : "number"
          }
        }, {
          "description" : "Só o que foi rateado para este centro de custo.",
          "in" : "query",
          "name" : "costCenterId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CashFlowView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Fluxo de caixa",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "finance:read"
      }
    },
    "/v1/categories" : {
      "get" : {
        "description" : "Permissão: `accounts:read`.",
        "operationId" : "categories",
        "parameters" : [ {
          "description" : "EXPENSE (despesa) ou INCOME (receita). Sem ele, as duas.",
          "in" : "query",
          "name" : "type",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/CategoryView"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Categorias ativas",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "accounts:read"
      }
    },
    "/v1/clients" : {
      "get" : {
        "description" : "Para a chave de um escritório (contador ou BPO): os clientes que autorizaram o escritório e ligaram o acesso pela IA e pelas chaves. Mande o `id` no cabeçalho `X-Client-Account` e a chave age na conta do cliente, com o menor entre as permissões da chave e o perfil que o cliente deu. Só a chave de produção; conta que não é escritório recebe a lista vazia.\n\nPermissão: qualquer chave.",
        "operationId" : "clients",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "type" : "object"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Clientes do escritório",
        "tags" : [ "Conta e acesso" ],
        "x-wizgestor-scope" : ""
      }
    },
    "/v1/cost-centers" : {
      "get" : {
        "description" : "Os centros de custo ativos. Precisa do módulo Centros de custo no plano.\n\nPermissão: `accounts:read`.",
        "operationId" : "costCenters",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/CostCenterView"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Centros de custo",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "accounts:read"
      }
    },
    "/v1/customers" : {
      "get" : {
        "description" : "Permissão: `customers:read`.",
        "operationId" : "customers",
        "parameters" : [ {
          "description" : "Parte do nome, do documento ou do e-mail.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultCustomerView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista os clientes",
        "tags" : [ "Clientes" ],
        "x-wizgestor-scope" : "customers:read"
      },
      "post" : {
        "description" : "`personType` aceita FISICA ou JURIDICA (ou PF e PJ). Sem ele, vale o tamanho do documento.\n\nPermissão: `customers:write`.",
        "operationId" : "createCustomer",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerCreateInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cadastra um cliente",
        "tags" : [ "Clientes" ],
        "x-wizgestor-scope" : "customers:write"
      }
    },
    "/v1/customers/{id}" : {
      "delete" : {
        "description" : "Não apaga nada: o cliente some das buscas e das listas, e as vendas, contas e notas dele ficam. Volta com o reactivate.\n\nPermissão: `customers:write`.",
        "operationId" : "deactivateCustomer",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desativa um cliente",
        "tags" : [ "Clientes" ],
        "x-wizgestor-scope" : "customers:write"
      },
      "get" : {
        "description" : "Permissão: `customers:read`.",
        "operationId" : "customer",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um cliente",
        "tags" : [ "Clientes" ],
        "x-wizgestor-scope" : "customers:read"
      },
      "patch" : {
        "description" : "Mande só os campos que mudam.\n\nPermissão: `customers:write`.",
        "operationId" : "updateCustomer",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PersonInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera um cliente",
        "tags" : [ "Clientes" ],
        "x-wizgestor-scope" : "customers:write"
      }
    },
    "/v1/customers/{id}/reactivate" : {
      "post" : {
        "description" : "Permissão: `customers:write`.",
        "operationId" : "reactivateCustomer",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Reativa um cliente desativado",
        "tags" : [ "Clientes" ],
        "x-wizgestor-scope" : "customers:write"
      }
    },
    "/v1/income-statement" : {
      "get" : {
        "description" : "Permissão: `finance:read`.",
        "operationId" : "incomeStatement",
        "parameters" : [ {
          "description" : "Mês (1 a 12). Padrão: o mês atual.",
          "in" : "query",
          "name" : "month",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Ano. Padrão: o ano atual.",
          "in" : "query",
          "name" : "year",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "actual (o que foi pago e recebido, o padrão) ou projected (pelo vencimento).",
          "in" : "query",
          "name" : "mode",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Só o que foi rateado para este centro de custo.",
          "in" : "query",
          "name" : "costCenterId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/IncomeStatementView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "DRE do mês",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "finance:read"
      }
    },
    "/v1/invoices" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "invoices",
        "parameters" : [ {
          "description" : "NFSE, NFE ou NFCE. Sem ele, todas.",
          "in" : "query",
          "name" : "kind",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "A situação da nota, como vem no campo `status` da resposta.",
          "in" : "query",
          "name" : "status",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Emitidas a partir de (AAAA-MM-DD).",
          "in" : "query",
          "name" : "from",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Emitidas até (AAAA-MM-DD).",
          "in" : "query",
          "name" : "to",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Número ou nome do cliente.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultInvoiceView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista as notas fiscais (NFS-e, NF-e e NFC-e)",
        "tags" : [ "Notas fiscais" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfce" : {
      "post" : {
        "description" : "O cupom não tem rascunho: confere e emite na hora. Dá baixa no estoque e não lança contas a receber (a venda foi paga no caixa). Use o cabeçalho `Idempotency-Key` para não emitir duas vezes. Para ver, cancelar, o PDF e o XML, use as rotas da NF-e com o `id` do cupom. Com a chave de testes, a emissão é simulada (`simulated: true`) e nada é gravado.\n\nPermissão: `invoices:issue`.",
        "operationId" : "issueNfce",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/NfceRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Outcome"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Emite o cupom (NFC-e)",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfce/preview" : {
      "post" : {
        "description" : "Os totais, o troco e o que falta para emitir (`ready` e `problems`), sem gravar nem enviar nada. Precisa do módulo NFC-e no plano.\n\nPermissão: `invoices:read`.",
        "operationId" : "previewNfce",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/NfceRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Preview"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Prévia do cupom (NFC-e)",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfe" : {
      "post" : {
        "description" : "Pelo pedido de venda (`saleId`) ou sem pedido, por `customerId` e `items`. Sem pedido, os dados fiscais vêm do cadastro do produto e o preço (sem `unitPrice`) é o do cadastro; sem `companyId`, emite a empresa principal; sem `natureId`, a natureza padrão da empresa. `paymentMethod` vale o total da nota; sem `installments`, a conta a receber sai à vista na emissão.\n\nPermissão: `invoices:issue`.",
        "operationId" : "createNfe",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/NfeDraftRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/NfeView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria o rascunho da NF-e",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfe/debit-notes" : {
      "post" : {
        "description" : "`kind`: INTEREST (juros e multa de uma conta recebida, `receivableId`), ADVANCE (pagamento antecipado do pedido, `saleId` e `amount`) ou LOSS (perda no estoque, `stockAdjustmentId`). Lucro Presumido e Real. Depois, a prévia e o emitir da NF-e.\n\nPermissão: `invoices:issue`.",
        "operationId" : "createNfeDebitNote",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/DebitNoteRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/NfeView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria o rascunho da nota de débito",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfe/{id}" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "nfe",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/NfeView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Uma NF-e",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfe/{id}/cancel" : {
      "post" : {
        "description" : "`reason` com 15 letras ou mais. No ambiente de testes, cancelar é recusado.\n\nPermissão: `invoices:cancel`.",
        "operationId" : "cancelNfe",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CancelInvoiceRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Outcome"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cancela a NF-e",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:cancel"
      }
    },
    "/v1/invoices/nfe/{id}/credit-notes" : {
      "post" : {
        "description" : "`kind`: DISCOUNT (com `amount` e `reason`), RETURN ou PARTIAL_RETURN. A nota original continua valendo. Depois, a prévia e o emitir da NF-e, como em qualquer rascunho.\n\nPermissão: `invoices:issue`.",
        "operationId" : "createNfeCreditNote",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreditNoteRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/NfeView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria o rascunho da nota de crédito da NF-e",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfe/{id}/credit-notes/options" : {
      "get" : {
        "description" : "Desconto depois de emitida (DISCOUNT, com o máximo em `maxAmount`), mercadoria que voltou sem ser entregue (RETURN) e parte que voltou (PARTIAL_RETURN): `available` e, se não dá, `reason`. Lucro Presumido e Real.\n\nPermissão: `invoices:read`.",
        "operationId" : "nfeCreditOptions",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "items" : {
                    "$ref" : "#/components/schemas/Option"
                  },
                  "type" : "array"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "As notas de crédito que a NF-e de venda aceita",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfe/{id}/issue" : {
      "post" : {
        "description" : "Com a chave de testes, a emissão é simulada (`simulated: true`) e nada vai para a Receita.\n\nPermissão: `invoices:issue`.",
        "operationId" : "issueNfe",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Outcome"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Emite a NF-e",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfe/{id}/pdf" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "nfePdf",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/pdf" : {
                "schema" : {
                  "format" : "binary",
                  "type" : "string"
                }
              }
            },
            "description" : "O arquivo"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "O PDF da NF-e autorizada",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfe/{id}/preview" : {
      "get" : {
        "description" : "Os impostos calculados e o que falta para emitir (`ready` e `problems`), sem enviar nada.\n\nPermissão: `invoices:read`.",
        "operationId" : "previewNfe",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Preview"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Prévia da NF-e",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfe/{id}/xml" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "nfeXml",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/xml" : {
                "schema" : {
                  "format" : "binary",
                  "type" : "string"
                }
              }
            },
            "description" : "O arquivo"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "O XML da NF-e autorizada",
        "tags" : [ "NF-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfse" : {
      "post" : {
        "description" : "Por um pedido ou uma ordem de serviço (`saleId`), ou por `customerId` + `serviceId` + `amount`. A nota usa a base da última NFS-e autorizada da empresa.\n\nPermissão: `invoices:issue`.",
        "operationId" : "createNfse",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/NfseDraftRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/NfseView"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria o rascunho da NFS-e",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfse/{id}" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "nfse",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/NfseView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Uma NFS-e",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfse/{id}/cancel" : {
      "post" : {
        "description" : "`reason` com 15 letras ou mais. No ambiente de testes, cancelar é recusado.\n\nPermissão: `invoices:cancel`.",
        "operationId" : "cancelNfse",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CancelInvoiceRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Outcome"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cancela a NFS-e",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:cancel"
      }
    },
    "/v1/invoices/nfse/{id}/issue" : {
      "post" : {
        "description" : "Com a chave de testes, a emissão é simulada (`simulated: true`) e nada vai para a prefeitura.\n\nPermissão: `invoices:issue`.",
        "operationId" : "issueNfse",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Outcome"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Emite a NFS-e",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:issue"
      }
    },
    "/v1/invoices/nfse/{id}/pdf" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "nfsePdf",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/pdf" : {
                "schema" : {
                  "format" : "binary",
                  "type" : "string"
                }
              }
            },
            "description" : "O arquivo"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "O PDF da NFS-e autorizada",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfse/{id}/preview" : {
      "get" : {
        "description" : "Os impostos calculados e o que falta para emitir (`ready` e `problems`), sem enviar nada.\n\nPermissão: `invoices:read`.",
        "operationId" : "previewNfse",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Preview"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Prévia da NFS-e",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/invoices/nfse/{id}/xml" : {
      "get" : {
        "description" : "Permissão: `invoices:read`.",
        "operationId" : "nfseXml",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/xml" : {
                "schema" : {
                  "format" : "binary",
                  "type" : "string"
                }
              }
            },
            "description" : "O arquivo"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "O XML da NFS-e autorizada",
        "tags" : [ "NFS-e" ],
        "x-wizgestor-scope" : "invoices:read"
      }
    },
    "/v1/me" : {
      "get" : {
        "description" : "Bom para conferir a chave: devolve a empresa, quem criou o acesso, o papel, as permissões e o ambiente (live ou test).\n\nPermissão: qualquer chave.",
        "operationId" : "me",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Me"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "A conta, o usuário e as permissões da chave",
        "tags" : [ "Conta e acesso" ],
        "x-wizgestor-scope" : ""
      }
    },
    "/v1/opportunities" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "opportunities",
        "parameters" : [ {
          "description" : "OPEN (em aberto, o padrão), WON (ganhas), LOST (perdidas) ou ALL.",
          "in" : "query",
          "name" : "situation",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Só as deste funil (veja GET /v1/opportunities/pipelines). Sem ele, todos.",
          "in" : "query",
          "name" : "pipelineId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Só as desta etapa.",
          "in" : "query",
          "name" : "stageId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Só as deste cliente.",
          "in" : "query",
          "name" : "customerId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "true: só as em aberto paradas (sem movimento há os dias do aviso do funil).",
          "in" : "query",
          "name" : "stale",
          "required" : false,
          "schema" : {
            "type" : "boolean"
          }
        }, {
          "description" : "Parte do título, do nome do cliente ou do contato.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultOpportunityView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista as oportunidades",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:read"
      },
      "post" : {
        "description" : "Mande `customerId` ou `contact` (com `name` ou `company`) para quem ainda não é cliente: o contato vira cliente ao criar o orçamento, ao ganhar ou pelo POST /v1/opportunities/{id}/customer. Sem `pipelineId` (ou `pipeline`, o nome), vai para o funil padrão.\n\nPermissão: `sales:write`.",
        "operationId" : "createOpportunity",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/OpportunityInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/OpportunityView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria uma oportunidade",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/opportunities/forecast" : {
      "get" : {
        "description" : "As em aberto com o valor × a chance da etapa, por mês da previsão de fechamento e por vendedor. As atrasadas e as sem previsão vêm à parte; `wonAmount` é o que já foi ganho no mês.\n\nPermissão: `sales:read`.",
        "operationId" : "forecast",
        "parameters" : [ {
          "description" : "Início (AAAA-MM-DD). Padrão: o começo do mês atual.",
          "in" : "query",
          "name" : "startDate",
          "required" : false,
          "schema" : {
            "format" : "date",
            "type" : "string"
          }
        }, {
          "description" : "Fim (AAAA-MM-DD). Padrão: 6 meses. No máximo 24.",
          "in" : "query",
          "name" : "endDate",
          "required" : false,
          "schema" : {
            "format" : "date",
            "type" : "string"
          }
        }, {
          "description" : "Só este funil. Sem ele, todos.",
          "in" : "query",
          "name" : "pipelineId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Só deste vendedor.",
          "in" : "query",
          "name" : "salespersonId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Forecast"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Previsão de vendas",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/opportunities/pipelines" : {
      "get" : {
        "description" : "Cada funil com as etapas, o tipo de cada uma (ACTIVE, COMPLETED = ganho, CANCELLED = perdido) e a chance de fechar.\n\nPermissão: `sales:read`.",
        "operationId" : "pipelines",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/PipelineView"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Os funis de vendas",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/opportunities/stages" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "stages",
        "parameters" : [ {
          "description" : "O funil. Sem ele, o padrão.",
          "in" : "query",
          "name" : "pipelineId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/Ref"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "As etapas de um funil",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/opportunities/{id}" : {
      "get" : {
        "description" : "Com o cliente ou o contato, a etapa, o funil, a chance da etapa e o valor ponderado (valor × chance).\n\nPermissão: `sales:read`.",
        "operationId" : "opportunity",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/OpportunityView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Uma oportunidade",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/opportunities/{id}/customer" : {
      "post" : {
        "description" : "Sem corpo, cadastra o cliente pelo contato (com empresa, pessoa jurídica; sem, pessoa física; com o e-mail de um cliente já cadastrado, usa ele). Com `customerId`, liga esse cliente. Precisa também da permissão `customers:write`.\n\nPermissão: `sales:write`.",
        "operationId" : "opportunityCustomer",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ConvertCustomerInput"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/OpportunityView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cadastra o contato como cliente",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/opportunities/{id}/move" : {
      "post" : {
        "description" : "Mande `stageId` ou `stage` (o nome, dentro do funil da oportunidade). Para marcar como perdida, `lostReasonId` e `lostNote`.\n\nPermissão: `sales:write`.",
        "operationId" : "moveOpportunity",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/MoveInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/OpportunityView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Muda a oportunidade de etapa",
        "tags" : [ "Funil de vendas" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/products" : {
      "get" : {
        "description" : "Permissão: `records:read`.",
        "operationId" : "products",
        "parameters" : [ {
          "description" : "Parte do nome, do código, do código de barras ou de um dos outros códigos (OEM, fabricante, universal, referência comercial ou o código no fornecedor), sem contar espaço, ponto e hífen. O código exato vem primeiro.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "true (só os ativos) ou false (só os inativos). Sem ele, os dois.",
          "in" : "query",
          "name" : "active",
          "required" : false,
          "schema" : {
            "type" : "boolean"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultProductView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista os produtos",
        "tags" : [ "Produtos" ],
        "x-wizgestor-scope" : "records:read"
      },
      "post" : {
        "description" : "Permissão: `records:write`.",
        "operationId" : "createProduct",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ProductInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ProductView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cadastra um produto",
        "tags" : [ "Produtos" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/products/{id}" : {
      "delete" : {
        "description" : "Não apaga nada: o cadastro some das buscas e das opções novas, e o histórico (compras, vendas, notas, estoque) fica. Volta com o reactivate.\n\nPermissão: `records:write`.",
        "operationId" : "deactivateProduct",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ProductView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desativa um produto",
        "tags" : [ "Produtos" ],
        "x-wizgestor-scope" : "records:write"
      },
      "get" : {
        "description" : "Permissão: `records:read`.",
        "operationId" : "product",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ProductView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um produto",
        "tags" : [ "Produtos" ],
        "x-wizgestor-scope" : "records:read"
      },
      "patch" : {
        "description" : "Mande só os campos que mudam.\n\nPermissão: `records:write`.",
        "operationId" : "updateProduct",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ProductInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ProductView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera um produto",
        "tags" : [ "Produtos" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/products/{id}/reactivate" : {
      "post" : {
        "description" : "Permissão: `records:write`.",
        "operationId" : "reactivateProduct",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ProductView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Reativa um produto desativado",
        "tags" : [ "Produtos" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/purchase-orders" : {
      "get" : {
        "description" : "Permissão: `stock:read`.",
        "operationId" : "purchaseOrders",
        "parameters" : [ {
          "in" : "query",
          "name" : "status",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Só os deste fornecedor.",
          "in" : "query",
          "name" : "supplierId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultPurchaseSummaryView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista os pedidos de compra",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "stock:read"
      },
      "post" : {
        "description" : "Permissão: `stock:write`.",
        "operationId" : "createPurchaseOrder",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PurchaseInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PurchaseView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria um pedido de compra",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "stock:write"
      }
    },
    "/v1/purchase-orders/{id}" : {
      "get" : {
        "description" : "Permissão: `stock:read`.",
        "operationId" : "purchaseOrder",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PurchaseView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um pedido de compra, com os itens",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "stock:read"
      }
    },
    "/v1/purchase-orders/{id}/send" : {
      "post" : {
        "description" : "O e-mail leva o PDF do pedido e, se houver, a `message`. O rascunho passa a enviado; o enviado ou recebido em parte é reenviado. `email` é opcional: sem ele, vai para o contato do pedido ou o e-mail do fornecedor. Com a chave de testes, nenhum e-mail sai (`simulated: true`).\n\nPermissão: `purchases:send`.",
        "operationId" : "sendPurchaseOrder",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PurchaseSendInput"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SendResult"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Envia o pedido de compra ao fornecedor por e-mail",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "purchases:send"
      }
    },
    "/v1/quotations" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "quotations",
        "parameters" : [ {
          "description" : "Número, título ou nome do cliente.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "DRAFT, SENT, NEGOTIATING, APPROVED, REJECTED, CONVERTED ou EXPIRED.",
          "in" : "query",
          "name" : "status",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultQuotationView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista os orçamentos",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:read"
      },
      "post" : {
        "description" : "Permissão: `sales:write`.",
        "operationId" : "createQuotation",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/QuotationInputApi"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/QuotationView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria um orçamento",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/quotations/{id}" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "quotation",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/QuotationView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um orçamento, com os itens",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:read"
      },
      "patch" : {
        "description" : "O que vier troca o que está lá; `items` troca todos os itens.\n\nPermissão: `sales:write`.",
        "operationId" : "updateQuotation",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/QuotationInputApi"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/QuotationView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera um orçamento",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/quotations/{id}/approve" : {
      "post" : {
        "description" : "Gera a cobrança e as notas quando o orçamento estiver configurado assim.\n\nPermissão: `sales:write`.",
        "operationId" : "approveQuotation",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/QuotationView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Aprova o orçamento",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/quotations/{id}/convert" : {
      "post" : {
        "description" : "`to` é SALE (padrão) ou SERVICE.\n\nPermissão: `sales:write`.",
        "operationId" : "convertQuotation",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ConvertRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/QuotationView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Converte em pedido de venda ou ordem de serviço",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/quotations/{id}/send" : {
      "post" : {
        "description" : "Como o \"Enviar\" da tela: o e-mail leva o link onde o cliente aprova, recusa ou comenta, e o rascunho passa a enviado (o enviado ou em negociação é reenviado). `email` é opcional: sem ele, vai para o e-mail do cliente. Com a chave de testes, nenhum e-mail sai (`simulated: true`).\n\nPermissão: `sales:send`.",
        "operationId" : "sendQuotation",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SendQuotationRequest"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SendResult"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Envia o orçamento ao cliente por e-mail",
        "tags" : [ "Orçamentos" ],
        "x-wizgestor-scope" : "sales:send"
      }
    },
    "/v1/sales" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "sales",
        "parameters" : [ {
          "description" : "SALE (pedidos de venda, o padrão) ou SERVICE (ordens de serviço).",
          "in" : "query",
          "name" : "type",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Número, nome do cliente ou parte das observações.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Só os deste cliente.",
          "in" : "query",
          "name" : "customerId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultSaleSummary"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista pedidos de venda ou ordens de serviço",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:read"
      },
      "post" : {
        "description" : "`type` é SALE ou SERVICE. Cada item leva `productId` ou `serviceId` (ou só `description`), `quantity` e `unitPrice`. No plano pré-pago usa o saldo, como na tela.\n\nPermissão: `sales:write`.",
        "operationId" : "createSale",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SaleInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SaleView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cria um pedido de venda ou uma ordem de serviço",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/sales/statuses" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "saleStatuses",
        "parameters" : [ {
          "description" : "SALE (pedido de venda, o padrão) ou SERVICE (ordem de serviço).",
          "in" : "query",
          "name" : "type",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/Ref"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Os status de pedido ou de ordem de serviço",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/sales/{id}" : {
      "get" : {
        "description" : "Permissão: `sales:read`.",
        "operationId" : "sale",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SaleView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um pedido ou uma ordem de serviço, com os itens",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:read"
      },
      "patch" : {
        "description" : "O que vier troca o que está lá; `items` troca todos os itens.\n\nPermissão: `sales:write`.",
        "operationId" : "updateSale",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SalePatch"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SaleView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera um pedido ou uma ordem de serviço",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/sales/{id}/invoice" : {
      "post" : {
        "description" : "Gera a cobrança e a fatura, como o botão Faturar da tela, e a nota quando pedida. Não paga nada pelo banco. Com a chave de testes, a cobrança pelo banco vira cobrança sem banco.\n\nPermissão: `sales:invoice`.",
        "operationId" : "invoice",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/InvoiceInput"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SaleView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Fatura o pedido ou a ordem de serviço",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:invoice"
      }
    },
    "/v1/sales/{id}/invoice/preview" : {
      "post" : {
        "description" : "Mostra o valor, a forma de cobrança, a conta bancária, as notas que sairiam e os avisos, sem gravar nada.\n\nPermissão: `sales:read`.",
        "operationId" : "invoicePreview",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/InvoiceInput"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InvoicePreview"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Prévia do faturamento",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/sales/{id}/status" : {
      "post" : {
        "description" : "Mande `statusId` ou `status` (o nome) e, se quiser, `note` (fica no histórico).\n\nPermissão: `sales:write`.",
        "operationId" : "changeStatus",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/StatusInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SaleView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Muda o status",
        "tags" : [ "Pedidos de venda e ordens de serviço" ],
        "x-wizgestor-scope" : "sales:write"
      }
    },
    "/v1/search" : {
      "get" : {
        "description" : "Clientes, fornecedores, produtos, vendas, orçamentos e notas, só no que as permissões da chave deixam ver.\n\nPermissão: qualquer chave.",
        "operationId" : "search",
        "parameters" : [ {
          "description" : "O que procurar (nome, número, documento).",
          "in" : "query",
          "name" : "q",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "additionalProperties" : {
                    "items" : {
                      "$ref" : "#/components/schemas/Result"
                    },
                    "type" : "array"
                  },
                  "type" : "object"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Procura em tudo de uma vez",
        "tags" : [ "Busca" ],
        "x-wizgestor-scope" : ""
      }
    },
    "/v1/services" : {
      "get" : {
        "description" : "Permissão: `records:read`.",
        "operationId" : "services",
        "parameters" : [ {
          "description" : "Parte do nome, do código ou do documento.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultServiceView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista os serviços",
        "tags" : [ "Serviços" ],
        "x-wizgestor-scope" : "records:read"
      },
      "post" : {
        "description" : "Permissão: `records:write`.",
        "operationId" : "createService",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ServiceInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ServiceView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cadastra um serviço",
        "tags" : [ "Serviços" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/services/{id}" : {
      "delete" : {
        "description" : "Não apaga nada: o cadastro some das buscas e das opções novas, e o histórico (compras, vendas, notas, estoque) fica. Volta com o reactivate.\n\nPermissão: `records:write`.",
        "operationId" : "deactivateService",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ServiceView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desativa um serviço",
        "tags" : [ "Serviços" ],
        "x-wizgestor-scope" : "records:write"
      },
      "get" : {
        "description" : "Permissão: `records:read`.",
        "operationId" : "service",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ServiceView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um serviço",
        "tags" : [ "Serviços" ],
        "x-wizgestor-scope" : "records:read"
      },
      "patch" : {
        "description" : "Mande só os campos que mudam.\n\nPermissão: `records:write`.",
        "operationId" : "updateService",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ServiceInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ServiceView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera um serviço",
        "tags" : [ "Serviços" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/services/{id}/reactivate" : {
      "post" : {
        "description" : "Permissão: `records:write`.",
        "operationId" : "reactivateService",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ServiceView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Reativa um serviço desativado",
        "tags" : [ "Serviços" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/stock" : {
      "get" : {
        "description" : "Permissão: `stock:read`.",
        "operationId" : "stock",
        "parameters" : [ {
          "description" : "Parte do nome ou do código.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "below_minimum (abaixo do mínimo), zero, negative ou all (o padrão).",
          "in" : "query",
          "name" : "situation",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PositionPageView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Saldo dos produtos",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "stock:read"
      }
    },
    "/v1/stock/movements" : {
      "get" : {
        "description" : "Permissão: `stock:read`.",
        "operationId" : "movements",
        "parameters" : [ {
          "description" : "Só as deste produto.",
          "in" : "query",
          "name" : "productId",
          "required" : false,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "A partir de (AAAA-MM-DD).",
          "in" : "query",
          "name" : "from",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Até (AAAA-MM-DD).",
          "in" : "query",
          "name" : "to",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "in (entradas) ou out (saídas).",
          "in" : "query",
          "name" : "type",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultMovementView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Entradas e saídas do estoque",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "stock:read"
      },
      "post" : {
        "description" : "`type` é in (entrada) ou out (saída); `quantity` positiva; `unitCost` é opcional.\n\nPermissão: `stock:write`.",
        "operationId" : "move",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/MovementInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/MovementView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lança uma entrada ou uma saída",
        "tags" : [ "Estoque e compras" ],
        "x-wizgestor-scope" : "stock:write"
      }
    },
    "/v1/summary" : {
      "get" : {
        "description" : "O que vence hoje, o que está atrasado, os próximos 7 dias e o saldo das contas bancárias.\n\nPermissão: `accounts:read`.",
        "operationId" : "summary",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SummaryView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "O resumo do dia",
        "tags" : [ "Financeiro" ],
        "x-wizgestor-scope" : "accounts:read"
      }
    },
    "/v1/suppliers" : {
      "get" : {
        "description" : "Permissão: `records:read`.",
        "operationId" : "suppliers",
        "parameters" : [ {
          "description" : "Parte do nome, do código ou do documento.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Página, começando em 0.",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        }, {
          "description" : "Itens por página: de 1 a 100 (padrão 20).",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultSupplierView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista os fornecedores",
        "tags" : [ "Fornecedores" ],
        "x-wizgestor-scope" : "records:read"
      },
      "post" : {
        "description" : "Permissão: `records:write`.",
        "operationId" : "createSupplier",
        "parameters" : [ {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PersonInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SupplierView"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Cadastra um fornecedor",
        "tags" : [ "Fornecedores" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/suppliers/{id}" : {
      "delete" : {
        "description" : "Não apaga nada: o cadastro some das buscas e das opções novas, e o histórico (compras, vendas, notas, estoque) fica. Volta com o reactivate.\n\nPermissão: `records:write`.",
        "operationId" : "deactivateSupplier",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SupplierView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Desativa um fornecedor",
        "tags" : [ "Fornecedores" ],
        "x-wizgestor-scope" : "records:write"
      },
      "get" : {
        "description" : "Permissão: `records:read`.",
        "operationId" : "supplier",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SupplierView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Um fornecedor",
        "tags" : [ "Fornecedores" ],
        "x-wizgestor-scope" : "records:read"
      },
      "patch" : {
        "description" : "Mande só os campos que mudam.\n\nPermissão: `records:write`.",
        "operationId" : "updateSupplier",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/PersonInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SupplierView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Altera um fornecedor",
        "tags" : [ "Fornecedores" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/suppliers/{id}/reactivate" : {
      "post" : {
        "description" : "Permissão: `records:write`.",
        "operationId" : "reactivateSupplier",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SupplierView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Reativa um fornecedor desativado",
        "tags" : [ "Fornecedores" ],
        "x-wizgestor-scope" : "records:write"
      }
    },
    "/v1/whatsapp/conversations" : {
      "get" : {
        "description" : "Até 100, as de mensagem mais recente primeiro. Quem usa a chave vê como na tela: o administrador vê todas; as outras pessoas, as suas e a fila (ou todas, se a empresa escolheu assim). `windowOpen` diz se ainda dá para responder (24 horas depois da última mensagem do contato).\n\nPermissão: `sales:read`.",
        "operationId" : "whatsappConversations",
        "parameters" : [ {
          "description" : "open (em andamento, o padrão), closed (encerradas) ou all.",
          "in" : "query",
          "name" : "status",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Parte do nome ou do telefone do contato.",
          "in" : "query",
          "name" : "search",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PageResultConversationView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Lista as conversas do WhatsApp",
        "tags" : [ "Atendimento pelo WhatsApp" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/whatsapp/conversations/{id}" : {
      "get" : {
        "description" : "As últimas mensagens, da mais antiga para a mais nova. `direction`: in (do contato), out (da empresa) ou internal (nota ou registro da equipe).\n\nPermissão: `sales:read`.",
        "operationId" : "whatsappConversation",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Quantas mensagens: de 10 a 500 (padrão 60).",
          "in" : "query",
          "name" : "limit",
          "required" : false,
          "schema" : {
            "format" : "int32",
            "type" : "integer"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConversationDetailView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Uma conversa com as mensagens",
        "tags" : [ "Atendimento pelo WhatsApp" ],
        "x-wizgestor-scope" : "sales:read"
      }
    },
    "/v1/whatsapp/conversations/{id}/messages" : {
      "post" : {
        "description" : "Mande `text` (até 4096 caracteres). Só com a janela de 24 horas aberta; fechada, volta 422 e a resposta precisa ser um modelo aprovado pela Meta, enviado pela tela. Com a chave de testes, o envio é simulado.\n\nPermissão: `sales:write`.",
        "operationId" : "whatsappReply",
        "parameters" : [ {
          "description" : "O id (UUID).",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "format" : "uuid",
            "type" : "string"
          }
        }, {
          "description" : "Um código único por operação (um UUID). Mandou de novo com o mesmo código, volta a primeira resposta sem gravar em dobro.",
          "in" : "header",
          "name" : "Idempotency-Key",
          "required" : false,
          "schema" : {
            "maxLength" : 255,
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SendInput"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/MessageView"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "$ref" : "#/components/responses/DadoInvalido"
          },
          "401" : {
            "$ref" : "#/components/responses/SemChave"
          },
          "402" : {
            "$ref" : "#/components/responses/AssinaturaBloqueada"
          },
          "403" : {
            "$ref" : "#/components/responses/SemPermissao"
          },
          "404" : {
            "$ref" : "#/components/responses/NaoEncontrado"
          },
          "422" : {
            "$ref" : "#/components/responses/RegraNaoDeixa"
          },
          "429" : {
            "$ref" : "#/components/responses/LimiteDeUso"
          }
        },
        "summary" : "Responde em texto",
        "tags" : [ "Atendimento pelo WhatsApp" ],
        "x-wizgestor-scope" : "sales:write"
      }
    }
  },
  "security" : [ {
    "chave" : [ ]
  } ],
  "servers" : [ {
    "description" : "A mesma URL para a chave de testes e a de produção",
    "url" : "https://app.wizgestor.com.br/api"
  } ],
  "tags" : [ {
    "description" : "Quem está usando a chave e o que ela pode fazer.",
    "name" : "Conta e acesso"
  }, {
    "description" : "Lançar, alterar, pagar (total ou em parte), cancelar e excluir contas a pagar. Pagar aqui só registra o pagamento: nada sai da conta no banco.",
    "name" : "Contas a pagar"
  }, {
    "description" : "Lançar, alterar, receber (total ou em parte), cancelar e excluir contas a receber.",
    "name" : "Contas a receber"
  }, {
    "description" : "Saldos das contas bancárias, extrato, fluxo de caixa, DRE, centros de custo, categorias e o resumo do dia.",
    "name" : "Financeiro"
  }, {
    "description" : "Ver, cadastrar, alterar, desativar e reativar clientes.",
    "name" : "Clientes"
  }, {
    "description" : "Ver, cadastrar, alterar, desativar e reativar fornecedores.",
    "name" : "Fornecedores"
  }, {
    "description" : "Ver, cadastrar, alterar, desativar e reativar produtos.",
    "name" : "Produtos"
  }, {
    "description" : "Ver, cadastrar, alterar, desativar e reativar serviços.",
    "name" : "Serviços"
  }, {
    "description" : "Criar e alterar pedidos de venda e ordens de serviço, mudar o status e faturar.",
    "name" : "Pedidos de venda e ordens de serviço"
  }, {
    "description" : "Criar, alterar, enviar ao cliente por e-mail, aprovar e converter orçamentos.",
    "name" : "Orçamentos"
  }, {
    "description" : "Oportunidades e etapas do funil de vendas.",
    "name" : "Funil de vendas"
  }, {
    "description" : "As conversas do WhatsApp da empresa, as mensagens e a resposta em texto (com o número ligado em Comercial › Conversas).",
    "name" : "Atendimento pelo WhatsApp"
  }, {
    "description" : "Saldo dos produtos, entradas e saídas e pedidos de compra (criar e enviar ao fornecedor por e-mail).",
    "name" : "Estoque e compras"
  }, {
    "description" : "A lista de todas as notas: NFS-e, NF-e e NFC-e.",
    "name" : "Notas fiscais"
  }, {
    "description" : "Rascunho, prévia (impostos e o que falta), emissão, cancelamento, PDF e XML da NFS-e. Com a chave de testes, emitir é simulado: nada vai para a prefeitura.",
    "name" : "NFS-e"
  }, {
    "description" : "Rascunho (pelo pedido de venda ou sem pedido), prévia, emissão, cancelamento, PDF e XML da NF-e, e o cupom (NFC-e) da venda no balcão. Com a chave de testes, emitir é simulado: nada vai para a Receita.",
    "name" : "NF-e"
  }, {
    "description" : "Uma busca só em clientes, fornecedores, produtos, vendas, orçamentos e notas.",
    "name" : "Busca"
  } ]
}
