TF Fiscal

Other fiscal documents

NFCom Telecom

5 endpoints

The NFCom API (model 62, layout 1.00) lets you issue, consult, cancel and get the PDF (DANFE-COM) of Electronic Communication Service Invoices. The NFCom replaces the old models 21/22 and documents the billing of telecommunication services — telephony, internet, pay TV, data. Authorization takes place in the single national environment (SVRS). The issuer data is filled in automatically from the company registration (CNPJ, IE, corporate name and address); the technical access-key fields (cNF, cDV, cUF, dhEmi, mod) are calculated by the server. The consultation QR code (qrCodNFCom) is also generated automatically.

EndpointMethodDescription
/api/nfcom/createPOSTIssue NFCom
/api/nfcom/consultPOSTConsult NFCom status
/api/nfcom/cancelPOSTCancel an authorized NFCom
/api/nfcom/pdfPOSTGet the DANFE-COM (PDF) of the NFCom
/api/nfcom/get_listGETList NFCom (paginated)
Mandatory accreditation: issuing NFCom requires the issuing CNPJ to be accredited for model 62 with the tax authority of its state (enablement restricted to telecommunication service providers). Without the accreditation, tax authority rejects the issuance with cStat=203 ("Emissor não habilitado para emissão da NFCom"). Accreditation in staging and in production are separate steps.
POST/api/nfcom/create

Issue NFCom

Issues an NFCom from the submitted body. The client sends only the business data — the issuer block (emit) is built automatically from the registration of the token's company, and the technical access-key fields are calculated by the server. Credit is debited only in production (tpAmb=1) and when the NFCom is authorized. After authorization, the XML (nfcomProc) and the DANFE-COM (PDF) are generated and made available by URL.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds (5-minute window)

Body — root

FieldTypeDescription
ideobjectNFCom identification (environment, series, taxable event period)
dest *objectRecipient / service taker data
assinante *objectService subscriber data (required in the NFCom layout)
det *arrayBilled items — at least 1
totalobjectTotals. Optional — calculated from the items when omitted
gFatobjectInvoice data (billing period, due date, barcode)
infAdFiscostringInformation of interest to the tax authority
infCplarrayComplementary information (list of texts)
autXMLarrayCNPJs/CPFs authorized to access the XML (list of strings)
Required fields in the request: dest with xNome, one of CNPJ/CPF/idOutros and enderDest (xLgr, nro, xBairro, cMun, xMun, CEP with 8 digits, UF); assinante.iCodAssinante; and at least 1 item in det with xProd, cClass (7 digits from the NFCom item classification table), vItem and vProd. All other fields are optional.

ide — Identification

FieldTypeDescription
tpAmbintEnvironment: 1=production, 2=staging. Default: 2
nNFlongSequential NFCom number. Optional — auto-incremented by the server when omitted or 0
dhEmistringIssuance date/time. Optional — generated by the server when omitted
cMunFGlongIBGE code of the taxable event municipality (7 digits). Optional — default: the municipality from the company registration
finNFComintPurpose: 0=Normal, 3=Replacement, 4=Adjustment. Default: 0
tpFatintBilling type: 0=Normal, 1=Centralized, 2=Co-billing. Default: 0
nSiteAutorizintAuthorizing site (1 digit of the access key). Default: 0
indPrePagostringPrepaid service indicator: "1" when applicable

Filled in automatically by the server — you do not need to send them: mod (fixed at 62), serie (the NFCom series registered for the company; set it in /api/company/edit via serie_nfcom), cUF (derived from the company registration), cNF (7-digit numeric code), cDV (access key check digit), tpEmis (normal) and verProc. The complete emit block and the infNFComSupl (QR code) are also built by the server.

dest — Recipient / Service taker

FieldTypeDescription
xNome *stringRecipient name or corporate name
CNPJ ⚠stringRecipient CNPJ (14 digits)
CPF ⚠stringRecipient CPF (11 digits)
idOutros ⚠stringOther identification document (foreigner etc.)
indIEDestintIE indicator: 1=taxpayer, 2=exempt, 9=non-taxpayer. Default: 9
IEstringRecipient state registration (when a taxpayer)
enderDest *objectRecipient address (see structure below)

enderDest — Address

FieldTypeDescription
xLgr *stringStreet
nro *stringNumber
xCplstringComplement
xBairro *stringNeighborhood
cMun *longIBGE municipality code (7 digits)
xMun *stringMunicipality name
CEP *stringPostal code (8 digits)
UF *stringState abbreviation (2 letters)
fonestringPhone
emailstringE-mail

assinante — Service subscriber

FieldTypeDescription
iCodAssinante *stringUnique subscriber identification code (1–30 characters)
tpAssinanteintSubscriber type: 1=Commercial, 2=Industrial, 3=Residential, 4=Rural producer, 5=Public agency, 6=Telecom service provider, 7=Diplomatic missions, 8=Churches and temples, 99=Others. Default: 1
tpServUtilintType of service used: 1=Telephony, 2=Data communication, 3=Pay TV, 4=Internet access, 5=Multimedia, 6=Others, 7=Several. Default: 1
nContratostringSubscriber contract number

det[] — Billed items

FieldTypeDescription
cProdstringItem code. Optional — default: sequential number
xProd *stringDescription of the billed service/item
cClass *stringItem classification code (7 digits — NFCom item classification table)
CFOPstringCFOP of the service (required when the item has ICMS)
uMedstringUnit of measure: 1=Minute, 2=MB, 3=GB, 4=UN. Default: 4
qFaturadastringBilled quantity. Default: "1"
vItem *stringUnit value of the item
vProd *stringTotal value of the item
vDescstringDiscount value
infAdProdstringAdditional item information
icmsobjectICMS taxation of the item (see below)
pisobjectItem PIS (see below)
cofinsobjectItem COFINS (same structure as PIS)
ibscbsobjectIBS/CBS — Tax Reform (see below)

det[].icms — Item ICMS

FieldTypeDescription
cststringICMS CST. Default: "00" (full taxation)
vBCstringICMS calculation base
pICMSstringICMS rate (%)
vICMSstringICMS value
simplesNacionalbooltrue = Simples Nacional issuer (ICMSSN group)
semCSTbooltrue = item not related to ICMS (indSemCST; do not send CFOP in this case)

det[].pis / det[].cofins

FieldTypeDescription
cststringPIS/COFINS CST (01, 02, 06, 07, 08, 09, 49). Default: "01"
vBCstringCalculation base
pAliqstringRate (%)
valorstringTax value

det[].ibscbs — IBS/CBS (Tax Reform)

FieldTypeDescription
cststringIBS/CBS CST (3 digits)
cClassTribstringTax classification code
vBCstringCalculation base
pIBSUF / vIBSUFstringRate and value of the state IBS
pIBSMun / vIBSMunstringRate and value of the municipal IBS
vIBSstringTotal IBS value
pCBS / vCBSstringRate and value of the CBS

total — Totals (optional)

FieldTypeDescription
vProdstringSum of the items. Calculated when omitted
vBCstringTotal ICMS calculation base
vICMSstringTotal ICMS value
vDescstringTotal discounts
vNFstringTotal NFCom value. Default: equal to vProd

gFat — Invoice data

FieldTypeDescription
CompetFatstringInvoice billing period in AAAAMM format
dVencFatstringDue date in AAAA-MM-DD format
codBarrasstringInvoice barcode (digits only, 1–48)

* Required field. ⚠ In the recipient, at least one of CNPJ, CPF or idOutros is required. Monetary values and rates are sent as strings with a decimal point (e.g.: "99.90").

POST/api/nfcom/consult

Consult NFCom status

Consults the current status of the NFCom in the national environment (SVRS) from the access key.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chNFCom *stringAccess key of the NFCom (44 digits)

* Required field.

POST/api/nfcom/cancel

Cancel NFCom

Cancels an authorized NFCom (event 110111). Requires that the NFCom has been authorized (has a protocol) and is not yet cancelled.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chNFCom *stringAccess key of the NFCom (44 digits)
xJust *stringCancellation justification (minimum 15 characters as required by the tax authority)
nProt *stringNFCom authorization protocol (16 digits)

* Required field.

POST/api/nfcom/pdf

Get NFCom PDF

Returns the URL of the DANFE-COM — the PDF representation of the NFCom (subscriber bill), per MOC Annex II. The PDF is generated automatically at authorization; when it does not yet exist in storage, it is generated on demand from the XML.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chNFCom *stringAccess key of the NFCom (44 digits)

* Required field.

GET/api/nfcom/get_list

List NFCom (paginated)

Lists the company's NFCom with pagination. Parameters are passed via query string (not in the body).

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
page *intPage number (≥ 1)
page_size *intPage size (1–50)

* Required field.