TF Fiscal

Core APIs

NFC-e Consumer Invoices

15 endpoints

POST/api/nfce/company/create

Register company for NFC-e

Registers (or updates) a company for NFC-e issuance. Company name, IE, address and other data are extracted automatically via SintegraWS from the CNPJ. If the CNPJ already exists for the user, the NFC-e fields are updated and the existing company is returned.

Required headers

HeaderTypeDescription
tokenstringDistributor token (b2b)
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
cnpj *stringIssuing company CNPJ
cert_content *stringContents of the A1 certificate file (.pfx/.p12), Base64-encoded
cert_filestringDeprecated — rejected from 2026-09-01. Certificate HTTPS URL
cert_pwd *stringCertificate password
csc_id *stringCSC (Taxpayer Security Code) ID at the tax authority
csc *stringCSC token (shared secret with the tax authority)
serie_nfceintNFC-e series
number_nfceintInitial NFC-e number
telefonestringCompany phone

* Required field. Other data (name, IE, address, etc.) are extracted automatically via SintegraWS from the CNPJ.

POST/api/nfce/company/update

Update NFC-e company

Updates the NFC-e company identified by the token header. All body fields are optional — send only those you want to change. When cep is updated, the system automatically resolves stateCode and ibge. When cert_content and cert_pwd come together, the certificate is validated before saving.

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body (all fields optional — send ≥ 1)

FieldTypeDescription
Identification
namestringCompany name
aliasstringTrade name
iestringState Registration
invoice_typestringTax regime
emailstringEmail
telefonestringPhone
Address
cepstringZIP code (auto-updates stateCode and ibge)
addressstringStreet address
house_numberstringNumber
complementostringComplement
townstringNeighborhood
citystringCity
statestringUF
NFC-e
csc_idstringCSC ID
cscstringCSC token
serie_nfceintSeries
number_nfceintNext number
cert_contentstringContents of the A1 certificate file (.pfx/.p12), Base64-encoded
cert_filestringDeprecated — rejected from 2026-09-01. Certificate HTTPS URL
cert_pwdstringCertificate password

At least 1 body field is required. CNPJ is immutable.

POST/api/nfce/company/get

Get NFC-e company

Returns the NFC-e company data identified by the token header. Note: method is POST but no body fields are required — the company is resolved only by token.

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

Empty. {} may be sent.

NFC-e Fiscal Category Management

Fiscal categories define the tax rules applied to products when issuing NFC-e. Unlike NFe, NFC-e only operates with intrastate sales, so the structure is simplified: a single object per tax type, without the need for multiple scenarios.

Note: NFC-e categories are stored separately from NFe categories. Each category includes ICMS, PIS, COFINS, and IBS/CBS settings. All endpoints in this section require the token, sign, and timestamp headers.
POST/api/nfce/category/create

Create NFC-e tax category

Creates an NFC-e tax category. Each category has a single scenario (internal outbound) and uses flat objects for ICMS, PIS, COFINS and IBS/CBS (no array, since NFC-e does not allow multiple scenarios per category). No IPI.

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body (root)

FieldTypeDescription
descricao *stringCategory description
codigo_cfop *stringCFOP code (e.g. 5102, 5405)
icms *objectICMS configuration (flat object)
pis *objectPIS configuration (flat object)
cofins *objectCOFINS configuration (flat object)
ibs_cbsobjectIBS/CBS configuration (Tax Reform, optional)
desconta_icms_pis_cofinsbooleanDeduct ICMS before computing PIS/COFINS — tax on (amount − ICMS), the current Brazilian standard; default false (no deduction, higher tax)

icms

