--- title: "ZUGFeRD - Tutorial" slug: "tutorials-zugferd" updated: 2026-08-14T08:46:49Z published: 2026-08-14T08:46:49Z canonical: "docs.lobstersoftware.com/tutorials-zugferd" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # ZUGFeRD - Tutorial | *Last Update: 16.05.2025* | | --- | ## Introduction This guide will teach you how to send and receive ZUGFeRD messages. It explains the most common questions and problems that can come up when working with ZUGFeRD. If you still have questions, please do not hesitate to open a ticket at [support@lobstersoftware.com](mailto:support@lobstersoftware.com). For now, have fun with our ZUGFeRD guide! ## See also Section [PDF handling](/docs/en/intro-concepts-pdf). ## What is ZUGFeRD? ZUGFeRD is a cross-industry data format for electronic invoice data exchange that was developed by the Forum for Electronic Invoicing Germany (FeRD) - with support from the Federal Ministry of Economics and Energy. The ZUGFeRD data format is based on the Directive 2014/55/EU of 16 April 2014 on electronic invoicing for public contracts and on the EN16931 standard published on 28 June 2017. Also, the Cross-Industry Invoice (CII) of UN/CEFACT and the ISO standard 19005-3:2012 (PDF/A-3) are also taken into account as of ZUGFeRD 2.0. The areas of application for this hybrid invoice format are diverse. ZUGFeRD can be used in B2B, B2G, and B2C business transactions. ### Content identity As a hybrid data format, ZUGFeRD integrates structured invoice data in XML format into a PDF document (PDF/A-3). This means that the invoice is always sent in the form of a PDF document, which represents the visual component of the invoice. At the same time, an identical multiple copy of the same invoice (XML) is also sent within the PDF, so that electronic processing of the invoice using the structured invoice data - after implementation in the company-specific software system - is possible without any problems. PDF and XML must comply with the requirements of § 14 paragraph 4 of the German Value Added Tax Act ([UStG](https://www.gesetze-im-internet.de/ustg_1980/__14.html)) in order to display multiple copies of the same invoice with identical content. As the tax authorities have not defined any specific verification obligations or control measures for this procedure, it is recommended that the sender and the invoicing party introduce their verification mechanisms to ensure the content identity of the two invoices. In addition to the legal regulations, the principles for the proper keeping and storage of books, records, and documents in electronic form and the data access ([GoBD](https://www.bundesfinanzministerium.de/Content/DE/Downloads/BMF_Schreiben/Weitere_Steuerthemen/Abgabenordnung/AO-Anwendungserlass/2024-03-11-aenderung-gobd.html)), most recently dated November 28, 2019, must also be observed. (Source [https://www.ferd-net.de/en/standards/zugferd/factur-x](https://www.ferd-net.de/en/standards/zugferd/factur-x) ) To summarise, it's a PDF containing an XML file. You can open it with Adobe Acrobat Reader and read it with Lobster Integration. ![images/download/attachments/177913855/ZUGFeRD_en-version-1-modificationdate-1727269026925-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/ZUGFeRD_en-version-1-modificationdate-1727269026925-api-v2.png) ## Working with ZUGFeRD at Different Phases ### Main settings: Preparser Here you can use the *ZUGFeRD* PreParser for preprocessing by selecting it in the *Main settings* under *Extensions → Check preparsing*. This will extract the contained XML with the name *ZUGFeRD-invoice.xml, zugferd-invoice.xml or factur-x.xml* without any further configuration. Click here for documentation: [ZUGFeRD (Preparser)](/v1/docs/en/preparser-zug-fe-rd) Then, the XML is given to the profile as an input file. ### Phase 3: Structure and Mapping Phase 3 creates the foundation for the ZUGFeRD XML message. The structure for the desired conformance level, including the necessary namespaces, is created here. For ZUGFeRD, the structure is generated from multiple XSDs. It is important that you always use the structure for the required ZUGFeRD version and conformance level. All available ZUGFeRD information, including all XSDs for the current ZUGFeRD version 2.3 (as of 24 September) can be found here: [https://www.ferd-net.de/en/downloads/publications](https://www.ferd-net.de/en/downloads/publications) ### Case study - Use XML templates (recommended) Namespaces are also included. So, after importing the template, all that's left to do in the target is the mapping. To use an XML structural template, click on *Menu → Load template → XML* on the target side. A new window will open in which you can then select the desired ZUGFeRD type. ![images/download/attachments/177913855/xml-template-de-en-version-1-modificationdate-1747395559180-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/xml-template-de-en-version-1-modificationdate-1747395559180-api-v2.png) Choose the template you want to use. This will create the whole tree and set up the namespaces. Then, you can continue with the mapping. You can also load the structures from the menu on the source side. The document type in the base data must be set to XML, and the path is the same (*Menu → Load Template → XML*). To use the source structure correctly, you need to create matchcodes. Lobster Integration can automatically create these for XML structures. ![images/download/attachments/177913855/phase_2_en-version-1-modificationdate-1747397153031-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/phase_2_en-version-1-modificationdate-1747397153031-api-v2.png) To do this, open the *Menu* on the source side and select *Recreate matchcodes*. A window will then appear to confirm this and show you which record type was created. ![images/download/attachments/177913855/create_new_matchcodes_en-version-1-modificationdate-1747397153268-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/create_new_matchcodes_en-version-1-modificationdate-1747397153268-api-v2.png) ### Case study - Manual structure import via XSD So, if you need ZUGFeRD 2.1 EXTENDED, download the 2.3 package and select the appropriate schema. The schemas are backward compatible. In the case of ZUGFeRD 2.1 EXTENDED, use ZUGFeRD 2.3 EXTENDED. The schema consists of 4 XSDs: 1. Factur-X_1.0.07_EXTENDED.xsd (Main XSD file) 2. Factur-X_1.0.07_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd 3. Factur-X_1.0.07_EXTENDED_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd 4. Factur-X_1.0.07_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd The main XSD file references the sub XSDs. Place the 3 sub-XSDs in the root directory of your Lobster Integration. Now create the target structure from the file analysis using the target structure menu (*Menu → Create structure → from file analysis*) by dragging the main XSD onto the analysis and selecting XSD/DTD Schema as the type. Enter CrossIndustryInvoice as the *XML Root element name* and click *Apply*. **Note:** If you do not know the root name of an XSD, you can enter *data* in the field. Lobster Integration will then search for the root name. The prerequisite is that there is only one root name in the XSD. Since the structure for ZUGFeRD 2.3 Extended represents the maximum expression, the target tree will be very large. For recursive structures, such as the ZUGFeRD structure, Lobster Integration does not consider all levels by default, which means that field names containing *Skipped_to_much_content...* are created. Lobster Integration provides parameters in the XSD parser to prevent this behavior. These parameters are *maxDuplicatedElementCount* and *maxRecursionDepth*. For ZUGFeRD 2.3 EXTENDED, set *maxDuplicatedElementCount* to 800 and *maxRecursionDepth* to 100. Then click *Apply.* *![images/download/attachments/177913855/XSD_import_en-version-1-modificationdate-1747397243039-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/XSD_import_en-version-1-modificationdate-1747397243039-api-v2.png)* Conveniently, the document type XML and the root element are automatically entered in phase 2, so you don't have to worry about them. More about XML Schemas: [XML Schemas - XSD/DTD Files](/v1/docs/en/import-structure-xml) Once you have done everything correctly, a structure is created, and you can start mapping.The ZUGFeRD package also includes descriptions to help you find the right locations for your data. ### Namespaces ZUGFeRD XML uses namespaces, which must be declared in the root element with the prefix xmlns and a suffix, e.g., *xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"*. Namespaces are created either as fields or in the namespace administration. Both methods are described below. Please use only one of them. #### Namespace fields A field for a namespace definition is always given the name of the namespace and the suffix _nsdef. So, let's stay with the ZUGFeRD 2.3 EXTENDED example. The following namespaces are required there: xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:10" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" So here we have four namespaces that need to be declared. Therefore, create the fields as follows under the CrossIndustryInvoice node and assign them the URI as a fixed value: ![images/download/thumbnails/177913855/nsdef_de-en-version-1-modificationdate-1747396069170-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/nsdef_de-en-version-1-modificationdate-1747396069170-api-v2.png) | Field | Value | | --- | --- | | *rsm_nsdef* | *urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100* | | *qdt_nsdef* | *urn:un:unece:uncefact:data:standard:QualifiedDataType:10* | | *xs_nsdef* | *http://www.w3.org/2001/XMLSchema* | | *udt_nsdef* | *urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100* | | *ram_nsdef* | *urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100* | The declared namespaces must now be made known to the nodes and fields to give the tags the appropriate prefix. The *XML namespace* attribute is available in the node and field properties for this purpose. Enter the namespace to be used as a suffix for the XML element. ![images/download/thumbnails/177913855/XML_Namespace_en-version-1-modificationdate-1727269119926-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/XML_Namespace_en-version-1-modificationdate-1727269119926-api-v2.png) If a child structure is to have the same namespace, the namespace can be inherited by the child nodes and fields using the context menu. To do this, right-click on the relevant node to open the context menu and select *Hand down XML namespaces*. Go through the whole structure to assign the namespaces to the elements, exactly as in the examples in the package. #### Namespace management You can access the namespace administration on the target side via *Menu* → Manage *XML namespaces*. A new window will open where you can then enter the namespace prefix and the associated URI (without quotation marks). Namespaces specified there are always entered in the root element of the XML, exactly as we need them for ZUGFeRD. In addition, the namespaces are automatically displayed in the *XML Namespaces* attribute in the drop-down menu, where they can be selected. If you change the name of a namespace in the namespace manager, the change is immediately reflected in the structure, so no nodes or fields need to be adjusted. ![images/download/attachments/177913855/xml_namespace_attribute-en-version-1-modificationdate-1747397423390-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/xml_namespace_attribute-en-version-1-modificationdate-1747397423390-api-v2.png) ### Mapping So, we've talked a lot about XML, but you're probably wondering when the PDF invoice will become important. - Right now. Once the mapping is complete, you should also consider where the PDF invoice comes from. Ideally, an upstream system has already created it and placed it in a directory. Determine this path using your own logic and store it in a variable that we will need in one of the next phases. **Note**: Please note that this is a directory within Lobster Integration and not a network drive. In principle, you can enter a network drive here, but you will only be able to access shares that are shared with the user Lobster Integration is running as. The PDF can also be generated by Lobster Integration if this cannot be done by another system. More information about this can be found here: [ZUGFerdPDF](/v1/docs/en/zug-ferd-pdf) ### Phase 5: Integration Unit There are two ways to create a ZUGFeRD: 1. [ZUGFeRD IU](/v1/docs/en/iu-zug-fe-rd) 2. The [XMLNoTemplateUnit](/v1/docs/en/xml-no-template-unit) in combination with the [ZUGFeRDPDF PostExecuter](/v1/docs/en/zug-ferd-pdf) Our recommendation is the second way with the XMLNoTemplateUnit in combination with the ZUGFeRD PostExecuter. The advantages are obvious: 1. There is no need to create a template. 2. All XML features (attributes, namespaces, structures) are created in the target structure, are visible to everyone, and are easy to debug. See also: [Match Codes, Unique Names, Reserved Names (XML)](/v1/docs/en/document-type-xml-names) 3. The XML can also be easily accessed in other responses. Based on the recommendation, use the XMLNoTemplateUnit as usual. Depending on whether you need the XML in other responses (e.g., for the archive) or not, the ZUGFeRD PostExecuter can be used directly under the IU in the *Check postparsing* area. In this case, the result of the IU would always be the ZUGFeRD, and the XML could only be read via this. It is therefore recommended that the ZUGFeRD is only created in the appropriate response path. ### Phase 6: Create ZUGFeRD Of course, any type of response can be used. The response (or responses) that the ZUGFeRD is to output as a result is given to the PostExecuter [ZUGFeRD PostExecuter](/v1/docs/en/zug-ferd-pdf) in the *Content settings*. Here you need the path to the PDF invoice. This should be completely from a variable. The conformance level and the ZUGFeRD version are also expected in the configuration. As of ZUGFeRD 2, additional attachments can optionally be packed into the PDF. Let's say we wrote the path to the PDF invoice in phase 3 in the variable *var__path_to_PDF*, we need the *EXTENDED* conformance level, we create a ZUGFeRD version 2, and we don't want any more data with attachments. The configuration will look like this: @var__path_to_PDF@:EXTENDED:2 Also set the *Content settings* to O*utput from IU* and the encoding to *UTF-8*. ![images/download/attachments/177913855/Phase6_content_settings_en-version-1-modificationdate-1727269153811-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Phase6_content_settings_en-version-1-modificationdate-1727269153811-api-v2.png) The result is a ZUGFeRD PDF with embedded XML. But now you may be wondering which ZUGFeRD version and conformance level is required when. - Good question! The answer is quite simple: Your partner will tell you which ZUGFeRD version and which conformance level to send. But what if your partner has only sent you a sample XML? Don't worry, it's easy. You can work out what version of ZUGFeRD it is using the points below. 1. The name of the XML ZUGFeRD 1: *ZUGFeRD-invoice.xml* and *zugferd-invoice.xml*. ZUGFeRD 2: *factur-x.xml*. 2. The root element ZUGFeRD 1: *CrossIndustryDocument* ZUGFeRD 2: *CrossIndustryInvoice* So we've identified the version, but what's the conformance level? This is conveniently contained in a valid ZUGFeRD message in the data. Look for the tag. There you will find a string containing the specific conformance level. **Beispiel** ```plaintext urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic