TF Fiscal

Companies

POST/api/company/edit

Edit company data

Updates issuing company data. Send only the fields to be changed; all fields are optional, and the company changed is always the one identified by the token header. CNPJ is immutable: sending it returns an error. When cep is updated, the system automatically resolves stateCode and ibge; when the CEP cannot be resolved, both remain unchanged. When any of cert_content, cert_file or cert_pwd is sent, the certificate is opened with the values sent (the stored value is used for whichever is omitted); when it cannot be opened or has expired, an error is returned and none of the changes in the request is 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

tokenstringstringCompany token
signstringstringMD5 signature
timestampstringstringUnix timestamp in seconds

Body

company_idstringstringOptional, used for verification: when sent, it must match the company_id of the company identified by the token header; otherwise an error is returned and nothing is changed
namestringstringCompany name
invoice_typestringstringTax regime; see /api/company/create for the accepted values
iestringstringState Registration
iestarrayarrayIEST (state registration as tax substitute), one per state: [{"uf": "MG", "ie": "0012345670053"}]. The list sent replaces the stored one; [] clears it. It goes on the NF-e (emit/IEST) when the destination state has an IEST on file and the invoice has ICMS-ST withheld; in-state sales and invoices without ST leave it out. Rejected: invalid state, repeated state, the company's own state, or IE longer than 14 digits
unitstringstringUnit type
emailstringstringEmail
cepstringstringZIP code (auto-updates stateCode and ibge; both remain unchanged when the CEP cannot be resolved)
addressstringstringStreet address
house_numberstringstringNumber
townstringstringNeighborhood
citystringstringCity
statestringstringUF
cert_contentstringstringContents of the A1 certificate file (.pfx/.p12), Base64-encoded
cert_filestringstringDeprecated — rejected from 2026-09-01.
cert_pwdstringstringNew certificate password
serieintintNF-e series.
numberintintNumber used by the next NF-e in the current series (or in the serie sent in the same request).
aliasstringstringTrade name
telefonestringstringPhone
complementostringstringAddress complement
NFC-e
csc_idstringstringCSC (Taxpayer Security Code) ID at the tax authority
cscstringstringCSC token (shared secret with the tax authority)
serie_nfceintintNFC-e series
number_nfceintintNFC-e starting number: when no NFC-e has been issued in the series yet, the first one uses this number; when the series already has issued invoices, numbering is not changed
NFS-e
imstringstringMunicipal registration (Inscrição Municipal)
codigo_municipio_nfsestringstringIBGE code of the issuing municipality
codigo_servico_nfsestringstringDefault service code (LC 116)
cnae_nfsestringstringDefault activity CNAE
serie_nfseintintInitial NFS-e series
number_nfseintintStored only; does not affect actual numbering
regime_especial_tributacaointintSpecial tax regime code
optante_simples_nacionalboolboolOpting in to Simples Nacional
Transport (MDF-e / CT-e / DC-e)
serie_mdfeintintMDF-e series
number_mdfeintintMDF-e starting number (where numbering begins)
serie_cteintintCT-e series
number_cteintintCT-e starting number (where numbering begins)
serie_dceintintDC-e series
number_dceintintDC-e starting number (where numbering begins)
Communication (NFCom)
serie_nfcomintintNFCom series
number_nfcomintintNFCom starting number (where numbering begins)
Energy (NF3e)
serie_nf3eintintNF3e series
number_nf3eintintNF3e starting number (where numbering begins)

Sending cnpj returns an error. All other fields are optional — send only the fields to be changed. When cert_pwd contains the mask ******** returned by the detail endpoint, the password is treated as unchanged. When the company has no NF-e tax category yet, the endpoint creates the default categories (same rule as is_create_category_template in /api/company/create). On success only success: true is returned.

Examples

# sign = md5(token + path + body + timestamp)
# Template generated from the endpoint path; replace the placeholders
curl -X POST "https://api.tffiscal.com/api/company/edit" \
  -H "Content-Type: application/json" \
  -H "token: $TOKEN" \
  -H "timestamp: $TIMESTAMP" \
  -H "sign: $SIGN" \
  -d @body.json