FieldTypeDescription
situacao_tributaria *stringCST/CSOSN (e.g. 102, 500)
aliquota_reducaodecimalBase reduction percentage
aliquota_reducao_stdecimalICMS-ST base reduction percentage
aliquota_creditodecimalSimples Nacional credit rate in % (CSOSN 101, 201, 900)
aliquota_diferimentodecimalICMS deferral percentage (CST 51)
motivo_desoneracaostringExemption reason code
ad_rem_icmsdecimalSingle-phase ICMS — ad rem rate in BRL/unit (CST 02, 15, 53)
ad_rem_icms_retdecimalSingle-phase ICMS — withheld ad rem in BRL/unit (CST 15, 61)
p_dif_monodecimalSingle-phase ICMS — deferral percentage (CST 53)
q_bc_monodecimalSingle-phase ICMS — taxed quantity (liters/kg); 0 uses the item quantity (CST 02, 15, 53)
valor_desoneracaodecimalExempted ICMS amount in BRL — emits vICMSDeson (CST 40, 41, 50, 90)
v_bc_st_retdecimalCalculation base of the ICMS-ST withheld in the previous operation (provided, not calculated — CST 60, CSOSN 500)
p_stdecimalRate borne by the final consumer, in % (provided, not calculated — CST 60, CSOSN 500)
v_icms_st_retdecimalICMS-ST amount withheld in the previous operation (provided, not calculated — CST 60, CSOSN 500)
v_icms_substitutodecimalSubstitute's own ICMS amount (provided, not calculated — CST 60, CSOSN 500)
v_bc_fcp_st_retdecimalCalculation base of the FCP withheld by ST (provided, not calculated — CST 60, CSOSN 500)
p_fcp_st_retdecimalFCP rate withheld by ST, in % (provided, not calculated — CST 60, CSOSN 500)
v_fcp_st_retdecimalFCP amount withheld by ST (provided, not calculated — CST 60, CSOSN 500)
aliquota_icmsarrayRates per state: [{ "estado": "SP", "aliquota": 18.00 }]
aliquota_icms_starrayICMS-ST rate per state: [{ "estado": "SP", "aliquota": 18.00 }]
aliquota_mvaarrayMVA/IVA-ST per state: [{ "estado": "SP", "aliquota": 40.00 }]
aliquota_fcparrayFCP per state: [{ "estado": "SP", "aliquota": 0.00 }]
aliquota_fcp_starrayFCP-ST per state: [{ "estado": "SP", "aliquota": 0.00 }]
beneficio_fiscalarrayTax benefit per state: [{ "estado": "SP", "codigo": "SP800001" }]

pis / cofins

FieldTypeDescription
situacao_tributaria *stringPIS/COFINS CST
aliquota *stringPercentage rate (e.g. "0.00", "1.65", "7.60")
valor_unidadestringPIS/COFINS by quantity — value in BRL/unit; v = quantity × value (CST 03 and other per-quantity forms)

ibs_cbs (optional)

FieldTypeDescription
situacao_tributaria *stringIBS/CBS CST
classificacao_tributaria *stringTax classification code
p_ibs_ufstringIBS state rate in % (optional; empty uses the transition default, 0.10 in 2026). Accepts dot or comma
p_ibs_munstringIBS municipal rate in % (optional; default 0 in 2026)
p_cbsstringCBS rate in % (optional; default 0.90 in 2026)
p_red_aliqstringRate reduction percentage (CST 011, 200, 515)
p_difstringDeferral percentage (CST 510, 515)
p_red_bcstringTax base reduction percentage (CST 222)
proporcaostringOperation proportion in % (CST 221)
aliquota_cbs_monostringSingle-phase CBS — rate in % over the base; takes precedence over valor_unidade_cbs (CST 620)
aliquota_ibs_monostringSingle-phase IBS — rate in % over the base; takes precedence over valor_unidade_ibs (CST 620)
valor_unidade_cbsstringSingle-phase CBS — ad rem in BRL/unit; only used when there is no percentage rate (CST 620)
valor_unidade_ibsstringSingle-phase IBS — ad rem in BRL/unit; only used when there is no percentage rate (CST 620)
valor_deducao_legalstringLegal base deduction value in BRL (CST 830)

* Required field.

GET/api/nfce/category/get_detail

Get NFC-e tax category

Returns full data of an NFC-e tax category (description, CFOP, ICMS, PIS, COFINS and IBS/CBS).

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Query string

FieldTypeDescription
category_id *stringNFC-e category ID

* Required field.

GET/api/nfce/category/get_list

List NFC-e tax categories

Returns a paginated list of NFC-e tax categories registered for the authenticated company.

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Query string

FieldTypeDescription
page *intPage number (minimum 1)
page_size *intItems per page (1 to 50)

* Required field.

POST/api/nfce/category/edit

Edit NFC-e tax category

Note: Same structure as the /api/nfce/category/create endpoint, with the additional required field category_id. The icms, pis, cofins and ibs_cbs fields are fully replaced (no merge).

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Additional field

FieldTypeDescription
category_id *stringID of the category to edit

* Required field.

POST/api/nfce/category/delete

Delete NFC-e tax category

