Sign inGet started
Back to blog
Issuing invoices

Issue NF-e

Product invoice issuance — items, tax classification, taxes and IBS/CBS, with real SEFAZ transmission.

NF-e (Nota Fiscal Eletrônica) is the electronic invoice used for the sale of physical goods in Brazil. Each item needs a description, amount, and Brazil-specific tax classification — NCM and CFOP codes at minimum — since NF-e's authorizer (SEFAZ) validates tax classification, not just totals.

NF-e requires the buyer's address: a recipient_address with street, number, neighborhood, city, state, and zip_code (the CEP is only waived for an address abroad), or the client_id of a saved client that has an address. The city_code (IBGE municipality code) is resolved from city and state when omitted. The state decides whether the document goes out as an internal, interstate, or foreign operation (idDest, with state EX), without the integration having to flag that separately — and a CFOP sent with only its last three digits (102) gets its first digit by the same rule.

Every authorized NF-e returns a 44-digit access key you use to consult it, download the DANFE as a PDF, amend it with a correction letter, or cancel it later, and the dashboard keeps the full submission history, including the authorizer's raw rejection reason if it's ever rejected.

Stackin has no tax engine: each item's ICMS, IPI, PIS, and COFINS values go in product.br.tax already computed by your system, and Stackin builds the layout's groups, sums the note's totals from them, and checks before sending the rules that can be checked without SEFAZ. An item with no tax goes out with no ICMS, PIS, or COFINS due (CSOSN 400 for CRT 1 and 4, Simples Nacional and MEI; CST 41 for the others; on an export, CSOSN 300). Optional groups — CEST, NVE codes, presumed credits, the FCI control number — cover the less common cases without becoming required fields for everyone else. See Tax passthrough.

The Tax Reform group goes in product.br.ibs_cbs: you send the cst, the classification (cClassTrib), and the three rates (rate_state, rate_city, and rate_federal), and Stackin computes the item's amounts and the IBSCBSTot total. Before transmitting, it checks in the official cClassTrib table that the classification belongs to the CST sent, is in force on the issue date, and is allowed on an NF-e, fills the rate reduction of CSTs 011, 200, and 515 from the table when you leave it out, and writes the deferral (gDif) of CSTs 510 and 515. The details are in the API reference.

A used-movable-asset flag, purchase order references, freight/insurance/discount/other-expenses amounts, and a manufacturer CNPJ are all supported per item when the sale needs them — none are required for a straightforward retail sale, so the common case stays a handful of fields.

The SDKs mirror this: a Product in Python, Node, Go, or PHP carries the same fields as the API's product and product.br groups, the IBS/CBS group included, so moving from prototyping against the REST API to a typed SDK later doesn't change what data you're already sending.

Rejections come back with the authorizer's own error text, not a generic "invalid request" — whatever SEFAZ's own validation catches, Stackin surfaces directly instead of masking it. What can be known beforehand, such as a CFOP whose first digit doesn't match the operation's destination or a cClassTrib that doesn't belong to the CST sent, Stackin refuses without transmitting, with an error that names the item.

See NF-e issuance for how that API surface fits into the rest of Stackin.