Skip to content
Back to Projects
Private Case StudyGovernment API IntegrationXML Processing

NFSe XML Automation Pipeline

Automation pipeline built to download NFSe XML documents through a federal government API, organize files by client and period, extract relevant invoice fields, and generate structured Excel outputs for auditing and reconciliation workflows.

Outcome

Reduced manual effort in multi-client NFSe collection and organization workflows, while standardizing outputs for faster auditing, reconciliation, and operational review.

PythonAPIsXMLData PipelinesExcel ReportsNext.js

Context

Accounting and fiscal teams often need to retrieve electronic service invoice documents for multiple clients, organize the files correctly, extract key invoice information, and prepare the data for auditing and reconciliation.

When handled manually, this process becomes repetitive and fragile: downloading documents one by one, organizing folders, validating files, and moving data into spreadsheets for review consumes time and increases the chance of inconsistency.

Problem

The original workflow created several operational bottlenecks:

  • Manual retrieval of NFSe XML documents for multiple clients
  • Repetitive file organization by client and period
  • Manual extraction of invoice fields for auditing workflows
  • Greater risk of inconsistency in high-volume routines

Solution

I built an automation pipeline that handled the main steps of the process in a more reliable and repeatable way:

  • Integrated with a federal government API to retrieve NFSe XML documents
  • Organized downloaded files in a structured layout by client and period
  • Parsed XML documents and normalized key invoice fields
  • Generated Excel outputs designed for auditing and reconciliation
  • Supported operational visibility through a web interface for run monitoring and output navigation

The result was a workflow that reduced manual handling while making document retrieval and invoice verification more standardized across clients.

Engineering Notes

  • API integration used for document retrieval
  • XML parsing and normalization pipeline for invoice fields
  • Structured directory organization for operational consistency
  • Excel report generation for audit-friendly review
  • Web interface with Next.js for visibility and navigation

Impact

  • Reduced manual effort in collecting and organizing NFSe documents
  • Standardized outputs for faster auditing and reconciliation
  • Improved consistency in repeatable multi-client workflows
  • Made invoice data easier to review and track operationally

Confidentiality

This project is documented as a private case study. Source code, internal rules, client information, and sensitive datasets are not included due to company policies and confidentiality requirements.