Sudrel API
Dashboard Create API key

Documentation › Help

Guides

Changelog

Changes to the API and documentation, organized by date.

API v1. Since 02/10/2026 the issuance contract is frozen: only changes that add are made (field, route, event, readiness item, error code). Nothing that exists is renamed, removed or changes HTTP status. A rule that needs to change meaning gets a new id.

10/11/2026

Added (NF-e)

  • Returns built from the source invoice: GET /v1/nfe/{id}/devolucao (remaining quantity per item), POST /v1/nfe/{id}/devolucao/previa and POST /v1/nfe/{id}/devolucao. You specify what was returned; Sudrel builds the inbound NF-e with CFOP, proportional taxes and the source item reference. New errors: nfe_sem_devolucao, item_inexistente, item_repetido, quantidade_acima_do_saldo, devolucao_sem_saldo, cfop_sem_devolucao and devolucao_com_ipi.
  • Returns for NF-e issued by another system: POST /v1/nfe/devolucoes/consulta, POST /v1/nfe/devolucoes/previa and POST /v1/nfe/devolucoes, using the key (with the XML Sudrel captured from SEFAZ) or the submitted XML. New errors: origem_obrigatoria, xml_origem_necessario, xml_origem_invalido, origem_divergente, origem_de_outro_emitente, origem_sem_autorizacao, nfe_emitida_pela_sudrel and item_nao_suportado; new bloqueio field on each remaining quantity item.

18/10/2026

Added (NFC-e, modelo 65)

  • POST /v1/nfce, with the response in the same call and a required Idempotency-Key; preview, query, list, XML, discard, e-mail delivery and voided numbers (inutilizações).
  • Registers (/v1/caixas), each with its own series.
  • QR Code version 3, without CSC; optional CSC at PUT /v1/nfce/csc/{empresa_id}, used only if the state refuses version 3.
  • 80 mm receipt as PDF and as 48-column text (GET /v1/nfce/{id}/danfe).
  • Cancellation in its own queue, with cancelavel_ate on the invoice and the cancelamento_fora_do_prazo error.
  • Readiness items caixa, csc, nfce_uf and nfce_producao.
  • Webhooks NFCE_AUTORIZADA, NFCE_REJEITADA, NFCE_DENEGADA, NFCE_CANCELADA, NFCE_DESCARTADA, NFCE_DESCARTE_PROXIMO and NFCE_ENVIO_PAUSADO.
  • TypeScript and PHP SDKs (nfce, caixas) and four read tools in the MCP server.
  • Guide: NFC-e issuance.

Added (NF-e)

  • chave_referenciada in informado mode, required for returns and complementary invoices (error chave_referenciada_obrigatoria), and item_referenciado on the item.

17/10/2026

Added (NF-e, contingency)

  • Per-company contingency policy (politica_contingencia: esperar, svc, epec) in the tax profile; SVC-AN/SVC-RS and EPEC only for invoices that never went out.
  • Status contingencia_epec, contingencia object on the invoice, falha_envio.motivo uf_indisponivel, and the DANFE for an invoice with a registered EPEC.
  • GET /v1/sefaz/status and the webhooks SEFAZ_STATUS_ALTERADO and NFE_CONTINGENCIA.
  • Simulator: uf_indisponivel, uf_indisponivel_svc_ativo, epec_pendente, epec_rejeitado.

Added (NF-e)

  • falha_envio.motivo envio_pausado and falha_envio.pausado_em, and the NFE_ENVIO_PAUSADO webhook: after repeated certificate refusals, Sudrel stops resending until the certificate passes the test.

16/10/2026

Added (NF-e tax engine, extended Bahia coverage)

  • Wholesaler Termo de Acordo (Decreto 7.799/2000): termo_acordo in the company profile and in the product profile.
  • ICMS-ST: st_substituto in the product profile (ICMS10/ICMS70 with MVA from Anexo 1), CST 10 and 70 in informado mode (st group), ST withheld on purchases via link (/v1/produtos/{codigo}/vinculos-entrada) and st_retido on the item in calcular mode.
  • 7% for ME/EPP with the explicit discount, and the recipient's size from the CNPJ lookup.
  • exclui_icms_base_pis_cofins in the company profile.
  • GTIN checked at SEFAZ (gtin_sefaz, error gtin_ncm_divergente).
  • fcp in ICMS20 in informado mode.

