/api/nfce/company/createRegister 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 is already registered under the same user (uid), the registry lookup is skipped: csc_id, csc, serie_nfce, number_nfce, the certificate and the certificate password actually sent in the request update the stored values (omitted fields remain unchanged), and the existing company's company_id and token are returned with message Empresa atualizada para NFC-e. The existing-company check compares the CNPJ with punctuation removed, so the CNPJ with or without punctuation is treated as the same CNPJ. A new company receives its own token, which is used for subsequent NFC-e calls; the token in the request header is recorded as the company's distributor token.
Required headers
tokenstring | string | Distributor token (b2b) |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
cnpj*string | string | Issuing company CNPJ; punctuation is accepted and removed when the value is stored |
cert_*string | string | Contents of the A1 certificate file (.pfx/.p12), Base64-encoded. An error is returned when cert_pwd does not open the certificate or the certificate has expired |
cert_string | string | Deprecated — rejected from 2026-09-01. Certificate HTTPS URL |
cert_*string | string | Certificate password |
csc_*string | string | CSC (Taxpayer Security Code) ID at the tax authority |
csc*string | string | CSC token (shared secret with the tax authority) |
serie_int | int | NFC-e series. Defaults to 0 when omitted |
number_int | int | NFC-e starting number: when no NFC-e has been issued in the series yet, the first one uses this number (1 when omitted); when the series already has issued invoices, numbering is not changed. NFC-e numbers are counted independently per company and series |
telefonestring | string | Company phone |
* Required field. Other data (name, IE, address, etc.) are extracted automatically via SintegraWS from the CNPJ.
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/nfce/company/create" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"cnpj": "12345678000199",
"cert_content": "MIIOkAIBAzCC...(Base64)",
"cert_pwd": "senha_certificado",
"csc_id": "000001",
"csc": "ABCDEF0123456789",
"serie_nfce": 1,
"number_nfce": 1,
"telefone": "11999999999"
}
{
"success": true,
"message": "Empresa cadastrada para NFC-e",
"data": {
"company_id": 10234,
"token": "3f9a1c7e5b2d4f6a8c0e1b3d5f7a9c2e"
}
}