/api/nf3e/createIssue NF3e
Issues an NF3e 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 NF3e is authorized. After authorization, the XML (nf3eProc) and the DANF3E (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 | NF3e identification (environment, taxable event period) |
tpAmbint | int | Environment: 1=production, 2=staging.Default: 2 |
serieint | int | Series. Optional — when omitted or 0, the NF3e series registered for the company is used (set in /api/company/edit via serie_nf3e) |
nNFlong | long | Sequential NF3e 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 |
finNF3eint | int | Purpose: 1=Normal, 2=Replacement, 3=Normal with adjustment.Default: 1. This API does not yet support the gSub (replacement) and gAjusteNF3eAnt (adjustment) groups |
nSiteAutorizint | int | Authorizing site (1 digit of the access key). Default: 0 |
dest*object | object | Recipient / consumer data |
xNome*string | string | Consumer name or corporate name |
CNPJstring | string | Consumer CNPJ (14 digits) |
CPFstring | string | Consumer CPF (11 digits) |
idOutrosstring | string | Other identification document |
indIEDestint | int | IE indicator: 1=taxpayer, 2=exempt, 9=non-taxpayer.Default: 9 |
IEstring | string | Consumer state registration (when a taxpayer) |
enderDest*object | object | Consumer 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 | |
acessante*object | object | Consumer unit data.latGPS and longGPS are required; the defaults below apply to the other fields when omitted |
idAcessostring | string | Consumer unit / access point identification code (up to 15 characters). When omitted, the recipient's CNPJ or CPF is used; if both are empty, 000000000000001 |
idCodClientestring | string | Customer identification code |
tpAcessoint | int | Access type: 0=Generator, 1=Captive, 2=Free, 3=Partially free, 4=Special consumer, 5=Partially special, 6=Communion, 7=Supply, 8=Distributor.Default: 1 |
xNomeUCstring | string | Consumer unit name |
tpClassestring | string | Consumption class: 01=Commercial, 02=Own consumption, 03=Public lighting, 04=Industrial, 05=Public authority, 06=Residential, 07=Rural, 08=Public service.Default: 06 |
tpSubClassestring | string | Consumption subclass (01–29, 99) |
tpFaseint | int | Connection type: 1=Single-phase, 2=Two-phase, 3=Three-phase.Default: 3 |
tpGrpTensaostring | string | Voltage group (01–14: A1..B4b).Default: 12 |
tpModTarstring | string | Tariff modality (01–10: Conventional/Time-of-use Blue/Green/White...).Default: 01 |
latGPS*string | string | Latitude of the capture point. Exactly 6 decimal places (e.g.: "-23.550500") |
longGPS*string | string | Longitude of the capture point. Exactly 6 decimal places (e.g.: "-46.633300") |
det*array | array | Billed items — at least 1 |
cProdstring | string | Item code. Optional — default: sequential number |
xProd*string | string | Description of the billed item (e.g.: "Consumo de energia elétrica") |
cClass*string | string | Item classification code (7 digits — NF3e item classification table) |
CFOPstring | string | CFOP of the operation (required when the item has ICMS) |
uMedstring | string | Unit of measure: 1=kW, 2=kWh, 3=kVAr, 4=kVArh, 5=UN.Default: 2 |
qFaturadastring | string | Billed quantity. Default: "1" |
vItem*string | string | Unit value (tariff) of the item |
vProd*string | string | Total value of the item |
indOrigemQtdstring | string | Quantity origin: 1=Average, 2=Measured, 3=Contracted, 4=Calculated, 5=Available cost, 6=No quantity.Default: 2 |
infAdProdstring | string | Additional item information |
icmsobject | object | ICMS taxation of the item (see below) |
cststring | string | ICMS CST. Takes effect only when isento=true: "41"=not taxed; any other value is treated as "40" (exempt). When both isento and semCST are false, the ICMS00 group is always generated with CST 00 and this field is ignored |
vBCstring | string | ICMS calculation base |
pICMSstring | string | ICMS rate (%) |
vICMSstring | string | ICMS value |
isentobool | bool | true = exempt/non-taxed item (ICMS40 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 |
vNFstring | string | Total NF3e value. Default: equal to vProd |
gFat*object | object | Invoice data (billing period, due date, next reading, barcode, debit method) |
CompetFat*string | string | Invoice billing period in AAAAMM format |
dVencFat*string | string | Due date in AAAA-MM-DD format |
dProxLeitura*string | string | Expected date of the next reading (AAAA-MM-DD) |
codBarras*string | string | Barcode digitable line (digits only, 1–48) |
codDebAutostring | string | Automatic account debit authorization code (alternative to codBanco+codAgencia) |
codBanco/codAgenciastring | string | Bank and branch for direct debit. One of the two groups ( codDebAuto OR codBanco+codAgencia) is required; an error is returned when neither is sent |
gANEEL*array | array | Billing history (1 to 5 quantities, exactly 13 periods each) |
xGrandFatstring | string | Name of the billed quantity (e.g.Consumo). Default: Consumo |
competencias*array | array | Data for each reference period (see below). Exactly 13 periods per quantity; an error is returned when the count differs |
CompetFat*string | string | Reference period, format AAAAMM |
vFat*string | string | Billed value for the period |
uMedstring | string | Unit of measure (same values as det[].uMed).Default: 2 |
qtdDiasstring | string | Number of billed days. Default: 30 |
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 NF3e item classification table), vItem and vProd; acessante.latGPS and acessante.longGPS; in gFat, CompetFat, dVencFat, dProxLeitura, codBarras, and either codDebAuto or codBanco+codAgencia; and gANEEL. Only the issuer holds the actual values of these fields, so an error is returned when they are missing; the server no longer fills in default values. All other fields are optional.
Filled in automatically by the server — you do not need to send them: mod (fixed at 66), 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 infNF3eSupl (QR code) are also built by the server.
det[].pis / det[].cofins
cststring | string | PIS/COFINS CST. 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 is summed from the items' ICMS groups, all calculated by the server; the other totals (vPISEfet, vCOFINSEfet, the withholding totals, etc.) are 0.00.
The billing history must be filled in with the actual data of the consumer unit; an error is returned when gANEEL is omitted, and the server no longer generates history data.
* 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.: "75.00").
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 NF3e 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/nf3e/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/nf3e/create" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"ide": {
"tpAmb": 2
},
"dest": {
"xNome": "CONSUMIDOR EXEMPLO",
"CPF": "12345678909",
"indIEDest": 9,
"enderDest": {
"xLgr": "RUA EXEMPLO",
"nro": "100",
"xBairro": "CENTRO",
"cMun": 3550308,
"xMun": "SAO PAULO",
"CEP": "01001000",
"UF": "SP"
}
},
"acessante": {
"idAcesso": "000000000012345",
"tpAcesso": 1,
"xNomeUC": "UNIDADE CONSUMIDORA",
"tpClasse": "06",
"tpFase": 3,
"tpGrpTensao": "12",
"tpModTar": "01",
"latGPS": "-23.550500",
"longGPS": "-46.633300"
},
"det": [
{
"cProd": "1",
"xProd": "CONSUMO DE ENERGIA ELETRICA",
"cClass": "0100101",
"CFOP": "5258",
"uMed": "2",
"qFaturada": "100.00",
"vItem": "0.750000",
"vProd": "75.00",
"indOrigemQtd": "2",
"icms": {
"cst": "00",
"vBC": "75.00",
"pICMS": "25.00",
"vICMS": "18.75"
}
}
],
"total": {
"vProd": "75.00",
"vBC": "75.00",
"vICMS": "18.75",
"vNF": "75.00"
},
"gFat": {
"CompetFat": "202607",
"dVencFat": "2026-08-15",
"dProxLeitura": "2026-08-22",
"codBarras": "12345678901234567890",
"codBanco": "341",
"codAgencia": "1234"
},
"gANEEL": [
{
"xGrandFat": "Consumo",
"competencias": [
{ "CompetFat": "202507", "vFat": "71.20", "uMed": "2", "qtdDias": "30" },
{ "CompetFat": "202508", "vFat": "73.10", "uMed": "2", "qtdDias": "31" },
{ "CompetFat": "202509", "vFat": "70.40", "uMed": "2", "qtdDias": "30" },
{ "CompetFat": "202510", "vFat": "72.80", "uMed": "2", "qtdDias": "31" },
{ "CompetFat": "202511", "vFat": "74.50", "uMed": "2", "qtdDias": "30" },
{ "CompetFat": "202512", "vFat": "78.90", "uMed": "2", "qtdDias": "31" },
{ "CompetFat": "202601", "vFat": "80.30", "uMed": "2", "qtdDias": "31" },
{ "CompetFat": "202602", "vFat": "77.60", "uMed": "2", "qtdDias": "28" },
{ "CompetFat": "202603", "vFat": "76.20", "uMed": "2", "qtdDias": "31" },
{ "CompetFat": "202604", "vFat": "74.00", "uMed": "2", "qtdDias": "30" },
{ "CompetFat": "202605", "vFat": "73.30", "uMed": "2", "qtdDias": "31" },
{ "CompetFat": "202606", "vFat": "72.10", "uMed": "2", "qtdDias": "30" },
{ "CompetFat": "202607", "vFat": "75.00", "uMed": "2", "qtdDias": "31" }
]
}
]
}
{
"success": true,
"message": "NF3e autorizada",
"chave": "35260712345678000199660010000000011012345675",
"serie": 1,
"number": 1,
"cStat": "100",
"xMotivo": "Autorizado o uso da NF3e",
"nProt": "3532600001234567",
"xml": "https://storage.../nf3e/35260712345678000199660010000000011012345675.xml",
"danf3e": "https://storage.../nf3e/35260712345678000199660010000000011012345675.pdf"
}
{
"success": false,
"message": "NF3e rejeitada: Rejeição: Emissor não habilitado para emissão da NF3e",
"chave": "35260712345678000199660010000000011012345675",
"serie": 1,
"number": 1,
"cStat": "203",
"xMotivo": "Rejeição: Emissor não habilitado para emissão da NF3e",
"nProt": "",
"xml": "",
"danf3e": "",
"code": "TAX_AUTHORITY_REJECTED"
}