{
  "components": {
    "schemas": {
      "Body_enviar_certificado_v1_empresas__empresa_id__certificado_post": {
        "properties": {
          "arquivo": {
            "contentMediaType": "application/octet-stream",
            "description": "Certificado A1 (.pfx/.p12)",
            "title": "Arquivo",
            "type": "string"
          },
          "senha": {
            "title": "Senha",
            "type": "string"
          }
        },
        "required": [
          "arquivo",
          "senha"
        ],
        "title": "Body_enviar_certificado_v1_empresas__empresa_id__certificado_post",
        "type": "object"
      },
      "CertificadoSaida": {
        "description": "Só metadados: o conteúdo do certificado nunca sai pela API.",
        "properties": {
          "cnpj": {
            "title": "Cnpj",
            "type": "string"
          },
          "criado_em": {
            "format": "date-time",
            "title": "Criado Em",
            "type": "string"
          },
          "emissor": {
            "title": "Emissor",
            "type": "string"
          },
          "empresa_id": {
            "format": "uuid",
            "title": "Empresa Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "impressao_digital_sha256": {
            "title": "Impressao Digital Sha256",
            "type": "string"
          },
          "numero_serie": {
            "title": "Numero Serie",
            "type": "string"
          },
          "titular": {
            "title": "Titular",
            "type": "string"
          },
          "valido_ate": {
            "format": "date-time",
            "title": "Valido Ate",
            "type": "string"
          },
          "valido_de": {
            "format": "date-time",
            "title": "Valido De",
            "type": "string"
          }
        },
        "required": [
          "id",
          "empresa_id",
          "cnpj",
          "titular",
          "emissor",
          "numero_serie",
          "impressao_digital_sha256",
          "valido_de",
          "valido_ate",
          "criado_em"
        ],
        "title": "CertificadoSaida",
        "type": "object"
      },
      "ClienteSalvoEntrada": {
        "description": "Cliente salvo (tomador) da empresa: os mesmos campos do `tomador` da emissão.",
        "properties": {
          "cnpj": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cnpj"
          },
          "cpf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpf"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "endereco": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Endereco"
              },
              {
                "type": "null"
              }
            ]
          },
          "nome": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Nome",
            "type": "string"
          },
          "telefone": {
            "anyOf": [
              {
                "pattern": "^[0-9]{6,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefone"
          }
        },
        "required": [
          "nome"
        ],
        "title": "ClienteSalvoEntrada",
        "type": "object"
      },
      "ClienteSalvoSaida": {
        "description": "`cpf` ou `cnpj` (o outro vem null); `endereco`, `email` e `telefone` só se cadastrados.",
        "properties": {
          "atualizado_em": {
            "format": "date-time",
            "title": "Atualizado Em",
            "type": "string"
          },
          "cnpj": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cnpj"
          },
          "cpf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpf"
          },
          "criado_em": {
            "format": "date-time",
            "title": "Criado Em",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "empresa_id": {
            "format": "uuid",
            "title": "Empresa Id",
            "type": "string"
          },
          "endereco": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Endereco"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "nome": {
            "title": "Nome",
            "type": "string"
          },
          "telefone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefone"
          }
        },
        "required": [
          "id",
          "empresa_id",
          "nome",
          "cpf",
          "cnpj",
          "email",
          "telefone",
          "endereco",
          "criado_em",
          "atualizado_em"
        ],
        "title": "ClienteSalvoSaida",
        "type": "object"
      },
      "ComplementoAssistente": {
        "properties": {
          "ativo": {
            "title": "Ativo",
            "type": "boolean"
          },
          "interacoes_mes": {
            "description": "Cota de interações por mês; quem conta o uso é o Assistente",
            "title": "Interacoes Mes",
            "type": "integer"
          }
        },
        "required": [
          "ativo",
          "interacoes_mes"
        ],
        "title": "ComplementoAssistente",
        "type": "object"
      },
      "ContaSaida": {
        "description": "Conta dona da chave: plano, situação, uso da cota e complementos.",
        "properties": {
          "assistente": {
            "$ref": "#/components/schemas/ComplementoAssistente"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "nome": {
            "title": "Nome",
            "type": "string"
          },
          "notas": {
            "$ref": "#/components/schemas/CotaNotas"
          },
          "plano": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Código do plano (essencial, profissional...); null = padrão",
            "title": "Plano"
          },
          "situacao": {
            "enum": [
              "em_analise",
              "ativa",
              "suspensa",
              "encerrada"
            ],
            "title": "Situacao",
            "type": "string"
          }
        },
        "required": [
          "id",
          "nome",
          "situacao",
          "plano",
          "notas",
          "assistente"
        ],
        "title": "ContaSaida",
        "type": "object"
      },
      "CotaNotas": {
        "description": "Notas que contam na cota (todas menos as rejeitadas), no horário de Brasília.",
        "properties": {
          "hoje": {
            "title": "Hoje",
            "type": "integer"
          },
          "limite_diario": {
            "title": "Limite Diario",
            "type": "integer"
          },
          "limite_mensal": {
            "title": "Limite Mensal",
            "type": "integer"
          },
          "mes": {
            "title": "Mes",
            "type": "integer"
          }
        },
        "required": [
          "hoje",
          "limite_diario",
          "mes",
          "limite_mensal"
        ],
        "title": "CotaNotas",
        "type": "object"
      },
      "DestinatarioIbsCbs": {
        "description": "Destinatário do serviço quando não é o próprio tomador (indDest = 1). Exatamente um identificador.",
        "properties": {
          "cnpj": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cnpj"
          },
          "cpf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpf"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 80,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "endereco": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Endereco"
              },
              {
                "type": "null"
              }
            ]
          },
          "motivo_sem_nif": {
            "anyOf": [
              {
                "enum": [
                  0,
                  1,
                  2
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Motivo Sem Nif"
          },
          "nif": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nif"
          },
          "nome": {
            "maxLength": 150,
            "minLength": 1,
            "title": "Nome",
            "type": "string"
          },
          "telefone": {
            "anyOf": [
              {
                "pattern": "^[0-9]{6,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefone"
          }
        },
        "required": [
          "nome"
        ],
        "title": "DestinatarioIbsCbs",
        "type": "object"
      },
      "Diferimento": {
        "description": "gDif: percentuais de diferimento (pDifUF, pDifMun, pDifCBS).",
        "properties": {
          "percentual_cbs": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "title": "Percentual Cbs"
          },
          "percentual_municipio": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "title": "Percentual Municipio"
          },
          "percentual_uf": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "title": "Percentual Uf"
          }
        },
        "required": [
          "percentual_uf",
          "percentual_municipio",
          "percentual_cbs"
        ],
        "title": "Diferimento",
        "type": "object"
      },
      "EmailEmpresa": {
        "description": "Como a empresa aparece nos e-mails de NFS-e enviados ao tomador.",
        "properties": {
          "email_automatico": {
            "default": false,
            "title": "Email Automatico",
            "type": "boolean"
          },
          "email_copia": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Copia"
          },
          "email_nome_exibido": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Nome Exibido"
          },
          "email_resposta": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Resposta"
          }
        },
        "title": "EmailEmpresa",
        "type": "object"
      },
      "EmailNotaEntrada": {
        "description": "Pedido de envio. Sem destinatario, usa o e-mail do tomador da nota.",
        "properties": {
          "destinatario": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Destinatario"
          }
        },
        "title": "EmailNotaEntrada",
        "type": "object"
      },
      "EmpresaEntrada": {
        "properties": {
          "cnpj": {
            "title": "Cnpj",
            "type": "string"
          },
          "codigo_municipio": {
            "description": "Código IBGE",
            "pattern": "^[0-9]{7}$",
            "title": "Codigo Municipio",
            "type": "string"
          },
          "conta_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conta Id"
          },
          "inscricao_municipal": {
            "anyOf": [
              {
                "pattern": "^[0-9]{1,15}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inscricao Municipal"
          },
          "opcao_simples_nacional": {
            "enum": [
              1,
              2,
              3
            ],
            "title": "Opcao Simples Nacional",
            "type": "integer"
          },
          "percentual_tributos_simples": {
            "anyOf": [
              {
                "exclusiveMaximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percentual Tributos Simples"
          },
          "razao_social": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Razao Social",
            "type": "string"
          },
          "regime_apuracao_simples": {
            "anyOf": [
              {
                "enum": [
                  1,
                  2,
                  3
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Apuracao Simples"
          },
          "regime_especial": {
            "default": 0,
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6,
              9
            ],
            "title": "Regime Especial",
            "type": "integer"
          },
          "serie_dps": {
            "default": "1",
            "pattern": "^[0-9]{1,5}$",
            "title": "Serie Dps",
            "type": "string"
          }
        },
        "required": [
          "cnpj",
          "razao_social",
          "codigo_municipio",
          "opcao_simples_nacional"
        ],
        "title": "EmpresaEntrada",
        "type": "object"
      },
      "EmpresaSaida": {
        "properties": {
          "cnpj": {
            "title": "Cnpj",
            "type": "string"
          },
          "codigo_municipio": {
            "title": "Codigo Municipio",
            "type": "string"
          },
          "conta_id": {
            "format": "uuid",
            "title": "Conta Id",
            "type": "string"
          },
          "email_automatico": {
            "title": "Email Automatico",
            "type": "boolean"
          },
          "email_copia": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Copia"
          },
          "email_nome_exibido": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Nome Exibido"
          },
          "email_resposta": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Resposta"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "inscricao_municipal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inscricao Municipal"
          },
          "opcao_simples_nacional": {
            "title": "Opcao Simples Nacional",
            "type": "integer"
          },
          "percentual_tributos_simples": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percentual Tributos Simples"
          },
          "proximo_numero_dps": {
            "title": "Proximo Numero Dps",
            "type": "integer"
          },
          "razao_social": {
            "title": "Razao Social",
            "type": "string"
          },
          "regime_apuracao_simples": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Apuracao Simples"
          },
          "regime_especial": {
            "title": "Regime Especial",
            "type": "integer"
          },
          "serie_dps": {
            "title": "Serie Dps",
            "type": "string"
          }
        },
        "required": [
          "id",
          "conta_id",
          "cnpj",
          "inscricao_municipal",
          "razao_social",
          "codigo_municipio",
          "opcao_simples_nacional",
          "regime_apuracao_simples",
          "regime_especial",
          "percentual_tributos_simples",
          "serie_dps",
          "proximo_numero_dps",
          "email_resposta",
          "email_nome_exibido",
          "email_copia",
          "email_automatico"
        ],
        "title": "EmpresaSaida",
        "type": "object"
      },
      "Endereco": {
        "properties": {
          "bairro": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Bairro",
            "type": "string"
          },
          "cep": {
            "pattern": "^[0-9]{8}$",
            "title": "Cep",
            "type": "string"
          },
          "codigo_municipio": {
            "description": "Código IBGE",
            "pattern": "^[0-9]{7}$",
            "title": "Codigo Municipio",
            "type": "string"
          },
          "complemento": {
            "anyOf": [
              {
                "maxLength": 156,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Complemento"
          },
          "logradouro": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Logradouro",
            "type": "string"
          },
          "numero": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Numero",
            "type": "string"
          }
        },
        "required": [
          "codigo_municipio",
          "cep",
          "logradouro",
          "numero",
          "bairro"
        ],
        "title": "Endereco",
        "type": "object"
      },
      "EnderecoImovel": {
        "description": "Endereço do imóvel no IBS/CBS (TCEnderObraEvento): sem código de município.",
        "properties": {
          "bairro": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Bairro",
            "type": "string"
          },
          "cep": {
            "pattern": "^[0-9]{8}$",
            "title": "Cep",
            "type": "string"
          },
          "complemento": {
            "anyOf": [
              {
                "maxLength": 156,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Complemento"
          },
          "logradouro": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Logradouro",
            "type": "string"
          },
          "numero": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Numero",
            "type": "string"
          }
        },
        "required": [
          "cep",
          "logradouro",
          "numero",
          "bairro"
        ],
        "title": "EnderecoImovel",
        "type": "object"
      },
      "EnvioEmailSaida": {
        "properties": {
          "criado_em": {
            "format": "date-time",
            "title": "Criado Em",
            "type": "string"
          },
          "destinatario": {
            "title": "Destinatario",
            "type": "string"
          },
          "enviado_em": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enviado Em"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "nota_id": {
            "format": "uuid",
            "title": "Nota Id",
            "type": "string"
          },
          "proxima_tentativa": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxima Tentativa"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tentativas": {
            "title": "Tentativas",
            "type": "integer"
          },
          "tipo": {
            "title": "Tipo",
            "type": "string"
          },
          "ultimo_erro": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ultimo Erro"
          }
        },
        "required": [
          "id",
          "nota_id",
          "destinatario",
          "tipo",
          "status",
          "tentativas",
          "proxima_tentativa",
          "ultimo_erro",
          "enviado_em",
          "criado_em"
        ],
        "title": "EnvioEmailSaida",
        "type": "object"
      },
      "ErroFiscal": {
        "properties": {
          "codigo": {
            "title": "Codigo",
            "type": "string"
          },
          "mensagem": {
            "title": "Mensagem",
            "type": "string"
          }
        },
        "required": [
          "codigo",
          "mensagem"
        ],
        "title": "ErroFiscal",
        "type": "object"
      },
      "EventoSaida": {
        "properties": {
          "criado_em": {
            "format": "date-time",
            "title": "Criado Em",
            "type": "string"
          },
          "erros": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErroFiscal"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erros"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "justificativa": {
            "title": "Justificativa",
            "type": "string"
          },
          "motivo": {
            "title": "Motivo",
            "type": "integer"
          },
          "registrado": {
            "title": "Registrado",
            "type": "boolean"
          },
          "tipo": {
            "title": "Tipo",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tipo",
          "registrado",
          "motivo",
          "justificativa",
          "erros",
          "criado_em"
        ],
        "title": "EventoSaida",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "IbsCbs": {
        "description": "Grupo da Reforma Tributária. Só leva classificação e indicadores: valores e alíquotas a Sefin calcula.",
        "properties": {
          "classificacao_tributaria": {
            "pattern": "^[0-9]{6}$",
            "title": "Classificacao Tributaria",
            "type": "string"
          },
          "consumidor_final": {
            "anyOf": [
              {
                "enum": [
                  0,
                  1
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consumidor Final"
          },
          "credito_presumido": {
            "anyOf": [
              {
                "pattern": "^[0-9]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credito Presumido"
          },
          "cst": {
            "pattern": "^[0-9]{3}$",
            "title": "Cst",
            "type": "string"
          },
          "destinatario": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DestinatarioIbsCbs"
              },
              {
                "type": "null"
              }
            ]
          },
          "diferimento": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Diferimento"
              },
              {
                "type": "null"
              }
            ]
          },
          "imovel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImovelIbsCbs"
              },
              {
                "type": "null"
              }
            ]
          },
          "indicador_operacao": {
            "pattern": "^[0-9]{6}$",
            "title": "Indicador Operacao",
            "type": "string"
          },
          "notas_referenciadas": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9]{6}[0-9A-Z]{14}[0-9]{30}$",
                  "type": "string"
                },
                "maxItems": 99,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notas Referenciadas"
          },
          "tipo_ente_governamental": {
            "anyOf": [
              {
                "enum": [
                  1,
                  2,
                  3,
                  4
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tipo Ente Governamental"
          },
          "tipo_operacao": {
            "anyOf": [
              {
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tipo Operacao"
          },
          "tributacao_regular": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TributacaoRegular"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "cst",
          "classificacao_tributaria",
          "indicador_operacao"
        ],
        "title": "IbsCbs",
        "type": "object"
      },
      "ImovelIbsCbs": {
        "description": "Imóvel da operação. Informe o CIB ou o endereço (um dos dois).",
        "properties": {
          "cib": {
            "anyOf": [
              {
                "maxLength": 8,
                "minLength": 8,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cib"
          },
          "endereco": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EnderecoImovel"
              },
              {
                "type": "null"
              }
            ]
          },
          "inscricao_imobiliaria": {
            "anyOf": [
              {
                "maxLength": 30,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inscricao Imobiliaria"
          }
        },
        "title": "ImovelIbsCbs",
        "type": "object"
      },
      "InformacoesComplementares": {
        "description": "infoCompl: referências do pedido/contrato e texto livre que saem na NFS-e.",
        "properties": {
          "documento_referencia": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Documento Referencia"
          },
          "documento_tecnico": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Documento Tecnico"
          },
          "itens_pedido": {
            "items": {
              "maxLength": 60,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 99,
            "title": "Itens Pedido",
            "type": "array"
          },
          "numero_pedido": {
            "anyOf": [
              {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Numero Pedido"
          },
          "texto": {
            "anyOf": [
              {
                "maxLength": 2000,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Texto"
          }
        },
        "title": "InformacoesComplementares",
        "type": "object"
      },
      "ListaEmpresas": {
        "properties": {
          "itens": {
            "items": {
              "$ref": "#/components/schemas/EmpresaSaida"
            },
            "title": "Itens",
            "type": "array"
          },
          "proximo_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Passe em `cursor` para a página seguinte; nulo na última.",
            "title": "Proximo Cursor"
          }
        },
        "required": [
          "itens",
          "proximo_cursor"
        ],
        "title": "ListaEmpresas",
        "type": "object"
      },
      "ListaNotas": {
        "properties": {
          "itens": {
            "items": {
              "$ref": "#/components/schemas/ResumoNota"
            },
            "title": "Itens",
            "type": "array"
          },
          "proximo_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Passe em `cursor` para a página seguinte; nulo na última.",
            "title": "Proximo Cursor"
          }
        },
        "required": [
          "itens",
          "proximo_cursor"
        ],
        "title": "ListaNotas",
        "type": "object"
      },
      "MotivoCancelamento": {
        "enum": [
          1,
          2,
          9
        ],
        "title": "MotivoCancelamento",
        "type": "integer"
      },
      "MotivoSubstituicao": {
        "enum": [
          1,
          2,
          3,
          4,
          5,
          99
        ],
        "title": "MotivoSubstituicao",
        "type": "integer"
      },
      "NotaSaida": {
        "properties": {
          "chave_acesso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chave Acesso"
          },
          "chave_idempotencia": {
            "title": "Chave Idempotencia",
            "type": "string"
          },
          "chave_substituida": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chave Substituida"
          },
          "competencia": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Competencia"
          },
          "email_tomador": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Tomador"
          },
          "emitida_em": {
            "format": "date-time",
            "title": "Emitida Em",
            "type": "string"
          },
          "empresa_id": {
            "format": "uuid",
            "title": "Empresa Id",
            "type": "string"
          },
          "erros": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErroFiscal"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erros"
          },
          "eventos": {
            "items": {
              "$ref": "#/components/schemas/EventoSaida"
            },
            "title": "Eventos",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "numero": {
            "title": "Numero",
            "type": "integer"
          },
          "proxima_tentativa": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxima Tentativa"
          },
          "serie": {
            "title": "Serie",
            "type": "string"
          },
          "servico": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ServicoResumo"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tentativas": {
            "title": "Tentativas",
            "type": "integer"
          },
          "tomador": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TomadorResumo"
              },
              {
                "type": "null"
              }
            ]
          },
          "valor_servico": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valor Servico"
          }
        },
        "required": [
          "id",
          "empresa_id",
          "chave_idempotencia",
          "serie",
          "numero",
          "status",
          "emitida_em",
          "chave_acesso",
          "erros",
          "tentativas",
          "proxima_tentativa",
          "email_tomador",
          "eventos"
        ],
        "title": "NotaSaida",
        "type": "object"
      },
      "PedidoCancelamento": {
        "properties": {
          "justificativa": {
            "maxLength": 255,
            "minLength": 15,
            "title": "Justificativa",
            "type": "string"
          },
          "motivo": {
            "$ref": "#/components/schemas/MotivoCancelamento"
          }
        },
        "required": [
          "motivo",
          "justificativa"
        ],
        "title": "PedidoCancelamento",
        "type": "object"
      },
      "PedidoEmissao": {
        "description": "O que o app pede ao emissor. A chave de idempotência evita nota duplicada.",
        "properties": {
          "chave_idempotencia": {
            "maxLength": 100,
            "minLength": 1,
            "title": "Chave Idempotencia",
            "type": "string"
          },
          "competencia": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Competencia"
          },
          "empresa_id": {
            "format": "uuid",
            "title": "Empresa Id",
            "type": "string"
          },
          "enviar_email": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enviar Email"
          },
          "ibscbs": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IbsCbs"
              },
              {
                "type": "null"
              }
            ]
          },
          "servico": {
            "$ref": "#/components/schemas/Servico"
          },
          "substituicao": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Substituicao"
              },
              {
                "type": "null"
              }
            ]
          },
          "tomador": {
            "$ref": "#/components/schemas/Tomador"
          },
          "valores": {
            "$ref": "#/components/schemas/Valores"
          }
        },
        "required": [
          "empresa_id",
          "chave_idempotencia",
          "tomador",
          "servico",
          "valores"
        ],
        "title": "PedidoEmissao",
        "type": "object"
      },
      "PisCofins": {
        "description": "Grupo piscofins de tribFed: apuração própria e tipo de retenção.",
        "properties": {
          "aliquota_cofins": {
            "anyOf": [
              {
                "exclusiveMaximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aliquota Cofins"
          },
          "aliquota_pis": {
            "anyOf": [
              {
                "exclusiveMaximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aliquota Pis"
          },
          "base_calculo": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Calculo"
          },
          "cst": {
            "title": "Cst",
            "type": "string"
          },
          "tipo_retencao": {
            "anyOf": [
              {
                "enum": [
                  0,
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tipo Retencao"
          },
          "valor_cofins": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valor Cofins"
          },
          "valor_pis": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valor Pis"
          }
        },
        "required": [
          "cst"
        ],
        "title": "PisCofins",
        "type": "object"
      },
      "ResumoNota": {
        "description": "Linha da listagem de notas: sem XML, eventos nem dado de tomador.",
        "properties": {
          "chave_acesso": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chave Acesso"
          },
          "emitida_em": {
            "format": "date-time",
            "title": "Emitida Em",
            "type": "string"
          },
          "empresa_id": {
            "format": "uuid",
            "title": "Empresa Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "numero": {
            "title": "Numero",
            "type": "integer"
          },
          "serie": {
            "title": "Serie",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "valor_servico": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valor Servico"
          }
        },
        "required": [
          "id",
          "empresa_id",
          "serie",
          "numero",
          "status",
          "emitida_em",
          "chave_acesso",
          "valor_servico"
        ],
        "title": "ResumoNota",
        "type": "object"
      },
      "Servico": {
        "properties": {
          "codigo_municipio_prestacao": {
            "description": "Código IBGE",
            "pattern": "^[0-9]{7}$",
            "title": "Codigo Municipio Prestacao",
            "type": "string"
          },
          "codigo_nbs": {
            "anyOf": [
              {
                "pattern": "^[0-9]{9}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Codigo Nbs"
          },
          "codigo_tributacao_nacional": {
            "pattern": "^[0-9]{6}$",
            "title": "Codigo Tributacao Nacional",
            "type": "string"
          },
          "descricao": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Descricao",
            "type": "string"
          },
          "informacoes_complementares": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InformacoesComplementares"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "codigo_tributacao_nacional",
          "descricao",
          "codigo_municipio_prestacao"
        ],
        "title": "Servico",
        "type": "object"
      },
      "ServicoResumo": {
        "properties": {
          "codigo_tributacao_nacional": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Codigo Tributacao Nacional"
          },
          "descricao": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Descricao"
          }
        },
        "required": [
          "codigo_tributacao_nacional",
          "descricao"
        ],
        "title": "ServicoResumo",
        "type": "object"
      },
      "ServicoSalvoEntrada": {
        "description": "Serviço favorito da empresa (\"Meus serviços\"). Código, município e NBS são conferidos nas tabelas oficiais.",
        "properties": {
          "apelido": {
            "maxLength": 60,
            "minLength": 1,
            "title": "Apelido",
            "type": "string"
          },
          "codigo_municipio_prestacao": {
            "description": "Código IBGE ou 0000000",
            "maxLength": 7,
            "minLength": 7,
            "title": "Codigo Municipio Prestacao",
            "type": "string"
          },
          "codigo_nbs": {
            "anyOf": [
              {
                "maxLength": 13,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "9 dígitos; aceita pontos",
            "title": "Codigo Nbs"
          },
          "codigo_tributacao_nacional": {
            "description": "6 dígitos; aceita pontos",
            "maxLength": 8,
            "minLength": 6,
            "title": "Codigo Tributacao Nacional",
            "type": "string"
          },
          "descricao": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Descricao",
            "type": "string"
          }
        },
        "required": [
          "apelido",
          "codigo_tributacao_nacional",
          "codigo_municipio_prestacao",
          "descricao"
        ],
        "title": "ServicoSalvoEntrada",
        "type": "object"
      },
      "ServicoSalvoSaida": {
        "properties": {
          "apelido": {
            "title": "Apelido",
            "type": "string"
          },
          "codigo_municipio_prestacao": {
            "title": "Codigo Municipio Prestacao",
            "type": "string"
          },
          "codigo_nbs": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Codigo Nbs"
          },
          "codigo_tributacao_nacional": {
            "title": "Codigo Tributacao Nacional",
            "type": "string"
          },
          "criado_em": {
            "format": "date-time",
            "title": "Criado Em",
            "type": "string"
          },
          "descricao": {
            "title": "Descricao",
            "type": "string"
          },
          "empresa_id": {
            "format": "uuid",
            "title": "Empresa Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "empresa_id",
          "apelido",
          "codigo_tributacao_nacional",
          "codigo_municipio_prestacao",
          "descricao",
          "codigo_nbs",
          "criado_em"
        ],
        "title": "ServicoSalvoSaida",
        "type": "object"
      },
      "Substituicao": {
        "description": "A DPS substitui uma NFS-e já autorizada. A Sefin cancela a antiga por substituição (evento 105102).",
        "properties": {
          "chave_acesso": {
            "description": "Chave de acesso (50 posições) da NFS-e substituída",
            "pattern": "^[0-9]{6}[0-9A-Z]{14}[0-9]{30}$",
            "title": "Chave Acesso",
            "type": "string"
          },
          "justificativa": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 15,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Justificativa"
          },
          "motivo": {
            "$ref": "#/components/schemas/MotivoSubstituicao"
          }
        },
        "required": [
          "chave_acesso",
          "motivo"
        ],
        "title": "Substituicao",
        "type": "object"
      },
      "Tomador": {
        "properties": {
          "cnpj": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cnpj"
          },
          "cpf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpf"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "endereco": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Endereco"
              },
              {
                "type": "null"
              }
            ]
          },
          "nome": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Nome",
            "type": "string"
          },
          "telefone": {
            "anyOf": [
              {
                "pattern": "^[0-9]{6,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Telefone"
          }
        },
        "required": [
          "nome"
        ],
        "title": "Tomador",
        "type": "object"
      },
      "TomadorResumo": {
        "properties": {
          "cnpj": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cnpj"
          },
          "cpf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpf"
          },
          "nome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nome"
          }
        },
        "required": [
          "nome",
          "cpf",
          "cnpj"
        ],
        "title": "TomadorResumo",
        "type": "object"
      },
      "TributacaoRegular": {
        "description": "gTribRegular: situação e classificação da tributação regular (quando a classificação exige).",
        "properties": {
          "classificacao_tributaria": {
            "pattern": "^[0-9]{6}$",
            "title": "Classificacao Tributaria",
            "type": "string"
          },
          "cst": {
            "pattern": "^[0-9]{3}$",
            "title": "Cst",
            "type": "string"
          }
        },
        "required": [
          "cst",
          "classificacao_tributaria"
        ],
        "title": "TributacaoRegular",
        "type": "object"
      },
      "TributosFederais": {
        "description": "tribFed: PIS/COFINS e retenções de CP, IRRF e CSLL (valores em R$, já calculados pelo app).",
        "properties": {
          "pis_cofins": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PisCofins"
              },
              {
                "type": "null"
              }
            ]
          },
          "retencao_cp": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retencao Cp"
          },
          "retencao_csll": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retencao Csll"
          },
          "retencao_irrf": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retencao Irrf"
          }
        },
        "title": "TributosFederais",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "Valores": {
        "properties": {
          "aliquota_issqn": {
            "anyOf": [
              {
                "maximum": 5.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aliquota Issqn"
          },
          "desconto_condicionado": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Desconto Condicionado"
          },
          "desconto_incondicionado": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Desconto Incondicionado"
          },
          "retencao_issqn": {
            "default": 1,
            "enum": [
              1,
              2,
              3
            ],
            "title": "Retencao Issqn",
            "type": "integer"
          },
          "tributacao_issqn": {
            "default": 1,
            "enum": [
              1,
              2,
              3,
              4
            ],
            "title": "Tributacao Issqn",
            "type": "integer"
          },
          "tributos_federais": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TributosFederais"
              },
              {
                "type": "null"
              }
            ]
          },
          "valor_servico": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "title": "Valor Servico"
          }
        },
        "required": [
          "valor_servico"
        ],
        "title": "Valores",
        "type": "object"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "description": "Chave de API (conta ou plataforma)",
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "title": "API de NFS-e",
    "version": "1.6.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/conta": {
      "get": {
        "description": "Conta dona da chave: situação, plano, uso da cota de notas e o complemento Assistente.",
        "operationId": "obter_conta_v1_conta_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "404": {
            "description": "Chave da plataforma (sem conta)"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Obter Conta"
      }
    },
    "/v1/empresas": {
      "get": {
        "description": "Empresas da conta (com a chave da plataforma, de todas), por CNPJ.",
        "operationId": "listar_empresas_v1_empresas_get",
        "parameters": [
          {
            "in": "query",
            "name": "limite",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limite",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListaEmpresas"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Listar Empresas"
      },
      "post": {
        "operationId": "criar_empresa_v1_empresas_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmpresaEntrada"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmpresaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Criar Empresa"
      }
    },
    "/v1/empresas/{empresa_id}": {
      "get": {
        "operationId": "obter_empresa_v1_empresas__empresa_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmpresaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Obter Empresa"
      }
    },
    "/v1/empresas/{empresa_id}/acervo": {
      "get": {
        "description": "ZIP com os XML das NFS-e do período (data de emissão, no fuso do município).\n\nLeva também o XML dos cancelamentos e um `indice.csv` (sem dados do tomador).\nMáximo de 366 dias e 2000 notas por pedido; período sem nota responde 404.",
        "operationId": "baixar_acervo_v1_empresas__empresa_id__acervo_get",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "de",
            "required": true,
            "schema": {
              "format": "date",
              "title": "De",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ate",
            "required": true,
            "schema": {
              "format": "date",
              "title": "Ate",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Baixar Acervo"
      }
    },
    "/v1/empresas/{empresa_id}/certificado": {
      "get": {
        "operationId": "obter_certificado_v1_empresas__empresa_id__certificado_get",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertificadoSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Obter Certificado"
      },
      "post": {
        "description": "Recebe o A1 da empresa. É o mesmo caminho usado pelo portal.\n\nA senha só é usada para abrir o .pfx e não é guardada.",
        "operationId": "enviar_certificado_v1_empresas__empresa_id__certificado_post",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_enviar_certificado_v1_empresas__empresa_id__certificado_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertificadoSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Enviar Certificado"
      }
    },
    "/v1/empresas/{empresa_id}/clientes": {
      "get": {
        "description": "Clientes salvos da empresa (tela \"Clientes\" do portal), em ordem de nome. Removidos não aparecem.",
        "operationId": "listar_clientes_v1_empresas__empresa_id__clientes_get",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ClienteSalvoSaida"
                  },
                  "title": "Response Listar Clientes V1 Empresas  Empresa Id  Clientes Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Listar Clientes"
      },
      "post": {
        "description": "Cria o cliente; se a empresa já tem um com o mesmo CPF/CNPJ, atualiza esse (200) sem apagar endereço,\ne-mail e telefone que o pedido não trouxe. Até 500 clientes por empresa.",
        "operationId": "salvar_cliente_v1_empresas__empresa_id__clientes_post",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteSalvoEntrada"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteSalvoSaida"
                }
              }
            },
            "description": "Já havia cliente com este documento: atualizado"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteSalvoSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Salvar Cliente"
      }
    },
    "/v1/empresas/{empresa_id}/clientes/{cliente_id}": {
      "delete": {
        "description": "Tira o cliente da lista (fica guardado, desativado). Removido ou de outra empresa: 404.",
        "operationId": "remover_cliente_v1_empresas__empresa_id__clientes__cliente_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cliente_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Cliente Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Remover Cliente"
      },
      "put": {
        "description": "Substitui o cadastro inteiro (o que não vier fica vazio). CPF/CNPJ de outro cliente ativo: 422.",
        "operationId": "editar_cliente_v1_empresas__empresa_id__clientes__cliente_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cliente_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Cliente Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteSalvoEntrada"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClienteSalvoSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Editar Cliente"
      }
    },
    "/v1/empresas/{empresa_id}/diagnostico": {
      "get": {
        "description": "Testa certificado + mTLS + TLS da Sefin com uma consulta. Não emite nada.",
        "operationId": "diagnosticar_v1_empresas__empresa_id__diagnostico_get",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "servico",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[0-9]{6}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Servico"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Diagnosticar V1 Empresas  Empresa Id  Diagnostico Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Diagnosticar"
      }
    },
    "/v1/empresas/{empresa_id}/email": {
      "put": {
        "description": "Nome, Reply-To, cópia e envio automático das NFS-e por e-mail desta empresa.",
        "operationId": "configurar_email_v1_empresas__empresa_id__email_put",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailEmpresa"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmpresaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Configurar Email"
      }
    },
    "/v1/empresas/{empresa_id}/servicos": {
      "get": {
        "description": "Serviços salvos da empresa (\"Meus serviços\"), em ordem de apelido. Removidos não aparecem.",
        "operationId": "listar_servicos_v1_empresas__empresa_id__servicos_get",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ServicoSalvoSaida"
                  },
                  "title": "Response Listar Servicos V1 Empresas  Empresa Id  Servicos Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Listar Servicos"
      },
      "post": {
        "description": "Mesmas regras da tela: código, município e NBS das tabelas oficiais, apelido único, até 50 por empresa.",
        "operationId": "criar_servico_v1_empresas__empresa_id__servicos_post",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicoSalvoEntrada"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicoSalvoSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Criar Servico"
      }
    },
    "/v1/empresas/{empresa_id}/servicos/{servico_id}": {
      "delete": {
        "description": "Tira o serviço da lista (fica guardado, desativado). Removido ou de outra empresa: 404.",
        "operationId": "remover_servico_v1_empresas__empresa_id__servicos__servico_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "empresa_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Empresa Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "servico_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Servico Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Remover Servico"
      }
    },
    "/v1/notas": {
      "get": {
        "description": "Notas da conta, da mais recente para a mais antiga, sem XML nem dado de tomador.",
        "operationId": "listar_notas_v1_notas_get",
        "parameters": [
          {
            "in": "query",
            "name": "empresa_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Empresa Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "pendente",
                    "autorizada",
                    "rejeitada",
                    "erro_comunicacao",
                    "cancelada"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "description": "Emitida a partir de (inclusivo); sem fuso, vale UTC",
            "in": "query",
            "name": "de",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Emitida a partir de (inclusivo); sem fuso, vale UTC",
              "title": "De"
            }
          },
          {
            "description": "Emitida antes de (exclusivo); sem fuso, vale UTC",
            "in": "query",
            "name": "ate",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Emitida antes de (exclusivo); sem fuso, vale UTC",
              "title": "Ate"
            }
          },
          {
            "in": "query",
            "name": "limite",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limite",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListaNotas"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Listar Notas"
      },
      "post": {
        "operationId": "emitir_v1_notas_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoEmissao"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Emitir"
      }
    },
    "/v1/notas/previa": {
      "post": {
        "description": "XML da DPS assinado e validado no XSD, SEM enviar e sem reservar número.\n\nUsa o próximo número da empresa só para ilustrar; na emissão real o número\né reservado na hora.",
        "operationId": "previa_v1_notas_previa_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoEmissao"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Previa"
      }
    },
    "/v1/notas/previa/danfse": {
      "post": {
        "description": "PDF de conferência \"sem validade\" da nota que seria emitida; não envia nada nem reserva número.",
        "operationId": "previa_danfse_v1_notas_previa_danfse_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoEmissao"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Previa Danfse"
      }
    },
    "/v1/notas/{nota_id}": {
      "get": {
        "operationId": "obter_v1_notas__nota_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Obter"
      }
    },
    "/v1/notas/{nota_id}/cancelamento": {
      "post": {
        "operationId": "cancelar_v1_notas__nota_id__cancelamento_post",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoCancelamento"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Cancelar"
      }
    },
    "/v1/notas/{nota_id}/danfse": {
      "get": {
        "description": "PDF da nota (DANFSe, NT 008), para o app enviar ao cliente.\n\nMontado só a partir do XML da NFS-e devolvido pela Sefin. Nota cancelada\nsai com a marca d'água \"CANCELADA\".",
        "operationId": "danfse_v1_notas__nota_id__danfse_get",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Danfse"
      }
    },
    "/v1/notas/{nota_id}/email": {
      "post": {
        "description": "Pede o envio (ou reenvio) da NFS-e ao tomador. O e-mail sai em instantes, pela fila.",
        "operationId": "enviar_email_nota_v1_notas__nota_id__email_post",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailNotaEntrada"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvioEmailSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Enviar Email Nota"
      }
    },
    "/v1/notas/{nota_id}/emails": {
      "get": {
        "operationId": "historico_emails_v1_notas__nota_id__emails_get",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EnvioEmailSaida"
                  },
                  "title": "Response Historico Emails V1 Notas  Nota Id  Emails Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Historico Emails"
      }
    },
    "/v1/notas/{nota_id}/reprocessar": {
      "post": {
        "description": "Força agora a recuperação de uma nota sem resposta da Sefin.",
        "operationId": "reprocessar_v1_notas__nota_id__reprocessar_post",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotaSaida"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Reprocessar"
      }
    },
    "/v1/notas/{nota_id}/xml": {
      "get": {
        "description": "XML da NFS-e como a Sefin devolveu (o documento fiscal de fato).",
        "operationId": "xml_nfse_v1_notas__nota_id__xml_get",
        "parameters": [
          {
            "in": "path",
            "name": "nota_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Nota Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Chave de API ausente ou inválida"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Xml Nfse"
      }
    }
  }
}
