TF Fiscal

Core APIs

Companies

7 endpoints

POST/api/company/create

Register a new issuing company

Registers an issuing company under a distributor (b2b) account. Use this endpoint when company data is already available. For automatic extraction from the digital certificate, use /api/company/v2/create.

Required headers

HeaderTypeDescription
tokenstringDistributor token (b2b — the account must have isb2b=true)
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
Identification
cnpj *stringIssuing company CNPJ
name *stringCompany name
ie *stringState Registration (Inscrição Estadual)
invoice_type *stringTax regime (e.g., "simples_nacional", "normal")
unit *stringUnit type
emailstringCompany email
Address
cep *stringZIP code
address *stringStreet address
house_number *stringAddress number
town *stringNeighborhood
city *stringCity
state *stringUF (state abbreviation)
Digital certificate
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
Numbering and settings
serie *intNF-e series
number *intInitial number for numbering
Transport (MDF-e / CT-e / DC-e)
serie_mdfeintMDF-e series
number_mdfeintMDF-e starting number (where numbering begins)
serie_cteintCT-e series
number_cteintCT-e starting number (where numbering begins)
serie_dceintDC-e series
number_dceintDC-e starting number (where numbering begins)
Communication (NFCom)
serie_nfcomintNFCom series
number_nfcomintNFCom starting number (where numbering begins)
Energy (NF3e)
serie_nf3eintNF3e series
number_nf3eintNF3e starting number (where numbering begins)
is_create_category_templatebooleanAuto-create default tax categories. Default: true

* Required field.

POST/api/company/v2/create

Register company by certificate

Simplified version of /api/company/create: the API validates the digital certificate and automatically extracts company name, IE, address and other data via internal lookup. Only cnpj, cert_content and cert_pwd are required.

Required headers

HeaderTypeDescription
tokenstringDistributor token (b2b — the account must have isb2b=true)
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
is_create_category_templatebooleanAuto-create default tax categories. Default: true

* Required field.

POST/api/company/edit

Edit company data

Updates issuing company data. Send only the fields you want to change — all except company_id are optional. CNPJ is immutable: sending it returns an error. When cep is updated, the system automatically resolves stateCode and ibge. When cert_content and cert_pwd come together, the certificate is validated before being saved.

The company is created with the NF-e configuration (via /api/company/create). To enable the other documents, complete the setup here: this endpoint also accepts the NFC-e, NFS-e, MDF-e, CT-e and DC-e fields (see the sections below). Send only the fields for the document(s) the company will issue.

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
company_id *stringID of the company to edit
namestringCompany name
invoice_typestringTax regime
iestringState Registration
unitstringUnit type
emailstringEmail
cepstringZIP code (auto-updates stateCode and ibge)
addressstringStreet address
house_numberstringNumber
townstringNeighborhood
citystringCity
statestringUF
cert_contentstringContents of the A1 certificate file (.pfx/.p12), Base64-encoded
cert_filestringDeprecated — rejected from 2026-09-01. Certificate HTTPS URL
cert_pwdstringNew certificate password
serieintNew NF-e series
numberintNew initial number
aliasstringTrade name
telefonestringPhone
complementostringAddress complement
NFC-e
csc_idstringCSC (Taxpayer Security Code) ID at the tax authority
cscstringCSC token (shared secret with the tax authority)
serie_nfceintNFC-e series
number_nfceintInitial NFC-e number
NFS-e
imstringMunicipal registration (Inscrição Municipal)
codigo_municipio_nfsestringIBGE code of the issuing municipality
codigo_servico_nfsestringDefault service code (LC 116)
cnae_nfsestringDefault activity CNAE
serie_nfseintInitial NFS-e series
number_nfseintInitial NFS-e number
regime_especial_tributacaointSpecial tax regime code
optante_simples_nacionalboolOpting in to Simples Nacional
Transport (MDF-e / CT-e / DC-e)
serie_mdfeintMDF-e series
number_mdfeintMDF-e starting number (where numbering begins)
serie_cteintCT-e series
number_cteintCT-e starting number (where numbering begins)
serie_dceintDC-e series
number_dceintDC-e starting number (where numbering begins)
Communication (NFCom)
serie_nfcomintNFCom series
number_nfcomintNFCom starting number (where numbering begins)
Energy (NF3e)
serie_nf3eintNF3e series
number_nf3eintNF3e starting number (where numbering begins)

* Required field. Sending cnpj returns an error. All other fields are optional — send only the ones you want to change.

GET/api/company/get_list

List distributor companies

Lists issuing companies tied to the distributor (b2b) account, with pagination. Parameters via query string.

Required headers

HeaderTypeDescription
tokenstringDistributor token (b2b — the account must have isb2b=true)
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

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

* Required field.

GET/api/company/get_detail

Details of the authenticated company

Returns the complete data of the company identified by the token header, including the list of registered tax categories. Accepts no body or query string.

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature
timestampstringUnix timestamp in seconds
GET/api/company/get_cep_detail

Look up address by CEP

Resolves a Brazilian CEP (ZIP code) returning UF, IBGE municipality code and address data. Useful for filling in company and customer addresses. Requires a distributor (b2b) account.

Required headers

HeaderTypeDescription
tokenstringDistributor token (b2b — the account must have isb2b=true)
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
cep *stringBrazilian CEP (8 digits, with or without dash)

* Required field.

GET/api/company/get_export_invoice_month_files

List monthly export files

Returns the list of monthly export files that have already been generated for the company in the current year (timezone America/Sao_Paulo). Each month can have up to 4 files: 1 Excel spreadsheet (status Success only) + 3 XMLs (one per status Success, Canceled and Voided). Only files actually exported appear in the response — use /api/invoice/get_xml to generate new ones.

Required headers

HeaderTypeDescription
tokenstringCompany token
signstringMD5 signature
timestampstringUnix timestamp in seconds

Response

FieldTypeDescription
files[]arrayList of available files
files[].urlstringFile URL on OSS
files[].yearintPeriod year
files[].monthstringMonth (1–12)
files[].typestringFile type: "xlsx" or "xml"
files[].statusstringStatus of the invoices in the file: "Success", "Canceled" or "Voided"
files[].createdatetimeWhen the file was generated