Create and manage order documents using Document V2

With Document V2, you can create and manage invoices, credit notes, cancellation invoices and delivery notes for your orders. In this tutorial, you will activate the feature, configure your documents and create your first invoice. You will then learn how to download and send documents and use additional features.

Experimental feature: Document V2 is currently experimental. To use it, you must first enable the DOCUMENT_GENERATION_REWORK feature flag. For more information, see the Document V2 developer documentation.

Prerequisites

You need an order to create an invoice. To create a credit note or cancellation invoice, an invoice must already exist. Credit notes also require credit line items.

Activation & usage

Step 1: Activate Document V2

The feature is activated through the technical configuration of your Shopware installation. If you do not have access to it, ask the technical team responsible for your shop to enable the flag.

Shopware describes how to activate feature flags using the .env file. For the flag specified in the Document V2 documentation, this results in the following entry:

DOCUMENT_GENERATION_REWORK=1

Open the .env file of your Shopware installation, add the entry or change the existing value to 1, and save the file. The general procedure is documented under Activating feature flags.

Step 2: Prepare company information and document settings

First, check your company information under Settings > Master data > Company information. This is where you maintain the company information itself.

Next, open Settings > Shop > Documents. Here, you define the layout of your documents and the content they display.

You can configure the following settings:

  • Page layout: Paper size, orientation and number of line items per page.
  • Visible content: Including the header, prices, line items and page numbers.
  • Customer account: Display of documents in the customer account.

  • Addresses: Company and return addresses.

  • File names: Prefix, suffix and format-specific additions.

Adjust the settings to suit your requirements. Then check the result using a document preview.

Step 3: Prepare an invoice

  1. Open the relevant order and go to Documents.
  2. Select Invoice as the document type.
  3. Select one or more of the available file formats.
  4. Check the document number and enter the date. Add a comment if needed.

If no document number is explicitly provided, Document V2 uses the number range for the respective document type. See Document generation in the developer documentation.

The file formats you can select depend on the document type:

Document typeAvailable formats
InvoicePDF, HTML, ZUGFeRD XML, PDF with embedded ZUGFeRD
Credit notePDF, HTML, ZUGFeRD XML, PDF with embedded ZUGFeRD
Cancellation invoicePDF, HTML, ZUGFeRD XML, PDF with embedded ZUGFeRD
Delivery notePDF, HTML

The available formats for each document type are described in the Overview of document types and formats.

Step 4: Check the preview and create the invoice

  1. Open the preview of the prepared invoice.
  2. Check the information and layout, particularly addresses, line items, prices and pagination.
  3. If necessary, adjust the document details or document settings and check the preview again.
  4. Generate the invoice.

You can then download the document or send it by email.

Step 5: Download or send the invoice

Open the Documents section of the order and select the invoice you created.

  • Open or download: Use one of the formats available for the document.
  • Send by email: Use the document's send function.
  • Mark as sent: Use this function to mark the document as “sent”.

Sending by email and marking a document as “sent” are available as separate functions.

Create other document types

In addition to invoices, you can also create credit notes, cancellation invoices and delivery notes under Order > Documents. Select the relevant document type, choose from the available file formats and enter the document details. Check the document in the preview before generating it.

Please note the following additional prerequisites:

Document typeAdditional prerequisites
Credit noteAn existing invoice and credit line items
Cancellation invoiceAn existing invoice
Delivery noteA delivery date for document creation

The delivery date required for delivery notes is also described in the Overview of document types.

Manage existing documents

In the document section of an order, you can open or download existing documents in various formats, send them by email, mark them as “sent” and delete them.

If you want to download several documents together, you can download them as a ZIP archive.

You can also upload existing document files. The maximum file size is 50 MB per file.

Automate documents and edit multiple orders

If you need documents regularly or for multiple orders, additional options are available.

Document creation using the Flow Builder

Document V2 supports document creation using the Flow Builder. Documents can also be used automatically as email attachments in various formats.

Manage documents using bulk editing

When bulk editing orders, you can create, download and delete documents for multiple orders.

When creating documents, Document V2 supports both skipping existing documents and forcing them to be regenerated. Choose the behaviour that suits your use case.

Was this article helpful?

0 / 1000 characters