The Stackin blog
Technical writing on issuing, consulting and cancelling Brazilian fiscal documents, for developers.
IntegrationMCP for invoices: issue Brazilian NF-e and NFS-e from Claude and ChatGPTHow to connect the Stackin MCP server to Claude, ChatGPT, Codex and Cursor, which tools an assistant uses to issue NF-e and NFS-e, and the safeguards that stop an invoice issued by accident.Tax reformReceita Federal's IBS/CBS calculator: how it works and how to use itThe Receita Federal's open source IBS/CBS calculator computes CBS, IBS and IS under the general regime. How it works, where it fits, and what Stackin checks before sending to SEFAZ.Rejections and errorsNF-e rejected by SEFAZ: the rejections the API stops before sendingWhich SEFAZ rejections the Stackin API checks before transmitting an NF-e, the 422 with code and exact field, and how to test without issuing on POST /invoices/validate.Rejections and errorsDuplicate invoices: avoiding them with idempotent issuanceHow to avoid a duplicate invoice when the network fails mid-issuance: Idempotency-Key, consulting the NFS-e by DPS id and when a retry is safe.Tax reformHow to issue an NF-e with IBS and CBS through the API in 2026How to issue an NF-e with IBS and CBS through the Stackin API: the ibs_cbs fields, what the API computes, the CST and cClassTrib checks before SEFAZ and the simulation.Events and received invoicesDownload received NF-e XML via API: DF-e distribution, sync and error 656How to download the XML of received NF-e through the API and automate the flow: list, sync with the SEFAZ, webhooks, the 1-hour wait, lost NSUs and error 656.