The NFS-e (Nota Fiscal de Serviรงos Eletrรดnica) is the electronic service invoice used in Brazil to report tax information to municipalities. Each municipality has its own rules, format, and API for issuing service notes.Invopopโs โNotas Fiscais Eletrรดnicasโ app provides a unified way to issue NFS-e documents across over 2000 municipalities using GOBL. You can find the full list of supported municipalities here.This guide will walk you through the steps required first to register a supplier and then issue service notes in their name.
whether the supplier opts into the โSimples Nacionalโ tax regime,
whether the supplier benefits from a fiscal incentive, and,
optionally, any special tax regime (MEI, estimated, coopโฆ) the supplier is subject to.
Customer details.
Details of the service provided, including quantity, price, applicable ISS rate, and service code (Cรณdigo Item Lista Serviรงo) as defined by the municipality.
To have chosen an invoice series.
A certificate and password accepted by the municipality to send service notes in the name of every supplier.
connect the Notas Fiscais Eletrรดnicas Brazil app,
configure a supplier registration workflow, and,
prepare an invoicing workflow.
These instructions apply to both the sandbox and live environments. Please note that the sandbox environment is simulated, and most responses are mocked. Youโll still need to register suppliers in the sandbox, but the company details, certificates or passwords donโt need to be valid or real.
All of the following steps must be carried out from the Invopop Console.
Before starting, review the workflows guide to understand the general setup process.In Console, create a new workflow and choose Empty Party workflow as the base. Then name the workflow with a descriptive label such as โNFS-e Post-registration workflowโ.This worfkow is composed by a single step:
Set State - To Registered.
Though you can customize it to suit your needs (adding a webhook, or an email notification after a supplier has been registered.)
2
Connect the Notas Fiscais Eletrรดnicas Brazil App
Enter the Configuration section, then tap Apps. Tap on the Connect button of the Notas Fiscais Eletrรดnicas Brazil app.
Tap the Configure button on the app, and choose the โPost-registration workflowโ we created in the previous step, or leave it empty.Tap the Save button.
Before starting, review the workflows guide to understand the general setup process.In Console, create a new workflow and choose Empty Party workflow as the base. Then name the workflow with a descriptive label such as โNFS-e register supplier workflowโ.The new workflow will need to perform three steps:
Sign the Envelope
Register NFS-e supplier
Set State - with configuration set to processing.
Add any additional steps you may need, and save the new workflow.
Before starting, review the workflows guide to understand the general setup process.In Console, create a new workflow and choose Empty Invoice workflow as the base. Then name the workflow with a descriptive label such as โIssue NFS-e invoiceโ.The new workflow will need to perform these steps:
Set State - to processing.
Add Sequential Code - with dynamic sequences and a name like โNFS-eโ.
Send NFS-e (Brazil).
Set State - to sent.
Finally, in the Error Handling area, add the Set State action and select Error.Add any additional steps you may need, and save the new workflow.
In this section, weโll provide details on how to first persist and register a supplier, followed by issuing service notes on their behalf.As usual, the recommended approach for running jobs is to perform two steps; first upload the document to the silo, second create a job.
Suppliers can be registered either manually via the Invopop Console or programmatically via the API. The process is essentially the same, so weโll demonstrate the manual method for this guide.Find the Contacts section of the sidebar and click Suppliers. Tap the + New Supplier button to be presented with a new editor. Copy and paste the following example that uses a fictitious example. This will only work in the sandbox environment; in production, youโll need the details of an actual company:
Tap Build, ensure there are no errors, and click Save.We should now see the document. Find and click the Select Workflow button. Select the Register Supplier workflow created during setup, and click Run workflow.The execution should be successful, and the silo entry will now be in the Processing state. Tap the Meta tab to see the registration link:
You can access the registration link via the API by fetching the silo
entry and reading the meta row where
the key is set to registration-link.
Tap the registration link, and a new browser window will open with a form to upload the supplierโs credentials. Note that this form can be shared directly with the supplier if necessary.
The details from this form are sent securely to Invopopโs local partner, PlugNotas, who will use them to authenticate in the corresponding municipality API.The supplier must ensure that the certificate and password are valid and accepted by the municipality where they are registered.Once the form is submitted, the supplier will be registered, and the post-registration workflow will be executed, changing the supplierโs state to registered.From this point on, you can send service notes on behalf of the supplier.
The following examples are of partial GOBL documents you can copy and paste directly into the Invopop Console or store via the API as silo entries. Then, you must run the โIssue NFS-eโ workflow created during setup.
In the sandbox environment, youโll notice that executing the workflow will always result in the same PDF and XML being attached to the silo entry. These are mock-up files returned by the sandbox environment for testing purposes.In production, the actual XML file sent to the municipality and the actual PDF generated will be attached to the silo entry.
GOBL Invoices sent as NFS-e require the following properties to perform the correct normalization and validation steps. Invopop will try to assign these automatically, but we recommend defining them explicitly before uploading: