TF Fiscal

公司管理

POST/api/company/v2/create

凭证书注册公司

/api/company/create 的简化版本:API 验证数字证书并通过内部查询自动提取公司名称、IE、地址等数据。只有 cnpj、cert_content 和 cert_pwd 是必填的。

必需请求头

tokenstringstring分销商令牌(b2b — 账户必须具有 isb2b=true)
signstringstringMD5 签名
timestampstringstring秒级 Unix 时间戳

Body

cnpj*stringstring开票公司 CNPJ
cert_content*stringstringA1 数字证书文件内容(.pfx/.p12 的 Base64)
cert_filestringstring已废弃,2026-09-01 起拒绝。
cert_pwd*stringstring证书密码
serie_mdfeintintMDF-e 系列
number_mdfeintintMDF-e 起始编号(编号从此处开始)
serie_cteintintCT-e 系列
number_cteintintCT-e 起始编号(编号从此处开始)
serie_dceintintDC-e 系列
number_dceintintDC-e 起始编号(编号从此处开始)
serie_nfcomintintNFCom 系列
number_nfcomintintNFCom 起始编号(编号从此处开始)
serie_nf3eintintNF3e 系列
number_nf3eintintNF3e 起始编号(编号从此处开始)
is_create_category_templatebooleanboolean自动创建默认税务类别。

 * 必填字段。证书中的 CNPJ 必须与 cnpj 一致;接口不检查该 CNPJ 是否已登记,重复调用会再创建一家公司。税务制度(invoice_type)由登记信息推导;NF-e 系列与起始编号固定为 1 和 1,需要其他值时,创建后调用 /api/company/edit 同时传 serie 与 number。

示例

# sign = md5(token + path + body + timestamp)
# 按接口路径生成的调用模板,占位符替换为实际值
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