TF Fiscal

Other fiscal documents

NF3-e Electricity

5 endpoints

The NF3e API (model 66, layout 1.00) lets you issue, consult, cancel and get the PDF (DANF3E) of Electronic Electricity Invoices — the electronic "electricity bill" that replaces the Electricity Invoice/Bill (model 6). 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, serie) are filled in by the server. The consultation QR code (qrCodNF3e) is also generated automatically.

EndpointMethodDescription
/api/nf3e/createPOSTIssue NF3e
/api/nf3e/consultPOSTConsult NF3e status
/api/nf3e/cancelPOSTCancel an authorized NF3e
/api/nf3e/pdfPOSTGet the DANF3E (PDF) of the NF3e
/api/nf3e/get_listGETList NF3e (paginated)
Mandatory accreditation: issuing NF3e requires the issuing CNPJ to be accredited for model 66 with the tax authority of its state (enablement restricted to electricity distributors and traders). Without the accreditation, tax authority rejects the issuance with cStat=203 ("Emissor não habilitado para emissão da NF3e"). In addition, from August 3, 2026 the IBS/CBS groups (Tax Reform) become required in the production environment.

The NF3e requires the gANEEL group (billing history — 13 periods per quantity). When not sent, the server automatically generates the 13 periods from the billed value.

POST/api/nf3e/create

Issue 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

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

Body — root

FieldTypeDescription
ideobjectNF3e identification (environment, taxable event period)
dest *objectRecipient / consumer data
acessante *objectConsumer unit data (required in the NF3e layout)
det *arrayBilled items — at least 1
totalobjectTotals. Optional — calculated from the items when omitted
gFatobjectInvoice data (billing period, due date, next reading, barcode)
gANEELarrayBilling history (13 periods per quantity). Optional — generated automatically when omitted
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); acessante.idAcesso; and at least 1 item in det with xProd, cClass (7 digits from the NF3e item classification table), vItem and vProd. All other fields are optional.

ide — Identification

FieldTypeDescription
tpAmbintEnvironment: 1=production, 2=staging. Default: 2
nNFlongSequential NF3e 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
finNF3eintPurpose: 1=Normal, 2=Replacement, 3=Normal with adjustment. Default: 1
nSiteAutorizintAuthorizing site (1 digit of the access key). Default: 0

Filled in automatically by the server — you do not need to send them: mod (fixed at 66), serie (the NF3e series registered for the company; set it in /api/company/edit via serie_nf3e), 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.

dest — Recipient / Consumer

FieldTypeDescription
xNome *stringConsumer name or corporate name
CNPJ ⚠stringConsumer CNPJ (14 digits)
CPF ⚠stringConsumer CPF (11 digits)
idOutros ⚠stringOther identification document
indIEDestintIE indicator: 1=taxpayer, 2=exempt, 9=non-taxpayer. Default: 9
IEstringConsumer state registration (when a taxpayer)
enderDest *objectConsumer 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

acessante — Consumer unit

FieldTypeDescription
idAcesso *stringConsumer unit / access point identification code (up to 15 characters)
tpAcessointAccess type: 0=Generator, 1=Captive, 2=Free, 3=Partially free, 4=Special consumer, 5=Partially special, 6=Communion, 7=Supply, 8=Distributor. Default: 1
xNomeUCstringConsumer unit name
tpClassestringConsumption class: 01=Commercial, 02=Own consumption, 03=Public lighting, 04=Industrial, 05=Public authority, 06=Residential, 07=Rural, 08=Public service. Default: 06
tpSubClassestringConsumption subclass (01–29, 99)
tpFaseintConnection type: 1=Single-phase, 2=Two-phase, 3=Three-phase. Default: 3
tpGrpTensaostringVoltage group (01–14: A1..B4b). Default: 12
tpModTarstringTariff modality (01–10: Conventional/Time-of-use Blue/Green/White...). Default: 01
latGPSstringLatitude of the capture point. Exactly 6 decimal places (e.g.: "-23.550500"). Default: standard coordinate
longGPSstringLongitude of the capture point. Exactly 6 decimal places (e.g.: "-46.633300"). Default: standard coordinate

det[] — Billed items

FieldTypeDescription
cProdstringItem code. Optional — default: sequential number
xProd *stringDescription of the billed item (e.g.: "Consumo de energia elétrica")
cClass *stringItem classification code (7 digits — NF3e item classification table)
CFOPstringCFOP of the operation (required when the item has ICMS)
uMedstringUnit of measure: 1=kW, 2=kWh, 3=kVAr, 4=kVArh, 5=UN. Default: 2
qFaturadastringBilled quantity. Default: "1"
vItem *stringUnit value (tariff) of the item
vProd *stringTotal value of the item
indOrigemQtdstringQuantity origin: 1=Average, 2=Measured, 3=Contracted, 4=Calculated, 5=Available cost, 6=No quantity. Default: 2
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
isentobooltrue = exempt/non-taxed item (ICMS40 group)
semCSTbooltrue = item not related to ICMS (indSemCST; do not send CFOP in this case)

det[].pis / det[].cofins

FieldTypeDescription
cststringPIS/COFINS CST. 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

gFat — Invoice data

FieldTypeDescription
CompetFatstringInvoice billing period in AAAAMM format
dVencFatstringDue date in AAAA-MM-DD format
dProxLeiturastringExpected date of the next reading (AAAA-MM-DD). Optional — default: +30 days
codBarrasstringBarcode digitable line (digits only, 1–48)
codDebAutostringAutomatic account debit authorization code (alternative to codBanco+codAgencia)
codBanco / codAgenciastringBank and branch for direct debit. One of the two groups (codDebAuto OR codBanco+codAgencia) is required by the schema — default: bank 001, branch 0001

* 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").

POST/api/nf3e/consult

Consult NF3e status

Consults the current status of the NF3e 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
chNF3e *stringAccess key of the NF3e (44 digits)

* Required field.

POST/api/nf3e/cancel

Cancel NF3e

Cancels an authorized NF3e (event 110111). Requires that the NF3e 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
chNF3e *stringAccess key of the NF3e (44 digits)
xJust *stringCancellation justification (minimum 15 characters as required by the tax authority)
nProt *stringNF3e authorization protocol (16 digits)

* Required field.

POST/api/nf3e/pdf

Get NF3e PDF

Returns the URL of the DANF3E — the PDF representation of the NF3e (electricity bill). 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
chNF3e *stringAccess key of the NF3e (44 digits)

* Required field.

GET/api/nf3e/get_list

List NF3e (paginated)

Lists the company's NF3e 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.