Document (v2)
This page documents the new Document System (v2)
The reworked document generation is an experimental feature. Activate it with the DOCUMENT_GENERATION_REWORK feature flag. Its API can change until it becomes the default with Shopware 6.8.
What it is
The Document System (v2) generates order related business documents: invoices, delivery notes, credit notes, and cancellation invoices.
Each document can be generated in one or more file formats: HTML, PDF, ZUGFeRD XML, or ZUGFeRD-embedded PDF. Shopware stores the generated files per order.
Why a rewrite
The previous document system (v1) coupled document type and file format, so every combination of type and format needed its own renderer. Adding a format meant touching every type, and adding a type meant touching every format.
The Document System (v2) splits generation into three independent axes instead:
Availability
The Document System (v2) rolls out over three releases: it starts as an opt-in feature, becomes the default, and finally replaces v1.
The migration strategy ADR covers how v1 and v2 coexist during this window.
ADRs
- Refactor of document generation: why v1 needed a rewrite and the goals for the new implementation.
- New document generation architecture: the entity model and generation flow behind the v2 architecture.
- New document generation extension points: how plugins and apps add document types, data providers, and renderers.
- Document generation v1 to v2 migration strategy: how v1 and v2 coexist until v1 is removed in Shopware 6.9.