stackin
Reference

Fiscal glossary

The vocabulary this documentation uses. Each entry says what the term is, where it shows up in a stackin call, and links to where the docs go deeper.

Documents

NF-e
Electronic invoice, model 55 — the document for moving goods. Requires NCM and CFOP on every item plus the recipient's full address. It is the one that accepts correction letters and numbering invalidation.See in the API
NFS-e
Electronic service invoice. No goods, so no NCM and no CFOP: each item needs only a description and an amount. It does not accept correction letters.See in the API
DPS
Declaração de Prestação de Serviços — what you send to the national NFS-e standard so it can produce the invoice. You don't build the DPS: stackin builds it from your business fields.
DANFE
The printed representation of an NF-e, a PDF that legally has to travel with the goods. The document with fiscal value is the XML; the DANFE represents it.
DANFSe
The DANFE's counterpart for NFS-e, produced by the ADN.
XML
The actual fiscal document. It is the signed XML the SEFAZ authorizes and that holds legally — the PDF represents it, it does not replace it.

Who takes part

SEFAZ
The state tax authority that authorizes or rejects an NF-e. Every state has its own, and its rejection codes are what you see as a 502.See in the API
ADN
Ambiente de Dados Nacional — the federal service that handles national-standard NFS-e in place of the city hall.
Emitente
Whoever issues the invoice: the company that owns the digital certificate. Its tax ID, address, tax regime and certificate live in your stackin account and are resolved from the API key — they never travel in the request body.
Destinatário
Whoever receives it. Travels in the request as client_name, tax_id and, for NF-e, a complete recipient_address.See in the API

Fields and identifiers

Chave de acesso
The 44 digits that identify an NF-e uniquely nationwide. They encode the state, year and month, the issuer's tax ID, the model, the series, the number and a check digit. You consult and cancel by it — but it is not what you reissue by.See in the API
Protocolo
The number the SEFAZ returns on authorization. It is the proof the document was accepted, and what you keep to prove it later.
Série e número
An NF-e's sequential numbering, within a series. The SEFAZ expects that sequence to have no gaps: a number reserved and never used is a hole, and closing it means invalidating the range.See in the API
CFOP
Código Fiscal de Operações e Prestações — four digits saying what kind of operation this is (a sale inside the state, outside it, a return...). Required per item on an NF-e, and it has to agree with the recipient's state.See in the API
NCM
Nomenclatura Comum do Mercosul — eight digits classifying the goods. Required per item on an NF-e.See in the API
CEST
The code used when the goods are subject to tax substitution.
CNPJ e CPF
The recipient's tax identifier: 14 digits for a company, 11 for an individual. Travels as tax_id, digits only.See in the API

Events

Cancelamento
Voids an already-authorized invoice. It has a deadline, requires a reason of at least 15 characters, and returns its own protocol. It does not give the series number back.See in the API
CC-e
Electronic correction letter. It fixes a mistake that changes neither the amount, the tax, the issuer, the recipient nor the date — a product name, transport details, extra information. It does not alter the original invoice: it is attached to it. NF-e only, at most 20 per invoice.See in the API
Inutilização
Tells the SEFAZ that a range of numbers was never used, closing the gap in the sequence. Only for numbers that never reached the SEFAZ — an authorized number is cancelled, not invalidated.See in the API
Reemissão
Resends a failed submission, by the document's local id. It consumes credit like a fresh issuance, because it is one.See in the API
Rejeição
When the SEFAZ refuses the document. It comes with the authority's numeric code — the cStat — and a message. stackin passes both through.See in the API

Environments

Homologação
The SEFAZ's test environment. A document issued here has no fiscal value. An API key is created for one environment and stays there.See in the API
Produção
The real environment. A document issued here counts, consumes credit, and has to be cancelled if it is wrong.See in the API
Contingência
The issuing mode for when the authorizer is down. NF-e only.