Skip to content

Processing XML Documents (XRechnung & ZUGFeRD)

Last updated: 27.03.2026 • Reading time: ~7 minutes

Smart Processing supports standardized e-invoice formats, including XRechnung and ZUGFeRD.

These formats can arrive as:

  • pure XML,
  • or hybrid documents with PDF and XML content.

The overall process remains the same (Classify → Process → Complete/Archive), but e-invoices add setup-driven behavior for extraction, processing source, preview, and archiving.


Prerequisites

  • XML workflows are set up (Workflow File Type XML).
  • In Smart Processing Setup, the XML Classification Mapping is configured.
  • E-Invoice Setup is reviewed and configured for your target behavior.
  • A Process Template exists; Smart Matching in the template is recommended (see below).

How It Works in Brief

  1. E-invoice detection and extraction
  2. If E-Invoice Attch. Extraction is enabled, Smart Processing checks incoming content for XRechnung and ZUGFeRD.
  3. In hybrid scenarios, related PDF/XML data is prepared before classification and capture.

  4. Processing source selection (PDF or XML)

  5. For XRechnung and ZUGFeRD, your setup decides whether processing uses PDF or XML.
  6. The selected source is used consistently in process steps such as classification, capture, and workflow resolution.

  7. Classification via TypeCode

  8. XML-based invoice types are classified deterministically via TypeCode in XML.
  9. The mapping TypeCode → Classification is maintained in XML Classification Mapping.

  10. Capture without separate setup

    • For XML, no separate capture setup is provided.
    • Smart Processing reads paths/elements from the XML, generates logical field names from them, and provides these as extracted fields.
    • No complex XPath paths are displayed as field names – instead, meaningful, consolidated identifiers (e.g., InvoiceNumber, BuyerVATId, Line.Amount).
  11. Matching to the Template

    • The logically named fields are assigned to the Process Template in the Matching Process.
    • Recommendation: In the template, activate Smart Field Matching to ensure automatic assignment.

Classification: XML TypeCode → Classification

Classification is done exclusively via the TypeCode in the XML (e.g., 380 = Invoice, 381 = Credit Note).

Procedure:

  1. Open Smart Processing Setup.
  2. Area ClassificationsXML Classification Mapping.
  3. Enter/change the mapping entries (Classification ↔ TypeCodes, comma-separated).

Capture for XML: Logical Field Names Instead of XPath

For XML invoices, Smart Processing performs structured parsing and generates logically named fields:

  • Header fields (e.g., InvoiceNumber, InvoiceDate, BuyerName, SellerVATId).
  • Line fields (e.g., Line.No, Line.ItemId, Line.Quantity, Line.Amount, Line.VATRate).
  • Document context (e.g., DocumentCurrency, PaymentTerms, ReferenceDocument).

Advantages:

  • Better readability and easier assignment in matching.
  • Robust against minor schema/profile variations, as long as semantic correspondences exist.

Note

Since a separate capture setup is not required, the Process Template (including Smart Matching) primarily controls the assignment to target tables and fields.


Processing and Archive Handling for Hybrid E-Invoices

For ZUGFeRD and XRechnung, setup controls two independent decisions:

  • Processing Handling: which file is used for processing (PDF or XML).
  • Archive Handling: which file(s) are archived (PDF, XML, or both).

This allows combinations such as:

  • process with XML for structured data,
  • archive both XML and PDF for compliance and readability.

If extraction is disabled, this behavior is not used and processing follows the original inbound file.


Preview Behavior

In e-invoice scenarios, preview can include:

  • the leading document,
  • and the related e-invoice attachment.

This helps users review both the visual and structured side of the same business document.


  • Use Smart Field Matching: Activate

  • Enables the automatic assignment of logically named XML fields to the Template Fields.

  • Lookup Validation (optional):

  • For master data fields (Customer/Supplier/Item), use Yes or Custom Codeunit to ensure clean references.

  • Numeric Options (e.g., decimal places, negative value handling):

  • Useful for amounts/quantities to process format variations stably.


Step-by-Step (Example Process)

  1. Import document → file appears in the Inbound List.
  2. Detect and extract e-invoice content (if enabled in setup).
  3. Classify → based on effective processing source and XML mapping.
  4. Process Document → header and line fields are assigned to the template (recommended: Smart Field Matching).
  5. Validation & Completion → review remarks and complete the process.
  6. Archive → files are archived according to e-invoice archive handling settings.

Troubleshooting

Document not classified

  • TypeCode is missing/different → check/supplement XML Classification Mapping.

Fields are missing or seem "inaccurate"

  • Check if the logical field names are present/assigned in the template.
  • Activate Smart Field Matching; alternatively, maintain Alternative Search Names in template fields.

Unsupported format error

  • Verify that the selected processing source (PDF or XML) matches your workflow and file expectations.

Extraction does not provide usable attachment content

  • Check that extraction is enabled and test with a valid XRechnung or ZUGFeRD sample.

Summary

  • Supported formats: XRechnung and ZUGFeRD.
  • Hybrid e-invoices can be detected and handled automatically when extraction is enabled.
  • Processing Handling selects the effective source file (PDF or XML).
  • Archive Handling controls whether PDF, XML, or both are archived.
  • Classification is done via TypeCode for XML-based invoice mapping.
  • Capture is not separately set up: Smart Processing generates logical field names from XML, no XPath paths.
  • Recommendation: Activate Smart Field Matching in the Process Template for automatic assignment.
  • The process remains standard, with e-invoice-specific controls for source selection, preview, and archiving.

Setup Help