TF Fiscal
Documentation

Companies

Link digital certificate

Uploads the company A1 digital certificate (.pfx / .p12) and its password; accepts JSON + Base64 or multipart.

POST/openapi/v1/empresas/{empresaId}/certificadoDigital
Requires the token, timestamp and sign signature headers, see Authentication.

The same path accepts two request shapes, selected by Content-Type: use JSON + Base64 (this page) when you only hold the certificate bytes; use multipart (section below) when you hold the certificate as a file. Validation and outcome are identical for both shapes. A successful upload replaces the company previous certificate.

Headers

Content-Type*
stringBody type

* Required field

Path parameters

empresaId*
stringCompany identifier

* Required field

Request body

senha*
stringCertificate password
arquivoBase64*
stringCertificate in Base64

* Required field

200
Certificate validated and linked; no response body. The company previous certificate is replaced.

No response body

For the JSON shape the body is part of the signature: raw body with CR/LF removed, same as every other JSON endpoint. Produce standard Base64 without line breaks.

bash
APP_SECRET="sk_live_9f8e7d6c5b4a"
P="/openapi/v1/empresas/1934811222334455/certificadoDigital"
TS=$(date +%s)
BODY=$(printf '{"senha":"certpass123","arquivoBase64":"%s"}' "$(base64 -w0 uploaded-cert.pfx)")
SIGN=$(printf '%s' "${APP_SECRET}${P}${BODY}${TS}" | md5sum | cut -d' ' -f1)
curl -X POST "https://api.v2.tffiscal.com${P}" \
-H "token: ${APP_SECRET}" -H "timestamp: ${TS}" -H "sign: ${SIGN}" \
-H "Content-Type: application/json" --data-binary "${BODY}"