{"openapi": "3.1.0", "info": {"title": "Simplifisca API", "version": "1.0.0", "description": "API de nota fiscal para SaaS: NF-e (modelo 55) e NFS-e Padrão Nacional. Emissão assíncrona com webhooks assinados. Guia: /docs/ · Para agentes de IA: /llms-full.txt · MCP: /mcp"}, "servers": [{"url": "https://app.simplifisca.com.br"}], "security": [{"bearer": []}], "components": {"securitySchemes": {"bearer": {"type": "http", "scheme": "bearer", "bearerFormat": "sf_live_..."}}, "schemas": {"CancelamentoEntrada": {"additionalProperties": false, "properties": {"justificativa": {"maxLength": 255, "minLength": 15, "title": "Justificativa", "type": "string"}}, "required": ["justificativa"], "title": "CancelamentoEntrada", "type": "object"}, "CertificadoEntrada": {"additionalProperties": false, "properties": {"arquivoBase64": {"description": "Conteúdo do arquivo .pfx/.p12 em Base64.", "minLength": 10, "title": "Arquivobase64", "type": "string"}, "senha": {"maxLength": 200, "title": "Senha", "type": "string"}}, "required": ["arquivoBase64", "senha"], "title": "CertificadoEntrada", "type": "object"}, "ConfigNumeracao": {"additionalProperties": false, "properties": {"serie": {"default": "1", "maxLength": 3, "pattern": "^\\d{1,3}$", "title": "Serie", "type": "string"}, "proximoNumero": {"default": 1, "maximum": 999999999, "minimum": 1, "title": "Proximonumero", "type": "integer"}}, "title": "ConfigNumeracao", "type": "object"}, "DestinatarioEntrada": {"additionalProperties": false, "properties": {"cpfCnpj": {"title": "Cpfcnpj", "type": "string"}, "nome": {"maxLength": 60, "minLength": 2, "title": "Nome", "type": "string"}, "email": {"default": "", "maxLength": 60, "title": "Email", "type": "string"}, "telefone": {"default": "", "maxLength": 14, "title": "Telefone", "type": "string"}, "indicadorIe": {"default": 9, "description": "1 contribuinte, 2 isento, 9 não contribuinte.", "enum": [1, 2, 9], "title": "Indicadorie", "type": "integer"}, "inscricaoEstadual": {"default": "", "maxLength": 14, "title": "Inscricaoestadual", "type": "string"}, "endereco": {"$ref": "#/components/schemas/Endereco"}}, "required": ["cpfCnpj", "nome", "endereco"], "title": "DestinatarioEntrada", "type": "object"}, "EmitenteAtualizacao": {"additionalProperties": false, "description": "Todos os campos opcionais (PATCH).", "properties": {"razaoSocial": {"anyOf": [{"maxLength": 60, "minLength": 2, "type": "string"}, {"type": "null"}], "default": null, "title": "Razaosocial"}, "nomeFantasia": {"anyOf": [{"maxLength": 60, "type": "string"}, {"type": "null"}], "default": null, "title": "Nomefantasia"}, "inscricaoEstadual": {"anyOf": [{"maxLength": 14, "type": "string"}, {"type": "null"}], "default": null, "title": "Inscricaoestadual"}, "inscricaoMunicipal": {"anyOf": [{"maxLength": 15, "type": "string"}, {"type": "null"}], "default": null, "title": "Inscricaomunicipal"}, "cnae": {"anyOf": [{"maxLength": 7, "type": "string"}, {"type": "null"}], "default": null, "title": "Cnae"}, "regimeTributario": {"anyOf": [{"enum": [1, 2, 3, 4], "type": "integer"}, {"type": "null"}], "default": null, "title": "Regimetributario"}, "regimeEspecialTributacao": {"anyOf": [{"maximum": 9, "minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "title": "Regimeespecialtributacao"}, "ambiente": {"anyOf": [{"enum": ["homologacao", "producao"], "type": "string"}, {"type": "null"}], "default": null, "title": "Ambiente"}, "endereco": {"anyOf": [{"$ref": "#/components/schemas/Endereco"}, {"type": "null"}], "default": null}, "email": {"anyOf": [{"maxLength": 254, "type": "string"}, {"type": "null"}], "default": null, "title": "Email"}, "telefone": {"anyOf": [{"maxLength": 20, "type": "string"}, {"type": "null"}], "default": null, "title": "Telefone"}, "nfe": {"anyOf": [{"$ref": "#/components/schemas/ConfigNumeracao"}, {"type": "null"}], "default": null}, "nfse": {"anyOf": [{"$ref": "#/components/schemas/ConfigNumeracao"}, {"type": "null"}], "default": null}}, "title": "EmitenteAtualizacao", "type": "object"}, "EmitenteEntrada": {"additionalProperties": false, "properties": {"cnpj": {"title": "Cnpj", "type": "string"}, "razaoSocial": {"maxLength": 60, "minLength": 2, "title": "Razaosocial", "type": "string"}, "nomeFantasia": {"default": "", "maxLength": 60, "title": "Nomefantasia", "type": "string"}, "inscricaoEstadual": {"default": "", "description": "Obrigatória para NF-e. Use \"ISENTO\" se aplicável.", "maxLength": 14, "title": "Inscricaoestadual", "type": "string"}, "inscricaoMunicipal": {"default": "", "description": "Obrigatória para NFS-e na maioria dos municípios.", "maxLength": 15, "title": "Inscricaomunicipal", "type": "string"}, "cnae": {"default": "", "maxLength": 7, "title": "Cnae", "type": "string"}, "regimeTributario": {"default": 1, "description": "CRT: 1 Simples Nacional, 2 Simples excesso de sublimite, 3 Regime normal, 4 MEI.", "enum": [1, 2, 3, 4], "title": "Regimetributario", "type": "integer"}, "regimeEspecialTributacao": {"default": 0, "description": "NFS-e: 0 nenhum (padrão).", "maximum": 9, "minimum": 0, "title": "Regimeespecialtributacao", "type": "integer"}, "ambiente": {"default": "homologacao", "enum": ["homologacao", "producao"], "title": "Ambiente", "type": "string"}, "endereco": {"$ref": "#/components/schemas/Endereco"}, "email": {"default": "", "maxLength": 254, "title": "Email", "type": "string"}, "telefone": {"default": "", "maxLength": 20, "title": "Telefone", "type": "string"}, "nfe": {"$ref": "#/components/schemas/ConfigNumeracao"}, "nfse": {"$ref": "#/components/schemas/ConfigNumeracao"}}, "required": ["cnpj", "razaoSocial", "endereco"], "title": "EmitenteEntrada", "type": "object"}, "Endereco": {"additionalProperties": false, "properties": {"logradouro": {"maxLength": 60, "minLength": 1, "title": "Logradouro", "type": "string"}, "numero": {"description": "Use \"S/N\" quando não houver.", "maxLength": 60, "minLength": 1, "title": "Numero", "type": "string"}, "complemento": {"default": "", "maxLength": 60, "title": "Complemento", "type": "string"}, "bairro": {"maxLength": 60, "minLength": 1, "title": "Bairro", "type": "string"}, "codigoMunicipio": {"description": "Código IBGE do município (7 dígitos).", "title": "Codigomunicipio", "type": "string"}, "municipio": {"default": "", "maxLength": 60, "title": "Municipio", "type": "string"}, "uf": {"description": "Sigla da UF, ex.: SP.", "title": "Uf", "type": "string"}, "cep": {"description": "CEP com 8 dígitos.", "title": "Cep", "type": "string"}}, "required": ["logradouro", "numero", "bairro", "codigoMunicipio", "uf", "cep"], "title": "Endereco", "type": "object"}, "EnderecoNfse": {"additionalProperties": false, "properties": {"logradouro": {"maxLength": 255, "minLength": 1, "title": "Logradouro", "type": "string"}, "numero": {"maxLength": 60, "minLength": 1, "title": "Numero", "type": "string"}, "complemento": {"default": "", "maxLength": 156, "title": "Complemento", "type": "string"}, "bairro": {"maxLength": 60, "minLength": 1, "title": "Bairro", "type": "string"}, "codigoMunicipio": {"title": "Codigomunicipio", "type": "string"}, "uf": {"default": "", "title": "Uf", "type": "string"}, "cep": {"title": "Cep", "type": "string"}}, "required": ["logradouro", "numero", "bairro", "codigoMunicipio", "cep"], "title": "EnderecoNfse", "type": "object"}, "IcmsEntrada": {"additionalProperties": false, "properties": {"origem": {"default": 0, "description": "Origem da mercadoria (0 nacional).", "maximum": 8, "minimum": 0, "title": "Origem", "type": "integer"}, "csosn": {"anyOf": [{"enum": ["101", "102", "103", "300", "400"], "type": "string"}, {"type": "null"}], "default": null, "description": "Simples Nacional. Informe csosn OU cst.", "title": "Csosn"}, "cst": {"anyOf": [{"enum": ["00", "20", "40", "41", "50"], "type": "string"}, {"type": "null"}], "default": null, "description": "Regime normal.", "title": "Cst"}, "modalidadeBc": {"default": 3, "description": "modBC (3 = valor da operação).", "maximum": 3, "minimum": 0, "title": "Modalidadebc", "type": "integer"}, "baseCalculo": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "Padrão: valor do item.", "title": "Basecalculo"}, "aliquota": {"anyOf": [{"maximum": 100.0, "minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)", "type": "string"}, {"type": "null"}], "default": null, "title": "Aliquota"}, "valor": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "Padrão: baseCalculo × aliquota.", "title": "Valor"}, "reducaoBc": {"anyOf": [{"maximum": 100.0, "minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "Percentual de redução da BC (CST 20).", "title": "Reducaobc"}, "aliquotaCredito": {"anyOf": [{"maximum": 100.0, "minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "pCredSN (CSOSN 101).", "title": "Aliquotacredito"}, "valorCredito": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "vCredICMSSN (CSOSN 101).", "title": "Valorcredito"}}, "title": "IcmsEntrada", "type": "object"}, "ImpostosItem": {"additionalProperties": false, "properties": {"icms": {"$ref": "#/components/schemas/IcmsEntrada"}, "pis": {"$ref": "#/components/schemas/PisCofinsEntrada"}, "cofins": {"$ref": "#/components/schemas/PisCofinsEntrada"}}, "required": ["icms", "pis", "cofins"], "title": "ImpostosItem", "type": "object"}, "ItemNfeEntrada": {"additionalProperties": false, "properties": {"produto": {"anyOf": [{"maxLength": 60, "type": "string"}, {"type": "null"}], "default": null, "description": "Código (SKU) de um produto do catálogo. Preenche descrição, NCM, CFOP, unidade, impostos e preço; qualquer campo enviado no item sobrescreve o do catálogo.", "title": "Produto"}, "codigo": {"anyOf": [{"maxLength": 60, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "title": "Codigo"}, "descricao": {"anyOf": [{"maxLength": 120, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "title": "Descricao"}, "ncm": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "8 dígitos.", "title": "Ncm"}, "cfop": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "4 dígitos, ex.: 5102 (dentro do estado), 6102 (fora).", "title": "Cfop"}, "cest": {"default": "", "title": "Cest", "type": "string"}, "ean": {"default": "SEM GTIN", "maxLength": 14, "title": "Ean", "type": "string"}, "unidade": {"default": "UN", "maxLength": 6, "minLength": 1, "title": "Unidade", "type": "string"}, "quantidade": {"anyOf": [{"exclusiveMinimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,11}|(?=[\\d.]{1,16}0*$)\\d{0,11}\\.\\d{0,4}0*$)", "type": "string"}], "title": "Quantidade"}, "valorUnitario": {"anyOf": [{"exclusiveMinimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,11}|(?=[\\d.]{1,22}0*$)\\d{0,11}\\.\\d{0,10}0*$)", "type": "string"}, {"type": "null"}], "default": null, "title": "Valorunitario"}, "desconto": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}], "default": "0", "title": "Desconto"}, "valorTributosAprox": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}], "default": "0", "description": "Lei da Transparência (IBPT).", "title": "Valortributosaprox"}, "impostos": {"anyOf": [{"$ref": "#/components/schemas/ImpostosItem"}, {"type": "null"}], "default": null}}, "required": ["quantidade"], "title": "ItemNfeEntrada", "type": "object"}, "NfeEntrada": {"additionalProperties": false, "properties": {"emitente": {"description": "ID (UUID) ou CNPJ do emitente.", "title": "Emitente", "type": "string"}, "referencia": {"default": "", "description": "Seu identificador (ex.: id do pedido).", "maxLength": 100, "title": "Referencia", "type": "string"}, "naturezaOperacao": {"default": "Venda de mercadoria", "maxLength": 60, "minLength": 1, "title": "Naturezaoperacao", "type": "string"}, "finalidade": {"default": 1, "description": "1 normal, 2 complementar, 3 ajuste, 4 devolução.", "enum": [1, 2, 3, 4], "title": "Finalidade", "type": "integer"}, "consumidorFinal": {"default": true, "title": "Consumidorfinal", "type": "boolean"}, "presencial": {"default": 2, "description": "indPres: 1 presencial, 2 internet, 9 outros.", "enum": [0, 1, 2, 3, 4, 5, 9], "title": "Presencial", "type": "integer"}, "destinatario": {"$ref": "#/components/schemas/DestinatarioEntrada"}, "itens": {"items": {"$ref": "#/components/schemas/ItemNfeEntrada"}, "maxItems": 990, "minItems": 1, "title": "Itens", "type": "array"}, "pagamentos": {"items": {"$ref": "#/components/schemas/PagamentoEntrada"}, "maxItems": 100, "title": "Pagamentos", "type": "array"}, "modalidadeFrete": {"default": 9, "description": "9 = sem frete.", "enum": [0, 1, 2, 3, 4, 9], "title": "Modalidadefrete", "type": "integer"}, "informacoesComplementares": {"default": "", "maxLength": 5000, "title": "Informacoescomplementares", "type": "string"}, "informacoesFisco": {"default": "", "maxLength": 2000, "title": "Informacoesfisco", "type": "string"}}, "required": ["emitente", "destinatario", "itens"], "title": "NfeEntrada", "type": "object"}, "NfseEntrada": {"additionalProperties": false, "properties": {"emitente": {"description": "ID (UUID) ou CNPJ do emitente.", "title": "Emitente", "type": "string"}, "referencia": {"default": "", "maxLength": 100, "title": "Referencia", "type": "string"}, "competencia": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "default": null, "description": "Padrão: hoje.", "title": "Competencia"}, "tomador": {"$ref": "#/components/schemas/TomadorEntrada"}, "servico": {"$ref": "#/components/schemas/ServicoEntrada"}, "valores": {"$ref": "#/components/schemas/ValoresNfseEntrada"}, "informacoesComplementares": {"default": "", "maxLength": 2000, "title": "Informacoescomplementares", "type": "string"}}, "required": ["emitente", "tomador", "servico"], "title": "NfseEntrada", "type": "object"}, "PagamentoEntrada": {"additionalProperties": false, "properties": {"forma": {"description": "tPag: 01 dinheiro, 03 crédito, 04 débito, 15 boleto, 17 PIX, 90 sem pagamento, 99 outros.", "pattern": "^\\d{2}$", "title": "Forma", "type": "string"}, "valor": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}], "title": "Valor"}, "aPrazo": {"default": false, "title": "Aprazo", "type": "boolean"}}, "required": ["forma", "valor"], "title": "PagamentoEntrada", "type": "object"}, "PisCofinsEntrada": {"additionalProperties": false, "properties": {"cst": {"description": "CST de PIS/COFINS, ex.: 07, 49, 01.", "pattern": "^(0[1-9]|[4-9]\\d)$", "title": "Cst", "type": "string"}, "baseCalculo": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "Padrão: valor do item.", "title": "Basecalculo"}, "aliquota": {"anyOf": [{"maximum": 100.0, "minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)", "type": "string"}, {"type": "null"}], "default": null, "title": "Aliquota"}, "valor": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "title": "Valor"}}, "required": ["cst"], "title": "PisCofinsEntrada", "type": "object"}, "ProdutoEntrada": {"additionalProperties": false, "properties": {"codigo": {"description": "SKU. Use o mesmo código do seu sistema.", "maxLength": 60, "minLength": 1, "title": "Codigo", "type": "string"}, "descricao": {"maxLength": 120, "minLength": 1, "title": "Descricao", "type": "string"}, "ncm": {"description": "8 dígitos.", "title": "Ncm", "type": "string"}, "cfop": {"description": "CFOP padrão de venda, ex.: 5102.", "title": "Cfop", "type": "string"}, "cest": {"default": "", "maxLength": 9, "title": "Cest", "type": "string"}, "unidade": {"default": "UN", "maxLength": 6, "minLength": 1, "title": "Unidade", "type": "string"}, "ean": {"default": "SEM GTIN", "maxLength": 14, "title": "Ean", "type": "string"}, "valorUnitario": {"anyOf": [{"exclusiveMinimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,11}|(?=[\\d.]{1,22}0*$)\\d{0,11}\\.\\d{0,10}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "Preço padrão (opcional; o item da NF-e pode informar outro).", "title": "Valorunitario"}, "impostos": {"$ref": "#/components/schemas/ImpostosItem"}}, "required": ["codigo", "descricao", "ncm", "cfop", "impostos"], "title": "ProdutoEntrada", "type": "object"}, "ServicoCatalogoEntrada": {"additionalProperties": false, "properties": {"codigo": {"description": "Ex.: PLANO-PRO.", "maxLength": 60, "minLength": 1, "title": "Codigo", "type": "string"}, "descricao": {"maxLength": 2000, "minLength": 1, "title": "Descricao", "type": "string"}, "codigoTributacaoNacional": {"description": "cTribNac (6 dígitos), ex.: 010501.", "title": "Codigotributacaonacional", "type": "string"}, "codigoTributacaoMunicipal": {"default": "", "maxLength": 3, "title": "Codigotributacaomunicipal", "type": "string"}, "codigoNbs": {"default": "", "maxLength": 9, "title": "Codigonbs", "type": "string"}, "aliquotaIss": {"anyOf": [{"maximum": 100.0, "minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)", "type": "string"}], "default": "0", "title": "Aliquotaiss"}, "issRetido": {"default": false, "title": "Issretido", "type": "boolean"}, "valor": {"anyOf": [{"exclusiveMinimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "title": "Valor"}}, "required": ["codigo", "descricao", "codigoTributacaoNacional"], "title": "ServicoCatalogoEntrada", "type": "object"}, "ServicoEntrada": {"additionalProperties": false, "properties": {"codigo": {"anyOf": [{"maxLength": 60, "type": "string"}, {"type": "null"}], "default": null, "description": "Código de um serviço do catálogo. Preenche descrição, códigos de tributação, alíquota de ISS e valor; campos enviados sobrescrevem o catálogo.", "title": "Codigo"}, "descricao": {"anyOf": [{"maxLength": 2000, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "title": "Descricao"}, "codigoTributacaoNacional": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "cTribNac (6 dígitos): item + subitem + desdobramento da LC 116, ex.: 010501.", "title": "Codigotributacaonacional"}, "codigoTributacaoMunicipal": {"default": "", "maxLength": 3, "title": "Codigotributacaomunicipal", "type": "string"}, "codigoNbs": {"default": "", "description": "Código NBS (9 dígitos).", "title": "Codigonbs", "type": "string"}, "municipioPrestacao": {"default": "", "description": "IBGE. Padrão: município do emitente.", "title": "Municipioprestacao", "type": "string"}}, "title": "ServicoEntrada", "type": "object"}, "TomadorEntrada": {"additionalProperties": false, "properties": {"cpfCnpj": {"title": "Cpfcnpj", "type": "string"}, "nome": {"maxLength": 150, "minLength": 2, "title": "Nome", "type": "string"}, "email": {"default": "", "maxLength": 80, "title": "Email", "type": "string"}, "telefone": {"default": "", "maxLength": 20, "title": "Telefone", "type": "string"}, "inscricaoMunicipal": {"default": "", "maxLength": 15, "title": "Inscricaomunicipal", "type": "string"}, "endereco": {"anyOf": [{"$ref": "#/components/schemas/EnderecoNfse"}, {"type": "null"}], "default": null}}, "required": ["cpfCnpj", "nome"], "title": "TomadorEntrada", "type": "object"}, "ValoresNfseEntrada": {"additionalProperties": false, "properties": {"servico": {"anyOf": [{"exclusiveMinimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}, {"type": "null"}], "default": null, "description": "Valor do serviço. Opcional se o serviço do catálogo tiver valor.", "title": "Servico"}, "deducoes": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}], "default": "0", "title": "Deducoes"}, "descontoIncondicionado": {"anyOf": [{"minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,13}|(?=[\\d.]{1,16}0*$)\\d{0,13}\\.\\d{0,2}0*$)", "type": "string"}], "default": "0", "title": "Descontoincondicionado"}, "aliquotaIss": {"anyOf": [{"maximum": 100.0, "minimum": 0.0, "type": "number"}, {"pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)", "type": "string"}], "default": "0", "title": "Aliquotaiss"}, "issRetido": {"default": false, "title": "Issretido", "type": "boolean"}}, "title": "ValoresNfseEntrada", "type": "object"}, "WebhookEntrada": {"additionalProperties": false, "properties": {"url": {"maxLength": 500, "title": "Url", "type": "string"}, "eventos": {"description": "Vazio = todos os eventos.", "items": {"enum": ["nfe.autorizada", "nfe.rejeitada", "nfe.erro", "nfe.cancelada", "nfse.autorizada", "nfse.rejeitada", "nfse.erro", "nfse.cancelada"], "type": "string"}, "title": "Eventos", "type": "array"}, "descricao": {"default": "", "maxLength": 255, "title": "Descricao", "type": "string"}}, "required": ["url"], "title": "WebhookEntrada", "type": "object"}, "Documento": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "tipo": {"type": "string", "enum": ["nfe", "nfse"]}, "status": {"type": "string", "enum": ["processando", "autorizada", "rejeitada", "erro", "cancelando", "cancelada"]}, "ambiente": {"type": "string", "enum": ["homologacao", "producao"]}, "referencia": {"type": ["string", "null"]}, "emitente": {"type": "object", "properties": {"id": {"type": "string"}, "cnpj": {"type": "string"}}}, "numero": {"type": ["integer", "null"]}, "numeroNfse": {"type": ["string", "null"], "description": "Somente NFS-e: número atribuído pelo sistema nacional."}, "serie": {"type": "string"}, "chaveAcesso": {"type": ["string", "null"]}, "protocolo": {"type": ["string", "null"]}, "valorTotal": {"type": "string", "example": "119.80"}, "sefaz": {"type": "object", "properties": {"codigo": {"type": ["string", "null"]}, "mensagem": {"type": ["string", "null"]}}}, "tentativas": {"type": "integer"}, "criadoEm": {"type": "string", "format": "date-time"}, "autorizadoEm": {"type": ["string", "null"], "format": "date-time"}, "canceladoEm": {"type": ["string", "null"], "format": "date-time"}, "links": {"type": "object", "properties": {"self": {"type": "string"}, "xml": {"type": ["string", "null"]}, "pdf": {"type": ["string", "null"]}}}}}, "Erro": {"type": "object", "properties": {"erro": {"type": "object", "properties": {"codigo": {"type": "string", "example": "validacao"}, "mensagem": {"type": "string"}, "detalhes": {"type": "array", "items": {"type": "object", "properties": {"campo": {"type": "string", "example": "itens.0.ncm"}, "mensagem": {"type": "string"}}}}}}}}, "Emitente": {"type": "object", "description": "Emitente com campos de entrada + id, certificado e ativo."}, "Webhook": {"type": "object", "properties": {"id": {"type": "string"}, "url": {"type": "string"}, "eventos": {"type": "array", "items": {"type": "string"}}, "segredo": {"type": "string", "description": "Somente na criação."}}}}}, "paths": {"/api/v1/conta": {"get": {"tags": ["Conta"], "summary": "Plano e uso do mês", "responses": {"200": {"description": "Resumo da conta", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/emitentes": {"get": {"tags": ["Emitentes"], "summary": "Listar emitentes", "responses": {"200": {"description": "Lista", "content": {"application/json": {"schema": {"type": "object", "properties": {"dados": {"type": "array", "items": {"$ref": "#/components/schemas/Emitente"}}, "paginacao": {"type": "object", "properties": {"pagina": {"type": "integer"}, "porPagina": {"type": "integer"}, "total": {"type": "integer"}, "temProxima": {"type": "boolean"}}}}}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "post": {"tags": ["Emitentes"], "summary": "Cadastrar emitente", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmitenteEntrada"}, "example": {"cnpj": "11222333000181", "razaoSocial": "Minha Empresa LTDA", "nomeFantasia": "Minha Empresa", "inscricaoEstadual": "123456789", "inscricaoMunicipal": "12345", "regimeTributario": 1, "ambiente": "homologacao", "endereco": {"logradouro": "Rua das Flores", "numero": "100", "complemento": "Sala 2", "bairro": "Centro", "codigoMunicipio": "3550308", "municipio": "São Paulo", "uf": "SP", "cep": "01001000"}, "email": "fiscal@minhaempresa.com.br", "telefone": "11999999999", "nfe": {"serie": "1", "proximoNumero": 1}, "nfse": {"serie": "1", "proximoNumero": 1}}}}}, "responses": {"201": {"description": "Criado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Emitente"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/emitentes/{ref}": {"get": {"tags": ["Emitentes"], "summary": "Consultar emitente", "parameters": [{"name": "ref", "in": "path", "required": true, "description": "ID (UUID) ou CNPJ", "schema": {"type": "string"}}], "responses": {"200": {"description": "Emitente", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Emitente"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "patch": {"tags": ["Emitentes"], "summary": "Atualizar emitente", "parameters": [{"name": "ref", "in": "path", "required": true, "description": "ID (UUID) ou CNPJ", "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EmitenteAtualizacao"}, "example": {"ambiente": "producao"}}}}, "responses": {"200": {"description": "Atualizado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Emitente"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "delete": {"tags": ["Emitentes"], "summary": "Remover emitente", "parameters": [{"name": "ref", "in": "path", "required": true, "description": "ID (UUID) ou CNPJ", "schema": {"type": "string"}}], "responses": {"204": {"description": "Removido (ou desativado se já tiver notas)"}}}}, "/api/v1/emitentes/{ref}/certificado": {"put": {"tags": ["Emitentes"], "summary": "Enviar certificado A1", "parameters": [{"name": "ref", "in": "path", "required": true, "description": "ID (UUID) ou CNPJ", "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CertificadoEntrada"}, "example": {"arquivoBase64": "MIIK...", "senha": "1234"}}}}, "responses": {"200": {"description": "Certificado salvo", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Emitente"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/nfe": {"post": {"tags": ["NF-e"], "summary": "Emitir NF-e", "description": "Assíncrono: responde 202 com status \"processando\". Acompanhe por GET ou webhook.", "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 100}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/NfeEntrada"}, "examples": {"completo": {"summary": "Dados fiscais completos", "value": {"emitente": "11222333000181", "referencia": "pedido-1042", "naturezaOperacao": "Venda de mercadoria", "destinatario": {"cpfCnpj": "11144477735", "nome": "Cliente Exemplo", "email": "cliente@email.com", "indicadorIe": 9, "endereco": {"logradouro": "Av. Brasil", "numero": "500", "bairro": "Jardins", "codigoMunicipio": "3550308", "municipio": "São Paulo", "uf": "SP", "cep": "01430000"}}, "itens": [{"codigo": "SKU-001", "descricao": "Camiseta básica", "ncm": "61091000", "cfop": "5102", "unidade": "UN", "quantidade": 2, "valorUnitario": 59.9, "impostos": {"icms": {"origem": 0, "csosn": "102"}, "pis": {"cst": "07"}, "cofins": {"cst": "07"}}}], "pagamentos": [{"forma": "17", "valor": 119.8}]}}, "catalogo": {"summary": "Usando o catálogo fiscal", "value": {"emitente": "11222333000181", "referencia": "pedido-1043", "destinatario": {"cpfCnpj": "11144477735", "nome": "Cliente Exemplo", "email": "cliente@email.com", "indicadorIe": 9, "endereco": {"logradouro": "Av. Brasil", "numero": "500", "bairro": "Jardins", "codigoMunicipio": "3550308", "municipio": "São Paulo", "uf": "SP", "cep": "01430000"}}, "itens": [{"produto": "SKU-001", "quantidade": 2}], "pagamentos": [{"forma": "17", "valor": 119.8}]}}}}}}, "responses": {"202": {"description": "Documento criado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "200": {"description": "Replay idempotente", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "402": {"description": "Assinatura inativa ou limite do plano", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "get": {"tags": ["NF-e"], "summary": "Listar NF-e", "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "referencia", "in": "query", "schema": {"type": "string"}}, {"name": "emitente", "in": "query", "schema": {"type": "string"}}, {"name": "criadoDe", "in": "query", "schema": {"type": "string"}}, {"name": "criadoAte", "in": "query", "schema": {"type": "string"}}, {"name": "pagina", "in": "query", "schema": {"type": "string"}}, {"name": "porPagina", "in": "query", "schema": {"type": "string"}}], "responses": {"200": {"description": "Lista paginada", "content": {"application/json": {"schema": {"type": "object", "properties": {"dados": {"type": "array", "items": {"$ref": "#/components/schemas/Documento"}}, "paginacao": {"type": "object", "properties": {"pagina": {"type": "integer"}, "porPagina": {"type": "integer"}, "total": {"type": "integer"}, "temProxima": {"type": "boolean"}}}}}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/nfe/{id}": {"get": {"tags": ["NF-e"], "summary": "Consultar NF-e", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "responses": {"200": {"description": "Documento", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/nfe/{id}/xml": {"get": {"tags": ["NF-e"], "summary": "XML autorizado", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "tipo", "in": "query", "schema": {"type": "string", "enum": ["cancelamento"]}}], "responses": {"200": {"description": "XML", "content": {"application/xml": {}}}}}}, "/api/v1/nfe/{id}/pdf": {"get": {"tags": ["NF-e"], "summary": "PDF (DANFE/DANFSe)", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "responses": {"200": {"description": "PDF", "content": {"application/pdf": {}}}}}}, "/api/v1/nfe/{id}/cancelamento": {"post": {"tags": ["NF-e"], "summary": "Cancelar NF-e", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CancelamentoEntrada"}, "example": {"justificativa": "Pedido cancelado pelo cliente final"}}}}, "responses": {"202": {"description": "Cancelamento solicitado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/nfse": {"post": {"tags": ["NFS-e"], "summary": "Emitir NFS-e", "description": "Assíncrono: responde 202 com status \"processando\". Acompanhe por GET ou webhook.", "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 100}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/NfseEntrada"}, "examples": {"completo": {"summary": "Dados fiscais completos", "value": {"emitente": "11222333000181", "referencia": "assinatura-778", "tomador": {"cpfCnpj": "11144477735", "nome": "Fulano de Tal", "email": "fulano@email.com", "endereco": {"logradouro": "Rua A", "numero": "10", "bairro": "Centro", "codigoMunicipio": "3550308", "uf": "SP", "cep": "01001000"}}, "servico": {"descricao": "Assinatura mensal de software (SaaS)", "codigoTributacaoNacional": "010501", "codigoNbs": "115013000"}, "valores": {"servico": 99.9, "aliquotaIss": 2.0, "issRetido": false}}}, "catalogo": {"summary": "Usando o catálogo fiscal", "value": {"emitente": "11222333000181", "referencia": "assinatura-779", "tomador": {"cpfCnpj": "11144477735", "nome": "Fulano de Tal", "email": "fulano@email.com", "endereco": {"logradouro": "Rua A", "numero": "10", "bairro": "Centro", "codigoMunicipio": "3550308", "uf": "SP", "cep": "01001000"}}, "servico": {"codigo": "PLANO-PRO"}}}}}}}, "responses": {"202": {"description": "Documento criado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "200": {"description": "Replay idempotente", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "402": {"description": "Assinatura inativa ou limite do plano", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "get": {"tags": ["NFS-e"], "summary": "Listar NFS-e", "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "referencia", "in": "query", "schema": {"type": "string"}}, {"name": "emitente", "in": "query", "schema": {"type": "string"}}, {"name": "criadoDe", "in": "query", "schema": {"type": "string"}}, {"name": "criadoAte", "in": "query", "schema": {"type": "string"}}, {"name": "pagina", "in": "query", "schema": {"type": "string"}}, {"name": "porPagina", "in": "query", "schema": {"type": "string"}}], "responses": {"200": {"description": "Lista paginada", "content": {"application/json": {"schema": {"type": "object", "properties": {"dados": {"type": "array", "items": {"$ref": "#/components/schemas/Documento"}}, "paginacao": {"type": "object", "properties": {"pagina": {"type": "integer"}, "porPagina": {"type": "integer"}, "total": {"type": "integer"}, "temProxima": {"type": "boolean"}}}}}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/nfse/{id}": {"get": {"tags": ["NFS-e"], "summary": "Consultar NFS-e", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "responses": {"200": {"description": "Documento", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/nfse/{id}/xml": {"get": {"tags": ["NFS-e"], "summary": "XML autorizado", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "tipo", "in": "query", "schema": {"type": "string", "enum": ["cancelamento"]}}], "responses": {"200": {"description": "XML", "content": {"application/xml": {}}}}}}, "/api/v1/nfse/{id}/pdf": {"get": {"tags": ["NFS-e"], "summary": "PDF (DANFE/DANFSe)", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "responses": {"200": {"description": "PDF", "content": {"application/pdf": {}}}}}}, "/api/v1/nfse/{id}/cancelamento": {"post": {"tags": ["NFS-e"], "summary": "Cancelar NFS-e", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CancelamentoEntrada"}, "example": {"justificativa": "Pedido cancelado pelo cliente final"}}}}, "responses": {"202": {"description": "Cancelamento solicitado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Documento"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/produtos": {"get": {"tags": ["Catálogo"], "summary": "Listar produtos", "parameters": [{"name": "busca", "in": "query", "schema": {"type": "string"}}, {"name": "pagina", "in": "query", "schema": {"type": "string"}}, {"name": "porPagina", "in": "query", "schema": {"type": "string"}}], "responses": {"200": {"description": "Lista", "content": {"application/json": {"schema": {"type": "object", "properties": {"dados": {"type": "array", "items": {"$ref": "#/components/schemas/ProdutoEntrada"}}, "paginacao": {"type": "object", "properties": {"pagina": {"type": "integer"}, "porPagina": {"type": "integer"}, "total": {"type": "integer"}, "temProxima": {"type": "boolean"}}}}}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "post": {"tags": ["Catálogo"], "summary": "Cadastrar produto", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProdutoEntrada"}, "example": {"codigo": "SKU-001", "descricao": "Camiseta básica", "ncm": "61091000", "cfop": "5102", "unidade": "UN", "valorUnitario": 59.9, "impostos": {"icms": {"origem": 0, "csosn": "102"}, "pis": {"cst": "07"}, "cofins": {"cst": "07"}}}}}}, "responses": {"201": {"description": "Criado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProdutoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "409": {"description": "Código já existe", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/produtos/{codigo}": {"get": {"tags": ["Catálogo"], "summary": "Consultar produto", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Produto", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProdutoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "put": {"tags": ["Catálogo"], "summary": "Criar ou substituir produto (upsert)", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProdutoEntrada"}, "example": {"codigo": "SKU-001", "descricao": "Camiseta básica", "ncm": "61091000", "cfop": "5102", "unidade": "UN", "valorUnitario": 59.9, "impostos": {"icms": {"origem": 0, "csosn": "102"}, "pis": {"cst": "07"}, "cofins": {"cst": "07"}}}}}}, "responses": {"200": {"description": "Salvo (201 se criado)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProdutoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "patch": {"tags": ["Catálogo"], "summary": "Atualizar produto", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Atualizado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProdutoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "delete": {"tags": ["Catálogo"], "summary": "Remover produto", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"204": {"description": "Removido"}}}}, "/api/v1/servicos": {"get": {"tags": ["Catálogo"], "summary": "Listar serviços", "parameters": [{"name": "busca", "in": "query", "schema": {"type": "string"}}, {"name": "pagina", "in": "query", "schema": {"type": "string"}}, {"name": "porPagina", "in": "query", "schema": {"type": "string"}}], "responses": {"200": {"description": "Lista", "content": {"application/json": {"schema": {"type": "object", "properties": {"dados": {"type": "array", "items": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}}, "paginacao": {"type": "object", "properties": {"pagina": {"type": "integer"}, "porPagina": {"type": "integer"}, "total": {"type": "integer"}, "temProxima": {"type": "boolean"}}}}}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "post": {"tags": ["Catálogo"], "summary": "Cadastrar serviço", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}, "example": {"codigo": "PLANO-PRO", "descricao": "Assinatura mensal do plano Pro (software como serviço)", "codigoTributacaoNacional": "010501", "codigoNbs": "115013000", "aliquotaIss": 2.0, "valor": 99.9}}}}, "responses": {"201": {"description": "Criado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "409": {"description": "Código já existe", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/servicos/{codigo}": {"get": {"tags": ["Catálogo"], "summary": "Consultar serviço", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Serviço", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "put": {"tags": ["Catálogo"], "summary": "Criar ou substituir serviço (upsert)", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}, "example": {"codigo": "PLANO-PRO", "descricao": "Assinatura mensal do plano Pro (software como serviço)", "codigoTributacaoNacional": "010501", "codigoNbs": "115013000", "aliquotaIss": 2.0, "valor": 99.9}}}}, "responses": {"200": {"description": "Salvo (201 se criado)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "patch": {"tags": ["Catálogo"], "summary": "Atualizar serviço", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Atualizado", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServicoCatalogoEntrada"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "delete": {"tags": ["Catálogo"], "summary": "Remover serviço", "parameters": [{"name": "codigo", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"204": {"description": "Removido"}}}}, "/api/v1/webhooks": {"get": {"tags": ["Webhooks"], "summary": "Listar webhooks", "responses": {"200": {"description": "Lista", "content": {"application/json": {"schema": {"type": "object", "properties": {"dados": {"type": "array", "items": {"$ref": "#/components/schemas/Webhook"}}, "paginacao": {"type": "object", "properties": {"pagina": {"type": "integer"}, "porPagina": {"type": "integer"}, "total": {"type": "integer"}, "temProxima": {"type": "boolean"}}}}}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}, "post": {"tags": ["Webhooks"], "summary": "Criar webhook", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEntrada"}, "example": {"url": "https://meusaas.com/webhooks/nf", "eventos": ["nfe.autorizada", "nfe.rejeitada"]}}}}, "responses": {"201": {"description": "Criado (inclui segredo)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Webhook"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}, "/api/v1/webhooks/{id}": {"delete": {"tags": ["Webhooks"], "summary": "Remover webhook", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"204": {"description": "Removido"}}}}, "/api/v1/webhooks/{id}/teste": {"post": {"tags": ["Webhooks"], "summary": "Enviar evento de teste (ping)", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Resultado da entrega", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Chave ausente ou inválida", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "422": {"description": "Dados inválidos", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}, "429": {"description": "Limite de requisições", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Erro"}}}}}}}}}