Skip to Content

Environments

Base URL

EnvironmentBase URL
Productionhttps://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 environmentambienteEmissao valuePurposeFiscal validity
TestHomologacaoIntegration testing and certificationNone — documents have no fiscal value
ProductionProducaoReal fiscal document issuingFull
  • Every company registered through POST /openapi/v2/empresas has one current environment. Newly registered companies default to test; switching to production is an operations action by the TF Fiscal team.
  • The ambienteEmissao of an issuance request must match the company’s current environment. A mismatch is rejected with codigo 10004030 — 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 the ambienteEmissao value 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

  1. Register the company and link its certificate. The company enters the approval queue; issuing before approval returns 10004004.
  2. Integrate in test: issue with ambienteEmissao=Homologacao, receive the authorized callback, query the invoice and download linkDanfe / linkDownloadXml. Work through the integration checklist, including the negative cases and a cancellation.
  3. 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.
  4. Ask operations to switch the company to production, then issue with ambienteEmissao=Producao. Until the switch, a Producao request 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 AguardandoAutorizacao for more than a few minutes, contact the platform with the empresaId and nfeId.
  • Webhook deliveries for test documents follow the same contract, signature and retry schedule as production — see Webhooks.
Last updated on