Removes an NFC-e tax category. Irreversible operation. Products bound to this category will continue referencing the removed category_id — update them first.

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
category_id *stringID of the NFC-e category to delete

* Required field.

POST/api/nfce/create

Issue NFC-e

Issues an NFC-e (model 65, always intrastate outbound, no shipping). Key differences from the NFe endpoint: the consumer object is called client (not cliente); the address number is client.number; the consumer is optional; impostos.ipi, shipping_address, delivery_address and transportation do not exist. The value field in pag_info is named amount.

Required headers

HeaderTypeDescription
tokenstringNFC-e company token
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds (5-minute window)

Body (root)

FieldTypeDescription
nature_of_operation *stringOperation nature (e.g. "Goods sale")
issuance_type *stringIssuance type: "1" (normal), "9" (NFC-e offline contingency)
ambiente *string"1" production, "2" homologation
products *arrayProduct list (see details below)
idstringExternal identifier
ind_presstringBuyer presence: "1" in-person (default), "4" home delivery, "5" in-person off-premises, "9" not applicable
ind_intermedstring"0" no intermediary, "1" marketplace. Required when ind_pres = 2, 3, or 4
total_discount_amountdecimalTotal invoice discount
trocodecimalChange value
segurodecimalInsurance amount
outras_despesasdecimalOther ancillary expenses
informacoes_complementaresstringComplementary info for the consumer
informacoes_fiscostringInfo of interest to the tax authority
clientobjectConsumer data (optional — see table)
pag_infoarrayPayments (default: cash on hand — see table)

client (optional)

Provide only if the consumer is identified. CPF or CNPJ must be sent as digits only.

FieldTypeDescription
cpfstringCPF (sets individual person)
cnpjstringCNPJ (legal entity)
iestringState registration
namestringName / corporate name
enderecostringStreet
numberstringAddress number (note: different from NFe, which uses numero)
complementostringComplement
bairrostringNeighborhood
citystringCity
ufstringState (validated from CEP, if provided)
cepstringPostal code (digits only)
telefonestringPhone
emailstringE-mail

products[] (each item)

FieldTypeDescription
name *stringProduct name (CJK characters are stripped)
ncm *stringNCM (8 digits)
count *decimalQuantity
unit *stringCommercial unit (e.g. "UN", "KG")
unit_price *decimalUnit price
total_price *decimalItem total value
origem *intMerchandise origin (0..8)
indicador_total *int1 = composes the invoice total; 0 = does not
category_id ⚠stringNFC-e tax category ID (required if impostos not sent)
impostos ⚠objectManual taxes (alternative to category_id; no IPI)
codigostringInternal product code
ceststringCEST
gtinstringCommercial GTIN/EAN
gtin_tributavelstringTaxable GTIN
discount_pricedecimalItem discount
nItemPedintPurchase Order Item (I61). Sequential item number within the order referenced by xPed (which comes from root id). Valid range: 1–999999. Default: omitted.

pag_info[] (each item)

FieldTypeDescription
payment_indicator *string"0" cash, "1" on credit
payment_method *stringPayment method (01=cash, 03=credit card, 04=debit card, 17=PIX, 99=other, etc.)
amountdecimalAmount paid in this method
card_info.integration_typestring"1" integrated, "2" not integrated (required for card 03/04)
card_info.brand_codestringCard brand (required for card 03/04)
card_info.acquirer_cnpjstringAcquirer CNPJ
card_info.authorization_codestringAuthorization code

* Required field. ⚠ category_id or impostos, one of them is required.

Response fields (data)

FieldTypeDescription
uuidstringInternal NFC-e identifier. Use it in follow-up calls (/api/nfce/get_detail, /api/nfce/get_danfe)
statusstringSituation: "Success" (authorized), "Failed" (rejected/failed), "Contingencia" (issued in offline contingency, pending transmission)
motivostringOfficial tax authority message for the cStat (bilingual PT / 中文 format)
nfceintIssued NFC-e number (note: the field is named nfce, not nfe)
serieintNFC-e series
chavestring44-digit access key (empty when the invoice was not authorized)
modelostringDocument model: "nfce"
xmlstringURL of the authorized XML
danfestringNFC-e DANFE URL — empty at issuance; generate it on demand with /api/nfce/get_danfe
In offline contingency (issuance_type = "9" or tax authority unavailable), the response comes with status: "Contingencia" plus the extra fields contingencia: true and tpEmis: 9; the invoice must be transmitted to the tax authority later.

