Environments
Base URL
| Environment | Base URL |
|---|---|
| Production | https://api.v2.tffiscal.com |
Full URL = base URL + path. The path used in request signing includes the /openapi
prefix (no host, no query string) — see
Authentication & Signing. All examples in this documentation
use this base URL.
Company environment (issuance)
NF-e issuing in Brazil runs against two SEFAZ environments, and the platform models that split per company, not per API host:
| Company environment | ambienteEmissao value | Purpose | Fiscal validity |
|---|---|---|---|
| Test | Homologacao | Integration testing and certification | None — documents have no fiscal value |
| Production | Producao | Real fiscal document issuing | Full |
- Every company registered through
POST /openapi/v2/empresashas one current environment. Newly registered companies default to test; switching to production is an operations action by the TF Fiscal team. - The
ambienteEmissaoof an issuance request must match the company’s current environment. A mismatch is rejected withcodigo10004030 — a hard guard against test invoices being issued into production. - The same
app_secret, the same endpoints and the same signing scheme are used in both environments; only the company’s state and theambienteEmissaovalue change. - The invoice number sequence and series submitted at registration
(
emissaoNFeProduto.ambienteProducao) are the ones used for issuance; the platform manages the sequence afterwards.
Verification and identity endpoints
The Verification API and the Identity API
have no environment switch: they work against official data sources. In verification
responses, ambienteEmissao (Producao / Homologacao) describes the document that
was submitted, not the caller.
Path to production
- Register the company and link its certificate. The company enters the approval queue; issuing before approval returns 10004004.
- Integrate in test: issue with
ambienteEmissao=Homologacao, receive the authorized callback, query the invoice and downloadlinkDanfe/linkDownloadXml. Work through the integration checklist, including the negative cases and a cancellation. - Confirm the operational basics: servers NTP-synchronized (the ±300 s timestamp window applies everywhere), webhook URL publicly reachable and answering 2xx within 10 seconds, deduplication on the event id in place.
- Ask operations to switch the company to production, then issue with
ambienteEmissao=Producao. Until the switch, aProducaorequest returns 10004030.
Operational notes
- All times produced by the platform are UTC, regardless of environment.
- While a company is in the test environment, issuance latency depends on the
availability of the SEFAZ test environment. If an invoice stays in
AguardandoAutorizacaofor more than a few minutes, contact the platform with theempresaIdandnfeId. - Webhook deliveries for test documents follow the same contract, signature and retry schedule as production — see Webhooks.
Last updated on