What Data Staging solves

View as markdown

Data Staging (DSA) is Avalara’s ingestion and transformation layer for Brazilian electronic fiscal documents (DFe). It reads official XML files and converts them into normalized structures required by downstream compliance systems, such as Tax Compliance and Tax Reform modules. It decouples raw document capture from tax rule logic so parsing, validation, and high-volume processing run through a dedicated pipeline instead of the tax engine itself.

Getting started

Connect to Data Staging through the DSA API and UI by configuring subscriptions and upload workflows for the fiscal document types you process. Technical teams can use runbooks, deployment manifests, and swagger documentation from the Brazil Engineering and Reliability Engineering spaces to understand environments, endpoints, and onboarding practices for new document types and integrations.

Core capabilities

High-volume XML ingestion and validation
Process large batches of official XML documents, including NF-e, NFC-e, CT-e, NFCom, NF3e, and NFSe, where enabled, through a multi-stage pipeline that parses, validates, and stores normalized records.
Transformation layer
Transform SEFAZ and other DFe XML layouts into a unified DFe structure consumed by downstream systems, ensuring Tax Compliance and Tax Reform modules receive consistent, structured data across document models and sources.
Rule-oriented processing pipeline
Use a four-stage pipeline (parser, rule, request, response) to separate XML parsing, rule application, outbound requests to tax compliance, and response handling for improved observability and control.
Resilient, cloud-hosted architecture
Run on AWS using .NET services, workers, Angular UI components with SQS queues, MongoDB, and Terraform-managed infrastructure to support continuous operation and schema evolution over time.

When to use Data Staging

Use Data Staging when you need to:

  • Import official DFe XML files at scale and transform them into formats used by Tax Compliance and Tax Reform modules
  • Centralize XML parsing, schema validation, and document model updates instead of implementing them in each tax product
  • Standardize ingestion for multiple electronic document types, including NF-e, NFC-e, CT-e, NFCom, NF3e, and NFSe, while keeping tax rules and calculations in the Tax Compliance engine

How it integrates

Upstream, Data Staging receives official XML files from customer or partner systems through file uploads or automated feeds into S3 and the DSA API. Downstream, it publishes normalized DFe records into Tax Compliance (TCO) and, when enabled, Tax Reform (ROC) workflows using shared canonical structures. This allows new document models added in Data Staging to be reused across multiple compliance applications without rework.