XML Export

Export data in DATEV XML format (“DATEV Online”).

Overview

The XML exporter generates:

  • One archive XML file (references all documents)
  • One XML file per invoice/credit memo
  • Optional XSD validation (archive + each document XML)

Configuration

Configure under: Stores >Configuration > MageB2B > DATEV Export Pro > XML Export Settings

SettingDescription
Enable XML ExportShows XML settings in admin UI
XML Schema VersionVersion used for namespaces + XSD validation (e.g. v060)
Validate XML against XSDValidates archive + document files
XML EncodingConfig option (current generator writes UTF-8)

XML Structure

The archive file has an root element and references each document file via ....

Document files are nested based on the mapping keys (dot notation).

Field Mapping

XML mapping is configured as JSON:

  • JSON keys = XML field paths (dot notation creates nested elements)
  • JSON values = expressions evaluated against invoice.* / creditmemo.*

Example mapping (invoice):

{ "header.invoiceNumber": "{{invoice.increment_id}}", "header.invoiceDate": "{{invoice.created_at}}", "amount.grossAmount": "{{invoice.grand_total}}", "amount.currencyCode": "{{invoice.order_currency_code}}", "customer.firstName": "{{invoice.billing_address.firstname}}", "customer.lastName": "{{invoice.billing_address.lastname}}" }

Tip: Use Mapping Language to format values (dates, conditionals, functions).

Output Files

  • Archive: var/export/datev/DATEV_XML___.xml
  • Documents: var/export/datev/invoice_.xml / creditmemo_.xml
  • ZIP (when “Download Documents” is enabled): var/export/datev/DATEV_XML___.zip with:
    • document.xml (archive)
    • documents/*.xml
    • pdfs/*.pdf

Validation

If “Validate XML against XSD” is enabled, the exporter validates:

  • the archive XML file
  • each generated document XML file

Found an issue with this documentation? Let us know