Back to the tool

Practical guide · 6 min read

How to anonymize an XRechnung XML before sharing it

An electronic invoice is not just a visual document. It is a structured dataset containing business, contact, tax and payment identifiers. A screenshot with a black rectangle does not remove those values from the XML.

Short answer: work on a copy, parse the XML locally, replace sensitive text nodes, review the result and share only the new file. Never overwrite the accounting original.

Why invoice XML needs a different privacy workflow

Germany’s federal e-invoicing documentation describes XRechnung as a structured XML data format designed primarily for machine readability. It can use the UBL and UN/CEFACT syntaxes, and its fields are intended to flow directly into receiving software. That makes it useful—but it also means sensitive values may be present even when they are not obvious in a rendered view.

The official submission terms list examples such as bank details, seller email, seller identifiers and buyer references. If a real invoice is attached to a support ticket or pasted into an AI tool, those fields travel with it.

Sources: German federal XRechnung FAQ and federal submission terms.

What should be anonymized?

Parties

Supplier and buyer names, legal names and electronic endpoint identifiers.

Contact data

Email addresses, phone numbers, street addresses, postcodes and cities.

Financial data

IBAN, BIC, payment account identifiers and tax-registration identifiers.

Document references

Invoice numbers and references that may reveal customer or internal system data.

Amounts, tax totals, currency codes and line-item structure are often useful for reproducing a software issue. They can remain unchanged when they are not commercially sensitive. The right balance depends on why the file is being shared.

A safer five-step process

  1. Duplicate the original invoice and keep the accounting record untouched.
  2. Open the duplicate with a tool that processes XML locally.
  3. Review every detected company, contact, tax, payment and document identifier.
  4. Replace the selected values with clearly synthetic data.
  5. Download the safe copy and inspect it once before attaching it to a ticket or prompt.

Does an anonymized file remain valid?

InvoiceVeil keeps an IBAN's country, length and letter/digit shape and recalculates its MOD-97 check digits. The replacement is still a synthetic value, not a live account, and the invoice may fail national-directory or other XRechnung business rules. Use the anonymized copy for debugging and communication—not for payment, accounting or official submission.