TF Fiscal
Documentation

NFC-e

Issue NFC-e consumer receipts (model 65) on behalf of merchants: integration flow, choosing between NFC-e and NF-e, company setup, state differences and receipt printing.

Overview and integration flow

NFC-e (model 65, Nota Fiscal de Consumidor Eletrônica) is Brazil's electronic consumer invoice, used for in-state retail sales to the final consumer: in-store sales, food delivery and same-city delivery, and sales outside the shop. It shares the NF-e layout, but the authorization endpoints, QR code, cancellation deadline and validation rules differ. Company registration, certificate upload and webhook registration are shared with NF-e.

StepEndpointNotes
1 Register companyPOST /openapi/v2/empresasSame as NF-e, plus the optional emissaoNFeConsumidor block that enables NFC-e; resend with id to update
2 Upload certificatePOST /openapi/v1/empresas/{empresaId}/certificadoDigitalSame as NF-e, same A1 certificate
3 Register webhookPOST /openapi/v1/webhooksRegister the webhook again with the nfce.* events in eventos; NFC-e is not in the default subscription, and results go to the same callback URL
4 IssuePOST /openapi/v2/empresas/{empresaId}/nfceAsynchronous by default; a till can use sync mode to get the result on the spot
5 QueryGET /openapi/v2/empresas/{empresaId}/nfce/{nfceId}Status, QR code, receipt and XML download links
6 CancelPOST .../nfce/{nfceId}/cancelarWithin 30 minutes after authorization
7 Cancel by substitutionPOST .../nfce/{nfceId}/cancelar-substituicaoCancels the normal invoice duplicated by an offline contingency invoice, within 168 hours

Authentication is identical to NF-e; see Authentication.

Prerequisites

  • The company is approved with a usable certificate; otherwise 10022002.
  • The company enabled NFC-e for the current environment through the emissaoNFeConsumidor block; otherwise 10022001.
  • The company has a state registration (IE) and NFC-e is enabled in its state. Most states enable it automatically for companies with an IE; SP enables it per establishment, PR requires a request to the state tax office before production, and TO, RN and GO require NF-e issuance to be enabled first.
  • ambienteEmissao in the request must match the company current environment; otherwise 10022003.

NFC-e or NF-e

ScenarioIssue
In-store sale to an individualNFC-e
Food delivery, same-city or in-state delivery to an individualNFC-e (consumer identified with address), or NF-e
Online order shipped to another stateNF-e only
Buyer is an ICMS taxpayerNF-e only
Invoice above R$ 200,000NF-e only
Return, complementary, adjustment or referenced invoiceNF-e only

The platform does not switch a non-compliant request to NF-e on its own; it returns 10022004 with the reason.

Company registration: the emissaoNFeConsumidor block

The Register company body gains an optional block; all other fields are unchanged:

json
"emissaoNFeConsumidor": {
"ambienteProducao": {
"sequencialNFe": 1,
"serieNFe": "1",
"csc": { "id": "000001", "codigo": "A1B2C3D4E5F6A7B8C9D0E1F2A3B4C5D6" }
}
}
FieldTypeRequiredDescription
ambienteProducaoobjectYesSeries and CSC. The series applies to both homologation and production; the CSC to production only
sequencialNFeintegerYesNext invoice number. The platform numbers sequentially from it; the counter only goes up, and a lower value on update keeps the current number
serieNFestringYesNFC-e series. 1 to 3 digits, distinct from the NF-e series, and 890 to 899 are reserved by the tax authority; one series per till or sales channel is recommended
cscobjectNoSecurity code (CSC). Only QR code v2 needs it, and it only takes effect in production; the platform uses v3 by default and switches a company to v2 itself, which the open API cannot do; if you get 10022009, contact the platform
csc.idstringYesCSC id. 1 to 6 digits, obtained together with the code on the state tax portal
csc.codigostringYesCSC value. 16 to 36 letters and digits; stored encrypted and never echoed
  • Sending the block enables NFC-e and the registration response carries nfceHabilitado=true. Homologation needs no separate setup: the same series serves both environments.
  • Update: resend with the company id to overwrite the block. When you only rotate the CSC, send sequencialNFe and serieNFe as they are; the counter is never lowered.
  • The CSC is issued by the state tax portal. After revoking an old code on the portal, update it here, or SEFAZ rejects issuance (462 / 463).

Endpoints

EndpointUse
Issue NFC-eAsync acceptance returns HTTP 200 with no body; sync mode returns the result or 202; idempotent by id
Query NFC-eStatus, QR code, receipt and XML links, request echo
Cancel NFC-eWithin 30 minutes after authorization, asynchronous
Cancel by substitutionCancels the normal invoice duplicated by an offline one, within 168 hours, asynchronous

Statuses and webhooks

StatusMeaningWebhook event
AguardandoAutorizacaoAccepted, waiting for SEFAZNone
AutorizadaAuthorizednfce.authorized
NegadaRejected by SEFAZ, or failed during platform processingnfce.rejected
CanceladaCancellednfce.canceled
ContingenciaPendenteIssued offline while SEFAZ was down, waiting to be transmittednfce.contingency_issued

When SEFAZ rejects a cancellation the invoice stays Autorizada and nfce.cancel_rejected is sent. Once an offline invoice is authorized, nfce.authorized is sent again; if its transmission is rejected, nfce.rejected is sent. The payload is the NF-e one with tipo set to NFC-e plus the QR code content in nfeQrCode; see Webhooks. These events must be subscribed explicitly in eventos when registering the webhook.

Offline contingency

When SEFAZ is down and the state allows it, the platform issues the NFC-e offline (digit 35 of the access key is 9) with status ContingenciaPendente; the receipt can be printed and handed over right away. The platform transmits it once SEFAZ is back; if the same sale also has an authorized normal invoice, the platform cancels the normal one by substitution on its own. For special cases call Cancel by substitution.

State differences

Known differences, which may change with state law. The identification threshold, the SC ban on delivery and the GO and SC ban on CNPJ-identified buyers are checked by the platform at acceptance against the issuer state and return 10022004; everything else is checked by SEFAZ at authorization and ends as Negada, so follow it before submitting:

StateIdentification thresholdDelivery salesOther
SPR$ 10,000Allowed, within SP
MGR$ 10,000Retail establishments onlyOne CSC for homologation and production
RJR$ 2,000Allowed, carrier requiredPaid late cancellation at the state tax office
PRR$ 10,000; delivery always identifiedAllowed, in-state
RSR$ 10,000; wholesale-and-retail must identifyAllowed
SCR$ 10,000; buyers cannot be identified by CNPJNot allowed
ESR$ 10,000Only restaurants, pharmacies and floristsCSC id fixed at 000001
GOR$ 10,000, CPF onlyAllowedBuyers identified by CNPJ need an NF-e
MTR$ 1,000Same city onlyPaid late cancellation at the state tax office
TOR$ 3,000, name and address requiredIn-state only
PER$ 5,000Allowed
BA, AL, PBR$ 500AllowedAL delivery requires a printed receipt
Other statesR$ 10,000Allowed, in-state

Receipt printing

  • The receipt link in the query and in webhooks is an 80 mm thermal PDF that can go straight to the printer.
  • If you lay out the receipt yourself, include every official item, encode qrCode as a QR code, and print urlConsulta and the access key.
  • With the consumer agreement you may skip printing and send the access key or an electronic receipt instead; RJ, ES and AL delivery require printing.
  • Homologation receipts carry "EMITIDA EM AMBIENTE DE HOMOLOGAÇÃO – SEM VALOR FISCAL", and in homologation the platform replaces the first item description with the official text; no action is needed on your side.

Test checklist

  1. Register the company with emissaoNFeConsumidor; the response has nfceHabilitado=true.
  2. Upload the certificate and register the webhook again with the nfce.* events in eventos.
  3. Issue the example from the issue page in sync mode; you get Autorizada with qrCode and linkDanfe, and download the receipt PDF.
  4. Send the same id again; the same invoice comes back with the same number.
  5. Issue the delivery example asynchronously; a webhook with tipo=NFC-e and nfeStatus=Autorizada arrives.
  6. Cancel the step 3 invoice within 30 minutes; the query shows Cancelada and the cancellation webhook arrives.
  7. Negative cases: presencaConsumidor=OperacaoPelaInternet, delivery without cliente and CFOP 6102 all return 10022004; cancelling more than 30 minutes after authorization returns 10022007.