POST
/api/company/v2/createRegister 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
tokenstring | string | Distributor token (b2b — the account must have isb2b=true) |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
cnpj*string | string | Issuing company CNPJ |
cert_*string | string | Contents of the A1 certificate file (.pfx/.p12), Base64-encoded |
cert_string | string | Deprecated — rejected from 2026-09-01. Certificate HTTPS URL |
cert_*string | string | Certificate password |
serie_int | int | MDF-e series |
number_int | int | MDF-e starting number (where numbering begins) |
serie_int | int | CT-e series |
number_int | int | CT-e starting number (where numbering begins) |
serie_int | int | DC-e series |
number_int | int | DC-e starting number (where numbering begins) |
serie_int | int | NFCom series |
number_int | int | NFCom starting number (where numbering begins) |
serie_int | int | NF3e series |
number_int | int | NF3e starting number (where numbering begins) |
is_boolean | boolean | Auto-create the default tax categories. Created only for companies whose invoice_type is simples_nacional or simples; no category is created for other regimes. Default: true |
* Required field. The CNPJ in the certificate must match cnpj. The endpoint does not check whether the CNPJ is already registered; a repeated call creates another company. The tax regime (invoice_type) is derived from the registry data; the NF-e series and starting number are fixed at 1 and 1. For other values, call /api/company/edit after creation with both serie and number.
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/v2/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_do_certificado"
}
{
"success": true,
"data": {
"company_id": "10234",
"token": "3f9a1c7e5b2d4f6a8c0e1b3d5f7a9c2e"
}
}