Changed (recorded decision)

  • The sandbox key now registers and approves products and profiles, in a registry of its own (before: 403). The production registry does not change.

Added (NF-e tax engine)

  • Product registry (/v1/produtos) with NCM, CEST and GTIN validated against the official tables, and a tax profile approved by a person.
  • Company tax profile (/v1/nfe/perfil-fiscal/{empresa_id}).
  • calcular and conferir modes in POST /v1/nfe and POST /v1/nfe/previas, with operacao, fora_de_cobertura and each calculated value in ajustes with rule, version and source.
  • ipi group on the item in informado mode.

Added

  • NF-e modelo 55 issuance (/v1/nfe) in informado mode: issuance, preview, query, list, XML, DANFE, correction, discard, cancellation, correction letter, voided numbers and readiness, in SEFAZ homologação (sandbox) and production.
  • Webhooks NFE_AUTORIZADA, NFE_REJEITADA, NFE_DENEGADA, NFE_CANCELADA, NFE_CARTA_CORRECAO_REGISTRADA, NFE_DESCARTADA and NFE_DESCARTE_PROXIMO.
  • NF-e scenarios in the failure simulator.

03/10/2026

Documentation

  • New task-based organization: "What do you want to do?", integration rules, idempotency, errors and HTTP status, NFS-e states, readiness, pagination, recipes, common problems, glossary.
  • Error responses documented route by route, in both formats (problem+json and NestJS), including 401 and 429.
  • Documentation also in Spanish (/docs/es) and English (/docs/en).
  • OpenAPI specification also published as YAML (/docs/openapi.yaml) and an index for AI assistants at /docs/llms.txt.

02/10/2026

Added

  • Batches through the API: POST /v1/lotes (JSON up to 50 thousand items, spreadsheet up to 200 thousand), query, items, report, manual issuance and reprocessing. Webhook LOTE_EMISSAO_CONCLUIDO.
  • Event log GET /v1/eventos, with cursor and 90-day retention.
  • Webhooks through the API (/v1/webhooks): timestamped X-Sudrel-Signature-V2 signature, X-Sudrel-Event-Id and X-Sudrel-Delivery-Id, 72-hour retries, secret rotation with a 24-hour overlap, redelivery, custom headers and test webhooks separate from production ones.
  • Failure simulator (X-Sudrel-Simular) with the test key.
  • API request log in the dashboard (Integrações › Log da API), for 30 days.
  • Company readiness (GET /v1/companies/{id}/prontidao), 412 empresa_nao_pronta and the EMPRESA_PRONTIDAO_ALTERADA webhook.
  • NFSE_FALHA_TRANSMISSAO webhook.
  • Official municipality parameters (GET /v1/municipios/{ibge}/parametros).
  • IBS and CBS in the regular-regime DPS, and GET /v1/servicos/{codigo}/nbs.
  • NFS-e replacement (substituicao block in POST /v1/nfse) and construction work data (servico.obra).

Changed

  • The GET /v1/eventos cursor (proximo_cursor, seq and cursor_mais_antigo) became an opaque string. The old numeric cursor is still accepted in apos.

01/10/2026

Added

  • Test key sdr_test_: issues for real in the Sistema Nacional produção restrita, with no fiscal value and no charge.
  • Status aguardando_confirmacao, POST /v1/nfse/{id}/confirmacao and the NFSE_AGUARDANDO_CONFIRMACAO webhook.
  • processamento_prolongado warning and the NFSE_PROCESSAMENTO_PROLONGADO webhook.

30/09/2026

Added

  • NFS-e issuance through the API: POST /v1/nfse, POST /v1/nfse/validacoes, GET /v1/nfse, GET /v1/nfse/{id}, XML, PDF and cancellation. Errors as problem+json, Idempotency-Key, Prefer: wait=N, ajustes and a timeline in eventos. Webhooks NFSE_AUTORIZADA, NFSE_REJEITADA and NFSE_CANCELADA.