Response — rejection / error

When tax authority rejects the invoice, success is false and data.motivo holds the reason; chave comes back empty. Field validation errors (before reaching tax authority) return success: false with the message in message and no data object.
        {
          "success": false,
          "data": {
            "uuid": "65f8b9a1c2d3e4f5a6b7c8d9",
            "status": "Failed",
            "motivo": "Rejeição 226: Código da UF do Emitente diverge da UF autorizadora / 拒绝 226: 发件人所在州代码与授权州不一致",
            "nfce": 5,
            "serie": 1,
            "chave": "",
            "modelo": "nfce",
            "xml": "",
            "danfe": ""
          }
        }
POST/api/nfce/cancel

Cancel NFC-e

Cancels an authorized NFC-e. Unlike NFe, the cancellation reason here is provided by the client and forwarded to the tax authority. The tax authority cancellation window is short (usually 15-30 minutes after authorization).

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chave *string44-digit access key of the NFC-e (note: here it's chave, not uuid as in other endpoints)
motivo *stringCancellation justification (minimum 15 characters, tax authority requirement)

* Required field.

Response fields (data)

FieldTypeDescription
motivostringOfficial tax authority message for the cancellation event
statusstringSituation: "Canceled"
nfceintCanceled NFC-e number
serieintNFC-e series
chavestring44-digit access key
modelostringDocument model: "nfce"
cStatinttax authority event code: 135 or 155 = cancellation approved. If the NFC-e was already canceled, the success response comes without cStat

Response — error

When tax authority rejects the event (e.g. cancellation deadline exceeded), success is false and data comes with status: "Failed" and the rejection cStat. Validation errors (missing chave/motivo, motivo shorter than 15 characters, NFC-e not found, contingency not yet transmitted) return success: false with the message in message and no data object.
        {
          "success": false,
          "data": {
            "motivo": "Rejeição: Pedido de Cancelamento intempestivo",
            "status": "Failed",
            "nfce": 5,
            "serie": 1,
            "chave": "35210112345678901234650010000000051234567890",
            "modelo": "nfce",
            "cStat": 501
          }
        }
POST/api/nfce/return

Return an NFC-e

Issues a return document for an authorized NFC-e. The return is an inbound NF-e (model 55) that references the access key of the original NFC-e in its XML; the NFC-e itself has no return document. The original is looked up among NFC-e records by uuid or chave, and items and tax fields are carried over from it. /api/invoice/return only searches NF-e records and answers "invoice does not exist" for any NFC-e; use this endpoint instead.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeRequiredDescription
uuidstringNouuid of the original NFC-e. Either this or chave
chavestringNo44-digit access key of the original NFC-e. Either this or uuid
cfopstringYesCFOP of the return, typically 1202 within the state and 2202 across states
natureza_operacaostringNoNature of the operation. Defaults to Devolução de Mercadoria
clienteobjectNoThe recipient, that is, the buyer of the original document. Fields: cpf, cnpj, name, endereco, numero, complemento, bairro, city, uf, cep, email, telefone. Fields sent override the original; fields omitted are taken from it

The return is an NF-e, and the recipient address is mandatory, whereas an NFC-e usually records no buyer address. When the original XML carries no address, cliente must include endereco, bairro, city, uf and cep; the endpoint lists whichever are missing.

Only an authorized NFC-e can be returned. The environment (production or test) follows the original and is neither required nor accepted as a parameter.

Repeated calls do not issue twice: when a return already exists for the same original in the same environment, that document is returned.

The whole document is returned. Items, quantities and tax fields come from the original; tax fields are resolved through the tax category first and, when the category is missing, copied from the CST and rates in the original XML.

Response fields (data)

FieldTypeDescription
uuidstringIdentifier of the return document
statusstringSuccess authorized, Failed rejected
motivostringMessage returned by the tax authority
nfeintNumber of the return document
serieintSeries of the return document
chavestring44-digit access key of the return document
modelostringAlways nfe: the return is an NF-e
epecbooleanWhether contingency issuance was used
xmlstringURL of the return document XML

Response — error

For parameter or original-document problems success is false, the reason is in message and there is no data. When the tax authority rejects the document, success is also false but data is present, with status equal to Failed and the reason in motivo.
        {
          "success": false,
          "message": "A devolução é uma NF-e e exige o endereço do comprador; a NFC-e original não o traz. Informe em cliente: endereco, bairro, city, uf, cep / 退货票是 NF-e,必须有买方地址,原 NFC-e 没有。请在 cliente 里传:endereco、bairro、city、uf、cep"
        }
GET/api/nfce/get_detail

Get NFC-e details

Returns the details of a specific NFC-e by UUID. Includes XML and DANFE (thermal receipt) URLs, plus customer data when provided.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
uuid *stringNFC-e UUID

* Required field.

POST/api/nfce/get_danfe

Get NFC-e DANFE

Returns the NFC-e DANFE URL (electronic fiscal receipt) as PDF, with a QR Code for the tax authority lookup. Generated on demand and cached by hash (access key + status); repeated calls return the existing URL.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
uuid *stringNFC-e UUID (note: here it's uuid, unlike cancel which uses chave)

* Required field.

GET/api/nfce/get_list

List NFC-e (paginated)

Lists the company's NFC-e with pagination. Parameters are passed via query string (not in the body). The time filter is optional, but if used, both start_create_time and end_create_time are required.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
page *intPage number (≥ 1)
page_size *intPage size (1–50)
start_create_timelongUnix timestamp in milliseconds — start (requires end_create_time)
end_create_timelongUnix timestamp in milliseconds — end
statusstringFilter by status. Values: "Success" (authorized), "Canceled" (canceled), "Processing" (processing), "Failed" (failed), "Unknown" (unknown)

* Required field.

POST/api/nfce/export

Batch export NFC-e

Batch-exports the company's production NFC-e by period (homologation/test notes are excluded). Generation is asynchronous: the first call starts the export and returns "status": "Processing"; repeat the same call (same body) until you receive "status": "Success" with the download url. XML and PDF are delivered as a .zip (one file per note); the spreadsheet as .xlsx or .csv. The result stays valid for 10 days: within that window the same parameters return the same file (notes issued after generation are not included — use a different period to generate a new file).

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
type *string"xml" (ZIP of XMLs), "pdf" (ZIP of DANFEs) or "sheet" (spreadsheet)
start_create_timestringStart date dd/MM/yyyy, Brasília time — the period starts at 00:00:00 of that day
end_create_timestringEnd date dd/MM/yyyy — the end day is included in full (until 23:59:59)
monthintAlternative to the date range: full month (1–12, Brasília time); a month greater than the current one = last year
statusstring"all" (default), "emitida" (authorized), "cancelada" (canceled) or "contingencia" (contingency)
patternstringFor sheet: "xlsx" (default) or "csv". For pdf: receipt width in mm — "80" (default), "72" or "50"

* Required field. Provide the period with start_create_time + end_create_time or with month.

Example 1 — In-Person Sale (no recipient)

        {
          "nature_of_operation": "Venda de mercadoria",
          "ambiente": "2",
          "ind_pres": "1",
          "products": [
            {
              "codigo": "001",
              "name": "Refrigerante 350ml",
              "ncm": "22021000",
              "count": 3,
              "unit": "matriz",
              "unit_price": 5.50,
              "total_price": 16.50,
              "category_id": "BEBIDAS_PADRAO",
              "origem": "0",
              "indicador_total": "1",
              "cfop": "5102"
            }
          ],
          "pag_info": [
            { "payment_indicator": "0", "payment_method": "17" }
          ]
        }

Example 2 — Home Delivery (with recipient)

        {
          "nature_of_operation": "Venda de mercadoria",
          "ambiente": "2",
          "ind_pres": "4",
          "client": {
            "cpf": "12345678900",
            "name": "Maria Silva",
            "endereco": "Rua das Flores",
            "number": "456",
            "bairro": "Jardim Primavera",
            "city": "São Paulo",
            "uf": "SP",
            "cep": "04567000"
          },
          "products": [
            {
              "codigo": "PIZZA01",
              "name": "Pizza Grande Marguerita",
              "ncm": "19059090",
              "count": 1,
              "unit": "matriz",
              "unit_price": 45.90,
              "total_price": 45.90,
              "category_id": "ALIMENTOS",
              "origem": "0",
              "indicador_total": "1",
              "cfop": "5102"
            }
          ],
          "pag_info": [
            { "payment_indicator": "0", "payment_method": "03" }
          ],
          "frete": 8.00,
          "informacoes_complementares": "Entrega em até 40 minutos"
        }