In the US or Canada, a receipt is just a receipt. The register calculates sales tax, prints a slip, and the government sees nothing until the business files its returns. Brazil works differently. Almost every sale of goods needs a nota fiscal: an electronic tax document that the state tax authority must authorize before it is valid, sale by sale, in real time.
If you are a foreign company opening in Brazil, an ERP or POS vendor localizing for it, or a developer integrating with a Brazilian client, this is the part that surprises people most. Here is how it works, the difference between the two documents retail runs on, and what it takes to issue them.
What a nota fiscal is
A nota fiscal eletrônica is an XML file describing a transaction — issuer, buyer, items, tax codes, totals, payments — signed with the issuer's digital certificate and sent to the SEFAZ, the tax authority of the state where the business is registered. Brazil has 27 states and each runs (or delegates) its own authorization service. When the SEFAZ authorizes the document, it returns a protocol number and the note becomes legally valid; if it finds a problem, it rejects it with a code and a reason.
Each note has a 44-digit access key that anyone can use to look it up. That is the core difference from North America: the tax authority has every sale, as it happens.
NFC-e vs NF-e
Goods sales in retail and wholesale run on two models of the same system:
| NFC-e (model 65) | NF-e (model 55) | |
|---|---|---|
| Name | Nota Fiscal de Consumidor Eletrônica | Nota Fiscal Eletrônica |
| Used for | retail sales to the end consumer | sales to companies, transfers between stores, shipments, interstate sales |
| Printed as | an 80 mm receipt with a lookup QR code | a DANFE on A4 paper with a barcode |
| Buyer | optional (the consumer's CPF or CNPJ tax ID, if they ask); required above R$ 10,000 | required, with full address and tax IDs |
| Extra secret | the CSC, a code issued by the state | none |
| US analogy | the register receipt — but authorized by the state | the invoice — but authorized by the state |
Services are a separate world: they use the NFS-e, a city-level document. Intopays issues the national NFS-e — one national system (the Sefin Nacional) for the cities that joined it — through the same route, with type NFSE; see issue an NFS-e.
How authorization works
- Your software builds the note: items with their product code, description, NCM (the Mercosur tariff code), CFOP (the operation code), quantity and price, plus how the customer paid.
- The XML is signed with the company's A1 certificate, a file-based digital certificate tied to its CNPJ.
- The state's SEFAZ checks it and authorizes or rejects it.
- For an NFC-e, the receipt prints with a QR code built with the store's CSC; the customer can scan it to see the note on the state's portal.
The whole round trip usually takes a few seconds, while the customer is still at the counter.
What a company needs
- A Brazilian company (CNPJ) with an active state registration (inscrição estadual, IE) in the store's state, and the city's IBGE code. Some states also require the company to be enabled for NFC-e first.
- An A1 digital certificate (
.pfxor.p12plus its password), issued for the CNPJ by an accredited authority. - The CSC — an ID and a token generated on the state SEFAZ portal — for NFC-e.
- Tax data for every product (NCM and CFOP), and in practice a local accountant (contador), who defines how each item is taxed. Software issues notes; it does not decide taxes.
There is no way around the first point: a foreign company without a Brazilian entity cannot issue notas fiscais.
Test first: homologation
Every SEFAZ has two environments: production (environment: 1), where notes are legally valid, and homologation (environment: 2), a test environment with no fiscal value. The first note of a new company — or of a new state — should always go through homologation to confirm the certificate, the state registration, the CSC and the numbering.
With a fiscal credential set up in Intopays, issuing a test NFC-e is one request:
curl -X POST https://api.intopays.com/v1/fiscal-invoices \
-H "Authorization: Bearer $INTOPAYS_TOKEN" \
-H "X-Credential-Key: $INTOPAYS_FISCAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "NFCE",
"environment": 2,
"referenceCode": "sale-1042",
"items": [
{
"code": "BURGER",
"description": "Burger",
"ncm": "21069090",
"cfop": "5102",
"unit": "UN",
"quantity": 2,
"unitPrice": 25.00,
"totalPrice": 50.00
}
],
"payments": [
{ "method": "CASH", "amount": 60.00, "change": 10.00 }
]
}'
Amounts are in reais; CASH is the payment method (Intopays converts it to the SEFAZ code). The response carries the status (AUTHORIZED or REJECTED), the access key, the number, the series and the SEFAZ's reason — a rejected note also answers 201, so always check status. NFC-e and NF-e go through the same route; the type field (NFCE NFC-e, NFE NF-e, NFSE NFS-e) picks the document. The 80 mm receipt PDF comes from GET /v1/fiscal-invoices/<id>/pdf. Fields and errors are in issue an NFC-e; the credential is described in fiscal credentials, and B2B notes in issue an NF-e.
Pitfalls worth designing for
Numbering. Notes are numbered in a series, and numbers cannot repeat or be skipped without a formal procedure. In Intopays, each fiscal credential keeps the next number per invoice type and environment; it advances when the SEFAZ processes a note (authorized or rejected), and simultaneous requests for the same credential queue one at a time. If the company issued notes in another system before, set the series and next number before the first note.
The SEFAZ does not answer. This is where duplicate notes come from: the request went out, the connection dropped, and nobody knows whether the note was authorized. Intopays records the attempt before sending and, without a definitive answer, asks the SEFAZ about it by access key instead of guessing. If the SEFAZ is still silent, the API returns 503, the attempt stays pending and no new number is used for that credential until the SEFAZ answers. Retrying with the same referenceCode returns the authorized note if there is one, instead of issuing a second.
Retail tax is not added on top. Brazilian shelf prices include taxes; there is no sales tax line added at the register the way there is in the US or with HST/GST in Canada. The note itemizes the taxes inside the price, according to the codes your accountant sets.
In the Intopays POS
In the Intopays POS, each terminal of an organization operating in Brazilian reais can be linked to a fiscal credential. The NFC-e is then issued when the sale is completed and the receipt prints on the terminal's printer. The register never holds the certificate or the fiscal key — it asks the Intopays API, which issues with the organization's credential — and a sale gets at most one authorized note, even if the request is repeated. Without internet, the sale continues with a plain receipt and no note. Organizations in USD or CAD do not see the fiscal features at all.
Frequently asked questions
What is a nota fiscal in English?
"Electronic invoice" is the usual translation, but it is more than an invoice: it is a tax document that the state authorizes before it is valid. The NFC-e is the consumer receipt version; the NF-e is the business-to-business version.
Does every sale in Brazil need a nota fiscal?
Sales of goods by a registered business generally do, and the store has to issue it at the time of sale. Services use a different, city-level document (the NFS-e, which Intopays issues through the national system). The exact obligations depend on the company's tax regime, so confirm with a Brazilian accountant.
Can a foreign company issue NFC-e or NF-e?
Only through a Brazilian entity. Issuing requires a CNPJ, a state registration and an A1 certificate issued for that CNPJ.
What is the CSC?
The Código de Segurança do Contribuinte, an ID and token the state SEFAZ generates for the company. It is used to build the NFC-e's QR code, so a receipt cannot be forged without it. The NF-e does not use it.
Which states are supported?
Intopays issues NFC-e and NF-e in all 27 Brazilian states, each note sent to the authorization service of the credential's state. Test in homologation before the first note in production.
