Process e-invoices from email: ZUGFeRD, Factur-X, XRechnung and Peppol UBL

Turn ZUGFeRD, Factur-X, XRechnung and Peppol UBL invoices from email into CSV, Excel or SQL rows, with sum and duplicate checks. No AI needed.

The Fields step after Use the invoice's data: 22 fields such as invoice_number, issue_date, due_date, currency, seller_name and seller_vat_id, each tagged From invoice data and found in 1 of 1 samples, a lines table, and the values highlighted in the XML

More and more invoices arrive as e-invoices: a PDF with the invoice’s data inside it, or the data alone as an XML file. That data already holds the invoice number, the dates, the supplier, the totals and every line. You shouldn’t have to type it in again, or ask an AI to guess it from the picture.

This post shows how Mail Attachment Downloader’s PRO Parser picks e-invoices out of a mailbox, reads their own data, checks it, and writes it to CSV, Excel or a database, with each invoice file saved under a name that means something.

Why e-invoices are arriving now

Several European countries are making structured e-invoices the norm between businesses. In Germany, businesses have had to be able to receive e-invoices since January 2025, and the duty to send them phases in through 2028. France’s reform began in September 2026, also in phases, and many other countries exchange e-invoices over the Peppol network.

Dates and details change, and they depend on your country and your business. Check the rules that apply to you; this post is not legal or tax advice.

What the Parser reads

The Parser reads the invoice’s own data. It finds it in two places:

  • A PDF with the XML inside it. Factur-X and ZUGFeRD invoices are PDF/A-3 files that carry the XML as an embedded file. You see a normal invoice; the Parser reads the data.
  • The XML alone. An XRechnung or a Peppol invoice is often just an XML file attached to the email. The Parser knows it by what it holds, not by its name.

It reads the two forms that EN 16931, the European e-invoice standard, allows:

  • CII: the UN/CEFACT Cross Industry Invoice, used by Factur-X, ZUGFeRD 2 and XRechnung in its CII form.
  • UBL 2.1: used by XRechnung in its UBL form and by Peppol BIS Billing 3.

Credit notes are read too. The older ZUGFeRD 1.0 is not.

The example

Contoso’s accounts payable team gets invoices at finance@contoso.com. Acme sends Factur-X PDFs, Fabrikam sends XRechnung XML files, and Northwind’s invoices come in as Peppol UBL. We want each one in a spreadsheet, and each invoice file saved in \\fileserver\Finance under its supplier and invoice number.

Step 1: Show the Parser an e-invoice

Open the Parser tab and click “New parser”. In “Source”, choose “Emails from a mailbox” and search for an email with an e-invoice, such as “INV-2026-0423”. Or choose “A file”, or drop the PDF or XML on “Drop files or emails here”.

The Parser's Source step: emails found by searching INV-2026-0423, the email from Acme Beispiel GmbH ticked as a sample and 1 email pinned
Pick an e-invoice email from Acme as the sample.

The step suggests 3 to 25 samples of the same kind. For e-invoices one already gives every field, because the values come from the invoice’s own data, not from learning; a few more let you check the results on several suppliers.

Step 2: Use the invoice’s own data

In “Fields”, when the sample carries e-invoice data, a green banner says so: “This invoice carries its own data. 22 fields and 2 lines found, exact, no AI needed.”

The Fields step of a new parser showing a Factur-X XML invoice, with a green banner: This invoice carries its own data, 22 fields and 2 lines found, exact, no AI needed, and the buttons Use the invoice's data and Choose which
The Parser sees that the sample carries its own invoice data and offers to use it.

Click “Use the invoice’s data”. Each value becomes a field, and the lines become a table. Or click “Choose which…” to tick only the values you want, then “Use the chosen”.

The fields you can get are: invoice number, invoice date, due date, currency; seller and buyer name, VAT id, country and email; buyer reference, order number, payment means, IBAN; subtotal, tax total, total, amount due; the document type (invoice or credit note) and the sum of the lines. An invoice only gives the values it holds.

The lines table has a row for each line of the invoice: line number, description, quantity, unit, unit price, tax rate and amount. Simpler e-invoices may carry no lines; then you get the fields alone.

The Fields step after Use the invoice's data: 22 fields such as invoice_number, issue_date, due_date, currency, seller_name and seller_vat_id, each tagged From invoice data and found in 1 of 1 samples, a lines table, and the values highlighted in the XML
22 fields and the lines, made from the invoice’s own data. Each field is tagged “From invoice data”, and its value is highlighted in the XML.

These fields are tagged “From invoice data”. No pattern to keep up, no AI to pay for, and the values are exact: dates as yyyy-MM-dd, amounts with a dot. Nothing leaves your system. Tick “Show fields” to see where each value sits in the XML.

Step 3: Check what came in

