A New Way to Analyze Brazilian Invoices

Announcing Beta Release of WEEL’s Invoice Analyzer

Russell Weiss
Inside WEEL
4 min readAug 17, 2020

--

(Link to Portuguese Version of this Article)

The Brazilian Nota Fiscal Eletrônica (NF-e) is an electronic invoice that documents the purchase and sale of goods and their movements. All companies in Brazil are required to submit their NF-es in a standard XML format managed by the SEFAZ (Brazilian Tax Authority). Over the past seven years, the SEFAZ has collected over 25 billion electronic invoices and created the largest database of electronic invoices in the world.

SEFAZ Invoice Stats

We Love This Data

The SEFAZ Database is a data scientist’s dream. Every data scientist knows that the worst part of data analysis is “data cleaning.” Imagine having all of a country’s economic movement at the most granular level, the invoice, perfectly formatted. As a FinTech company focused on serving business in Brazil, we have collected billions of NF-es, and we have had A LOT of fun using this data for fraud detection, credit decisioning, prospecting, price sensitivity analysis, and much more.

A Visualization Challenge

Example of an NFE XML

All NF-es have a common XML format, but an XML document is not particularly useful for most business users. Users need a way to easily see the data contained within the XML. To combat this challenge, the Documento Auxiliar da Nota Fiscal Eletrônica (DANFE) was created. The DANFE is a way of synthesizing and visually displaying a portion of the data contained within the NFE.

Sample DANFE

There are tons of free services like FreeNFE or Danfe.net that offer users a way to convert XML documents to DANFEs, but the biggest problem with the DANFE is that it only displays a small amount of the XML data. More than 90% of the data contained within the XML is not visible within the DANFE.

The SEFAZ Solution is Gone

Up until about a month ago, the best way for visualizing the full data contained within the XML was on the SEFAZ web site itself. The site even divided all of the data into tabs for the various data categories.

Data Categories in the old SEFAZ site

But now the SEFAZ is no longer displaying this data! Almost all of the critical data is either no longer available or hashed. Millions of monthly users that relied on the SEFAZ site to visualize the full NFE data were left stranded.

Introducing WEEL’s Invoice Analyzer

Many of WEEL’s internal teams needed a new way to visualize the full NFE data, so I turned to my team of Full Stack Data Scientists and told them to create something fast. They succeeded with flying colors and within about a week built the alpha version of WEEL’s Invoice Analyzer. The tool was initially built as an internal tool within our suite of tools for data visualization, but then we started showing it to external partners and colleagues and we continually got the same feedback, “we want that!”

So now, due to popular demand, we have decided to release a free, beta version of Invoice Analyzer for public use. Beta Users will be able to upload unlimited NFE XMLs and visualize all of the XML data. As a very big added bonus, we will provide Beta Users with access to our fraud alerts. The fraud alerts leverage our proprietary algorithms and data to identify fraud indicators within the invoice.

Click here to sign up for the Beta Release. We think you’ll enjoy it. Happy Invoice Analyzing!

--

--

Russell Weiss
Inside WEEL

Emotionally Intelligent. Data Nerd. Head of Decision Science at Banco BS2.