/api/nfcom/createIssue 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
tokenstring | string | Token of the issuing company |
signstring | string | MD5 signature: MD5(token + path + body + timestamp) |
timestampstring | string | Unix timestamp in seconds (5-minute window) |
Body — root
ideobject | object | NFCom identification (environment, series, taxable event period) |
tpAmbint | int | Environment: 1=production, 2=staging.Default: 2 |
serieint | int | Series. Optional — when omitted or 0, the NFCom series registered for the company is used (set in /api/company/edit via serie_nfcom) |
nNFlong | long | Sequential NFCom number. Optional — auto-incremented by the server when omitted or 0 |
dhEmistring | string | Issuance date/time. Optional — generated by the server when omitted |
cMunFGlong | long | IBGE code of the taxable event municipality (7 digits). Optional — default: the municipality from the company registration |
finNFComint | int | Purpose: 0=Normal, 3=Replacement, 4=Adjustment.Default: 0. This API does not yet support the gSub group required for replacement |
tpFatint | int | Billing type: 0=Normal, 1=Centralized, 2=Co-billing.Default: 0. This API does not yet support the gCofat group required for co-billing |
nSiteAutorizint | int | Authorizing site (1 digit of the access key). Default: 0 |
indPrePagostring | string | Prepaid service indicator: "1" when applicable |
dest*object | object | Recipient / service taker data |
xNome*string | string | Recipient name or corporate name |
CNPJstring | string | Recipient CNPJ (14 digits) |
CPFstring | string | Recipient CPF (11 digits) |
idOutrosstring | string | Other identification document (foreigner etc.) |
indIEDestint | int | IE indicator: 1=taxpayer, 2=exempt, 9=non-taxpayer.Default: 9 |
IEstring | string | Recipient state registration (when a taxpayer) |
enderDest*object | object | Recipient address (see structure below) |
xLgr*string | string | Street |
nrostring | string | Number.S/N when omitted |
xCplstring | string | Complement |
xBairro*string | string | Neighborhood |
cMun*long | long | IBGE municipality code (7 digits) |
xMun*string | string | Municipality name |
CEP*string | string | Postal code (8 digits) |
UF*string | string | State abbreviation (2 letters) |
fonestring | string | Phone |
emailstring | string | |
assinanteobject | object | Service subscriber data. Optional — the defaults below apply when omitted |
iCodAssinantestring | string | Unique subscriber identification code (1–30 characters). When omitted, the recipient's CNPJ or CPF is used; if both are empty, 1 |
tpAssinanteint | int | Subscriber 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 |
tpServUtilint | int | Type of service used: 1=Telephony, 2=Data communication, 3=Pay TV, 4=Internet access, 5=Multimedia, 6=Others, 7=Several.Default: 1 |
nContratostring | string | Subscriber contract number |
det*array | array | Billed items — at least 1 |
cProdstring | string | Item code. Optional — default: sequential number |
xProd*string | string | Description of the billed service/item |
cClass*string | string | Item classification code (7 digits — NFCom item classification table) |
CFOPstring | string | CFOP of the service (required when the item has ICMS) |
uMedstring | string | Unit of measure: 1=Minute, 2=MB, 3=GB, 4=UN.Default: 4 |
qFaturadastring | string | Billed quantity. Default: "1" |
vItem*string | string | Unit value of the item |
vProd*string | string | Total value of the item |
vDescstring | string | Discount value |
infAdProdstring | string | Additional item information |
icmsobject | object | ICMS taxation of the item (see below) |
cststring | string | ICMS CST; determines the ICMS group generated: "00"=full taxation (ICMS00), "20"=reduced calculation base (ICMS20), "40"=exempt and "41"=not taxed (ICMS40), "51"=deferral (ICMS51), "90"=other (ICMS90).Any other value returns an error. Not used when simplesNacional or semCST is true. Default: "00" |
pRedBCstring | string | Calculation base reduction percentage (%). Required for CST 20 |
vBCstring | string | ICMS calculation base. Required for CST 20; 0.00 when omitted with CST 00 |
pICMSstring | string | ICMS rate (%). Required for CST 20; 0.00 when omitted with CST 00 |
vICMSstring | string | ICMS value. Required for CST 20; 0.00 when omitted with CST 00 |
vICMSDeson/cBenefstring | string | Relieved ICMS value and tax benefit code (CST 20, 40, 41, 51, 90).Both must be sent together or both omitted |
pFCP/vFCPstring | string | Rate and value of the Poverty Combat Fund (FCP) (CST 00, 20, 90).Both must be sent together or both omitted |
simplesNacionalbool | bool | true = Simples Nacional issuer (ICMSSN group) |
semCSTbool | bool | true = item not related to ICMS (indSemCST; do not send CFOP in this case) |
pisobject | object | Item PIS (see below) |
cofinsobject | object | Item COFINS (same structure as PIS) |
ibscbsobject | object | IBS/CBS — Tax Reform (see below) |
cststring | string | IBS/CBS CST (3 digits) |
cClassTribstring | string | Tax classification code |
vBCstring | string | Calculation base |
pIBSUF/vIBSUFstring | string | Rate and value of the state IBS |
pIBSMun/vIBSMunstring | string | Rate and value of the municipal IBS |
vIBSstring | string | Total IBS value |
pCBS/vCBSstring | string | Rate and value of the CBS |
totalobject | object | Totals. Optional — see below for the value used when each field is omitted |
vProdstring | string | Sum of the items. Calculated when omitted |
vBCstring | string | Total ICMS calculation base. When omitted, summed from the vBC of the items' ICMS groups; when sent, the value provided is used |
vICMSstring | string | Total ICMS value. When omitted, summed from the vICMS of the items' ICMS groups; when sent, the value provided is used |
vDescstring | string | Total discounts.0.00 when omitted |
vNFstring | string | Total NFCom value. Default: equal to vProd (vDesc is not deducted) |
gFatobject | object | Invoice data (billing period, due date, barcode) |
CompetFatstring | string | Invoice billing period in AAAAMM format |
dVencFatstring | string | Due date in AAAA-MM-DD format |
codBarrasstring | string | Invoice barcode (digits only, 1–48) |
infAdFiscostring | string | Information of interest to the tax authority |
infCplarray | array | Complementary information (list of texts) |
autXMLarray | array | CNPJs/CPFs authorized to access the XML (list of strings) |
dest with xNome, one of CNPJ/CPF/idOutros and enderDest (xLgr, xBairro, cMun, xMun, CEP with 8 digits, UF); 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.
Filled in automatically by the server — you do not need to send them: mod (fixed at 62), 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; emit.CRT is taken from the tax regime in the company registration (1, 2 or 3; 3 when no tax regime is configured; MEI companies cannot issue NFCom).
det[].pis / det[].cofins
cststring | string | PIS/COFINS CST (01, 02, 06, 07, 08, 09, 49).Default: "01" |
vBCstring | string | Calculation base |
pAliqstring | string | Rate (%) |
valorstring | string | Tax value |
The vPIS and vCOFINS totals are summed from the items' pis.valor and cofins.valor, and vICMSDeson and vFCP are summed from the items' ICMS groups, all calculated by the server; vFUST, vFUNTTEL and the withholding totals are 0.00.
* 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").
Response when the result is not confirmed
When the request was sent to the tax authority but no definitive answer was obtained (for example, a connection timeout or an HTTP error returned by the tax authority), the NFCom may already have been authorized. In this case the response returns success=false together with the chave, serie and number of this attempt; that number is not assigned to any other document. The status must first be confirmed by calling /api/nfcom/consult with the chave, before deciding whether to issue the document again.
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/nfcom/create" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"ide": {
"tpAmb": 2
},
"dest": {
"xNome": "CLIENTE EXEMPLO LTDA",
"CNPJ": "98765432000188",
"indIEDest": 9,
"enderDest": {
"xLgr": "AVENIDA EXEMPLO",
"nro": "500",
"xBairro": "CENTRO",
"cMun": 3550308,
"xMun": "SAO PAULO",
"CEP": "01001000",
"UF": "SP"
}
},
"assinante": {
"iCodAssinante": "CLI-0001",
"tpAssinante": 1,
"tpServUtil": 4,
"nContrato": "CT-2026-0001"
},
"det": [
{
"cProd": "1",
"xProd": "PLANO INTERNET FIBRA 500MB",
"cClass": "0100101",
"CFOP": "5307",
"uMed": "4",
"qFaturada": "1.00",
"vItem": "99.90",
"vProd": "99.90",
"icms": {
"cst": "00",
"vBC": "99.90",
"pICMS": "25.00",
"vICMS": "24.98"
}
}
],
"total": {
"vProd": "99.90",
"vBC": "99.90",
"vICMS": "24.98",
"vNF": "99.90"
},
"gFat": {
"CompetFat": "202607",
"dVencFat": "2026-08-15",
"codBarras": "12345678901234567890"
}
}
{
"success": true,
"message": "NFCom autorizada",
"chave": "35260712345678000199620010000000011012345675",
"serie": 1,
"number": 1,
"cStat": "100",
"xMotivo": "Autorizado o uso da NFCom",
"nProt": "3532600001234567",
"xml": "https://storage.../nfcom/35260712345678000199620010000000011012345675.xml",
"danfcom": "https://storage.../nfcom/35260712345678000199620010000000011012345675.pdf"
}
{
"success": false,
"message": "NFCom rejeitada: Rejeição: Emissor não habilitado para emissão da NFCom",
"chave": "35260712345678000199620010000000011012345675",
"serie": 1,
"number": 1,
"cStat": "203",
"xMotivo": "Rejeição: Emissor não habilitado para emissão da NFCom",
"nProt": "",
"xml": "",
"danfcom": "",
"code": "TAX_AUTHORITY_REJECTED"
}