Modern Invoice Template for Typst
A professional, compliant, and automated invoice template for Typst with integrated ZUGFeRD e-invoicing support. This package follows the German DIN 5008 standard (Form A & B) and automates calculations, VAT handling, and payment details.
![]()
Features
- Internationalization (i18n) (New in v0.3.0): Built-in support for English and German out of the box, plus a highly flexible
localeAPI to inject custom translations for any language. - DIN 5008 Compliant: Supports both Form A and Form B layouts natively via the flexible Theming API.
- ZUGFeRD e-invoicing (New in v0.4.0): (Experimental) Embed EN 16931-compliant Factur-X/ZUGFeRD XML metadata into your generated PDF/A-3B invoices for automated digital processing. The invoice data is checked against the rules of the selected profile, and all problems are reported at once.
- Block-based API: Clean, scoped, and declarative data structure using
#line-items,#item,#group, and#bundle—inspired by CeTZ, keeping your document clutter-free. - Automatic Calculations: Effortlessly handles line items, nested bundles, sub-totals, and calculates taxes automatically.
- EPC QR-Code (GiroCode): Automatically generates a scannable banking QR code for quick and easy payments using banking apps.
- Payment Means: Besides bank details for a transfer,
#direct-debit(SEPA direct debit with mandate reference and creditor identifier),#card-paymentand#paidfor invoices that are paid already, and cash discounts with#payment-goal(discount: ..). The printed invoice and the e-invoice state the same payment means. - Legal Content: The default references print what the law requires on an invoice, such as the seller’s tax number or VAT ID and the date of the supply, and an e-invoice checks that the printed invoice shows them. Credit notes, corrected and self-billed invoices (
document-type), notes, the payee and the VAT exemption reasons with their VATEX codes are stated as well. - Identifiers: Typed party identifiers, such as
id.gln(..),id.siret(..),id.leitweg(..)orid.register(..)(commercial register), stated in the e-invoice, which checks their format and check digits. - Advanced Modifiers: Apply specific discounts, surcharges, and custom tax rates at the item, bundle, or global level.
- Highly Customizable: Easy configuration of sender, recipient, payment goals, bank details, and visual themes to match your corporate identity.
Documentation
For comprehensive guides, API references, theming instructions, and advanced examples, please visit our official documentation:
👉 Read the Full Documentation Here
Getting Started
Installation
Import the package at the top of your Typst file:
#import "@preview/invoice-pro:0.5.0": *
Basic Usage
Here is an example of how to create an invoice using the new v0.3.0 API:
#import "@preview/invoice-pro:0.5.0": *
#show: invoice.with(
theme: themes.DIN-5008(form: "A"), // or form: "B"
locale: locale.en-de,
sender: (
name: "Your Company / Name",
address: "1 Example Street",
city: "12345 Example City",
tax-nr: "123/456/789",
),
recipient: (
name: "Customer Name",
address: "5 Customer Street",
city: "98765 Customer City",
),
invoice-nr: "2026-01",
)
// Add Invoice Items inside a scoped block
#line-items[
#item(
[Consulting & Concept],
price: 85.00,
quantity: 5,
unit: "hrs"
)
#item(
[Web Design Layout (Flat Rate)],
price: 1200.00,
)
#item(
[Stock Licenses (Images)],
price: 25.00,
quantity: 4,
)
#discount([Project Discount (Regular Customer)], amount: 10%)
]
// Payment Terms
#payment-goal(days: 14)
// Bank Details with QR Code
#bank-details(
bank: "Example Bank",
iban: "DE07100202005821158846",
bic: "EXAMPLEBICX",
)
#signature()
API Stability
With the major refactoring introduced in version 0.2.0, the package structure is solidifying. Here is the current stability status of the various API components:
- Invoice Header (
invoicearguments): Mostly Stable. The core invoice configuration is established. Future updates to the header will be non-breaking and will primarily consist of adding new optional fields. - Data Model (
#line-items,#group,#bundle,#item): Stable. The new block-based data model is considered almost finished and safe to use.- Note: The
unitargument in#item,#group, and#bundlesupports dictionary inputs (e.g.,(display: "Std.", code: "HUR")) to comply with the standardized unit formats and codes required for ZUGFeRD e-invoicing.
- Note: The
- Theming (
theme): Under Construction. The theming engine is still evolving and will most likely experience breaking changes in the next updates as we refine customization capabilities. - Localization (
locale): Under Construction. The localization and internationalization systems are actively being worked on and are subject to change.
Known Limitations
- Factur-X XMP metadata: Typst cannot write custom XMP metadata yet, so the PDF lacks the Factur-X extension schema that announces the embedded XML. The embedded XML is valid, but validators that check the PDF itself (Factur-X / ZUGFeRD PDF validation) reject the PDF. An optional post-processing step with the Mustang command line tool, outside the package, is described in the e-invoicing documentation.
Dependencies
This template relies on these amazing packages:
letter-profor the DIN layout.sepayfor EPC-QR-Code generation.ibanator(throughsepay) for the IBAN check of the EPC-QR-Code.loomfor reactive document rendering.
Acknowledgements:
- Special thanks to classy-german-invoice by Kerstin Humm, which served as inspiration and provided the logic for the EPC-QR-Code implementation.
- The ZUGFeRD e-invoicing implementation was contributed by Michael Fuchs (theexiile1305).
License
MIT