Exact values can still be wrong for you: a total far bigger than usual, lines that don’t add up, or the same invoice sent twice. In “Checks”:

  • Per field. Under “Check each field”, give the total a range with “Between”, or mark a field “Not blank”. Under “If it fails”, choose “Send to review”.
  • Sums. Under “Check fields together”, tick “The amounts of the lines add up to the subtotal (within 0.01)”. For an e-invoice, the lines are checked against the sum the invoice itself states.
  • Duplicates. Tick “The same”, pick the invoice number and the supplier (for e-invoices, invoice_number + seller_name, or the seller’s VAT id), and choose what happens when it “was parsed before:” “Skip it and note it”, or send it to review. A supplier who sends the same invoice twice isn’t paid twice.
The Checks step: a Between 0.01 and 100000 check on the total that sends it to review, the lines add up and subtotal plus tax checks, a duplicate check on invoice_number + supplier set to Skip it and note it, and the review queue settings, with 3 samples passing
Checks on a supplier-invoice parser: a range for the total, sum checks, and the duplicate-invoice check, tried on the samples first.

Under “Send an email to the review queue when”, leave “Any check above fails” and “A required field is blank” ticked.

Step 4: Review what was held back

An invoice that fails a check waits in Parser › “Needs you”. Nothing is written, sent or moved for it until someone looks. You see the email beside its values; fix one if needed and click “Approve and run the actions (Alt+A)”, or “Skip for now (Alt+S)”, or “Reject: do not process (Alt+R)”.

The Needs you queue of a parser called Supplier invoices: one invoice waiting, shown beside its values, with the buttons Approve and run the actions, Skip for now and Reject
The review queue. This one is a plain text invoice held for a low-confidence read; an e-invoice is held when a check fails or it is a duplicate.

Step 5: Send the data where you need it

In “Output”, choose where the values go. With PRO Parser:

  • “CSV file”, “Excel workbook” or “Google Sheets”: one row per email, with the columns you pick, such as {INVOICE_NUMBER}, {SELLER_NAME}, {ISSUE_DATE} and {TOTAL}. The invoice lines can go to their own sheet, one row per line.

With PRO Rules Server:

  • “SQL database”: a row per invoice in SQL Server, MySQL, PostgreSQL or any ODBC database.
  • “Webhook”: the fields as JSON to your accounting or ERP system.
  • “Tell me”: a message to Slack, Teams and other channels.

Each output has a “Test” button. Processing the same email again replaces its row instead of adding a second one.

Step 6: Save and name the invoice file

Under “Save files”, choose “The attachments” for the PDF or XML, or “The email and its attachments” to keep the email as an .eml file as well. Then build the folder and name from the fields with “Fields…”:

Folder: \\fileserver\Finance\E-invoices\{SELLER_NAME}
File name: {ISSUE_DATE}_{INVOICE_NUMBER}_{FILENAME}{EXT}

Acme’s invoice then lands as \\fileserver\Finance\E-invoices\Acme Beispiel GmbH\2026-10-22_INV-2026-0423_INV-2026-0423.pdf. The PDF is saved as it arrived, with its embedded XML.

The Output step: Save files set to The attachments, with folder and file name boxes and Fields buttons, and a CSV file with columns for invoice number, invoice date, PO number, due date, total and supplier, with a CSV preview
Save files and a CSV file on the Output step. The folder and name take any field the parser reads.
The Parser's Output step for the E-invoices parser: The attachments saved to \\fileserver\Finance\E-invoices\{SELLER_NAME} as {ISSUE_DATE}_{INVOICE_NUMBER}_{FILENAME}{EXT}, the For example path, and a CSV preview of the 22 values
Save each e-invoice in a folder per supplier, named by date and invoice number.

Step 7: Turn it on

In “Run on”, choose the accounts. Tick “Process the emails in the backup now” to handle the e-invoices of the last 30 days straight away, without downloading them again. Leave “Turn on after saving” ticked and save. From then on, the parser runs with each download.

Suppliers who send plain PDFs need a second parser, built with “Highlight” or “Using AI”; see invoice emails to your invoice processing software.

What it doesn’t do

  • It reads e-invoices; it doesn’t create or send them.
  • It doesn’t validate an invoice against the official XRechnung or Peppol rules. It takes the totals as the invoice states them and checks only what you set up in “Checks”.
  • It reads e-invoices that arrive by email (or as files). It isn’t a Peppol access point. If your Peppol provider can pass invoices on by email, the Parser reads them like any other.

Which edition do you need?

  • PRO Parser: everything above with CSV, Excel and Google Sheets output, up to 5 accounts per run. Includes PRO Backup.
  • PRO Rules Server: adds the SQL database, webhook and “Tell me” outputs, and runs as a Windows service with no one signed in.

The Free edition can save e-invoice files but doesn’t read their data. See PRO Parser: e-invoices and pricing.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Contact us with any questions about this post.