Getting started
Overview of the TF Fiscal Open API, its capabilities, the three integration steps and where to read next.
TF Fiscal is a fiscal document platform for Brazil. Through one signed HTTP API your application issues NF-e, CT-e and DC-e on behalf of the companies you register, verifies third-party NF-e documents against SEFAZ, looks up CNPJ and CPF registry data, and receives every asynchronous result through webhooks.
Capabilities
| Capability | What it does | Documentation |
|---|---|---|
| NF-e | Issue, query and cancel NF-e (model 55) for registered companies; register and list correction letters (CC-e) | NF-e |
| CT-e | Issue, query and cancel CT-e (model 57, road modal) and register post-authorization events | CT-e |
| DC-e | Issue, query and cancel DC-e (model 99) for marketplaces and companies issuing for themselves | DC-e |
| NF-e verification | Two-tier verification of third-party NF-e XML files, plus lookup by access key (chave) | NF-e verification |
| Identity lookup | Official registry data for a CNPJ, or for a CPF together with its date of birth | Identity lookup |
| Webhooks | Signed callbacks carrying issuance results, post-authorization events and verification verdicts | Webhooks |
Companies, certificates and the webhook configuration are shared by every issuing document type: a company registered once can issue NF-e, CT-e and DC-e. See Companies.
How an integration works
- Get credentials and subscribe. Apply for an application and receive its
app_secret. It is displayed only once; keep it server-side. The platform then subscribes the application to the endpoints you need; calling an endpoint you are not subscribed to returns HTTP 403 with code10009005. - Verify your signature. Every request is signed with
MD5(token + path + body + timestamp)and carries thetoken,timestampandsignheaders. Make Echo test your first call: it validates the whole signing pipeline and returns the identity of your application. - Integrate by domain. Issuing integrations register a company, link its certificate, register a webhook and then issue documents. Verification and identity integrations only need the signed call, plus a webhook to receive verification verdicts.
Where to start
- Quick start: the five calls of an issuing integration, with runnable curl examples.
- Authentication: credential model, signing rules, known signing vectors and reference implementations in five languages.
- General conventions: response shapes, error typing, idempotency, rate limits, localization and data types.
- Environments: base URL and how a company moves from the test environment to production.
Note: every endpoint lives under
https://api.v2.tffiscal.com/openapi/.
