Skip to main content

NF-e SP

The NF-e SP connector integrates with the SEFAZ (Secretaria da Fazenda) of Sao Paulo for issuing and managing NF-e (Nota Fiscal Eletronica) documents, following the national NF-e layout version 4.00.

Setup

To use this connector, you need a valid A1 Digital Certificate issued by an ICP-Brasil certification authority.

FieldDescription
EnvironmentExecution environment: producao or homologacao.
Certificate (PFX/P12)Your digital certificate file in Base64.
Certificate PasswordThe password to unlock the digital certificate.

Auto-computed Fields

The connector automatically generates the following fields:

FieldDescription
Access Key (id)Computed from c_uf, dh_emi, cnpj, mod, serie, n_nf, tp_emis, and c_nf.
Check Digit (c_dv)Computed via modulo 11 from the access key.

Important: If you don't provide the id field in your JSON, the connector generates the access key automatically. We recommend not passing id manually to avoid inconsistencies.

Available Actions

nfe_autorizacao

Issues an NF-e. Receives a JSON payload with the invoice data and returns the authorization protocol.

nfe_consulta_protocolo

Queries the status of an NF-e by its access key.

nfe_status_servico

Checks if the SEFAZ service is available.

recepcao_evento

Sends events such as cancellation and correction letters.

nfe_inutilizacao

Invalidates a range of NF-e numbers.

nfe_distribuicao_dfe

Retrieves fiscal documents distributed to the CNPJ.

XML Structure

The connector automatically generates the digitally signed NF-e XML. The structure follows the official XSD schemas:

  • Namespace: http://www.portalfiscal.inf.br/nfe
  • Root element: <enviNFe>
  • Signed element: <infNFe> (referenced by the Id attribute)
  • Algorithms: RSA-SHA1 for signature, SHA1 for digest

Important Notes

  1. Test in homologacao first — Set environment: "homologacao" to test before going to production.
  2. A1 Certificate — The connector accepts PFX/P12 certificates in Base64. Make sure the certificate is valid and contains the private key.
  3. TLS 1.2 — Communication with SEFAZ uses TLS 1.2 exclusively.