CASOON Open Source
Deterministic PDFs from JSON and Typst.
Use structured JSON data and reusable Typst templates to generate standardized business PDFs. Fix the data, templates, fonts, assets, compiler version and build timestamp for reproducible output.
- document templates
- 21
- JSON schemas for structured input
- 15
- data and layout kept in versionable files
- JSON + Typst
Templates, not tax advice
The invoice and tax-case profiles are templates. They have not been reviewed by a tax adviser or accountant and may need adjusting to your situation and country. Have them checked before you issue real invoices. Only two cases are released; the others are drafts you must select explicitly. Company details, accounts and rates in the examples are fictional.
What you can use it for
Invoices
VAT or sales-tax invoices with calculated totals in seven languages, A4 or US Letter. The same data can also produce Factur-X, XRechnung and Peppol files.
Offers and accounting documents
Offers, credit notes, payment reminders, delivery notes, order confirmations, quotation requests, time sheets and business letters from JSON data.
Contracts and project documents
Concepts, contracts, documentation, proposals, meeting minutes, SLAs, specifications and task lists, written in Typst.
Guides, forms and brochures
Compact A4 guides, printable intake forms and checklists, and landscape brochures built from reusable components.
Access credentials
A confidential sheet per service, with optional masking of passwords. The source file still holds the original values.
AI-assisted editing
Connect an MCP-compatible assistant that checks, previews and compiles the document while you edit the inputs.
Which invoice cases are covered
Each case is a profile with its own prerequisites, notes and checks. You confirm the facts; the package does not decide which case applies to you.
| Case | Basis | State |
|---|---|---|
| Domestic sale, standard or reduced rate | § 12 UStG | Released |
| Small business (Kleinunternehmer) | § 19 UStG | Released |
| 0 % rate for photovoltaic systems | § 12 Abs. 3 UStG | Released |
| Tax-exempt supply | § 4 UStG | Released |
| Domestic reverse charge | § 13b UStG | Released |
| Goods to a business in another EU state | § 4 Nr. 1b, § 6a UStG | Released |
| Service to a business in another EU state (reverse charge) | § 3a, § 14a UStG | Released |
| Export to a non-EU country | § 4 Nr. 1a, § 6 UStG | Released |
| Consumer in another EU state (OSS) | § 18j UStG | Released |
| Small business selling in another EU state | § 19a UStG | Released |
| France: domestic sale between businesses | French VAT rules | Draft |
Released means a bounded case, not a tax opinion: a tax adviser or accountant has not reviewed these cases, so have them checked before you issue real invoices. A draft is a preview you opt into and have checked. Chain and triangular transactions, new vehicles and other schemes are not supported. Prerequisites for each case
Template package 0.3.0. Use the matching source release and documented compiler to rebuild the examples. Setup guide · What is supported
The templates and the compiler
business-templates: this repository
Reusable Typst layouts, JSON schemas, translations and editable examples. Your data and these templates define the document.
Explore the template package →typstgen: a separate project
The PDF builder, with the Typst compiler embedded. Use its CLI, Rust library or MCP server to compile your documents. Since 0.6.0 it also prepares configured invoices, calculates their totals and writes XRechnung/Peppol files.
Explore typstgen → · GitHub repositoryInstall it with cargo install typstgen --version 0.6.2 --locked; the setup guide has the remaining two steps.
What it does
One layout, standardized documents
Define the document in a reusable Typst template and load structured content and company data from JSON. Version the source files and repeat the same build for each document.
Invoice in the language your client reads
Choose from seven invoice languages, A4 or US Letter, and separate currency and number formats. Supply your own descriptions and notes; translated labels come from the package.
Keep invoice amounts consistent
Calculate line amounts and tax totals from the rates you configure, and check any totals you supply. VAT invoices use the same values for the PDF and for Factur-X, XRechnung and Peppol files; sales-tax invoices are rendered as PDF.
Guides, forms and project documents
Use 21 templates for business correspondence and project work. Assemble compact guides, printable intake forms and landscape brochures with reusable Typst components.
Fit document generation into your project
Keep JSON data and Typst sources in Git. Compile with the CLI or integrate through Rust. Add chartlet diagrams when your documents need them.
Let your AI assistant check the document it builds
Connect an MCP-compatible assistant to typstgen’s local Model Context Protocol server. The assistant edits your JSON or Typst files using its editor tools, then asks typstgen to check the source, show a page preview and write the PDF.
Check
Get compiler errors and warnings with file and line references.
Preview
Inspect a rendered page to spot table overflow and awkward page breaks.
Compile
Save the PDF using the same templates, data and fixed build inputs.
“Check the letter, show me the first page, then save the PDF with a fixed build timestamp.”
The model proposes edits; the Typst compiler renders the result. Review the data and preview before using the final document.
Set up MCP with these templates → · Watch typstgen’s MCP walkthroughSeven invoice languages, plus a US variant
All examples →Eight real invoice PDFs from one shared template, each with editable configuration, invoice data and a fictional SVG logo. Seven-language labels apply to invoices; other templates have their own language support. Tax rates and company details are illustrative, not national tax presets.
examples/invoice-languages/Guides, forms and other documents
All examples →Outputs from the example projects: compact publications, printable forms, landscape brochures, credentials, concepts and chartlet diagrams. Each entry includes its source and full PDF.
examples/Make an example your own
Start with a letter, project document or invoice in the showcase. Follow the setup guide to install typstgen and the template package. The command below rebuilds the invoice demos.
- Choose a PDF example and open its linked Typst source or JSON data.
- Replace the sample company details, logo and content. For invoices, also configure taxes, language and paper.
- Build with the CLI or ask your MCP-connected assistant to check, preview and compile. Keep the inputs and build settings with your project.
cargo install typstgen --version 0.6.2 --locked
git clone --branch templates-v0.3.0 https://github.com/casoon/typst-business-templates
cd typst-business-templates && ./scripts/install-package.sh
python3 examples/invoice-languages/build.pyNew in v0.3.0
Changelog →- Invoices: XRechnung 3.0 and Peppol BIS Billing 3.0 files (UBL 2.1) from the same invoice data via
typstgen e-invoice, checked against the canonical values and validated with Mustang 2.26.0. Details: E-invoice files. - Testing:
scripts/validate-einvoice.pyvalidates XRechnung and Peppol files on demand with the pinned KoSIT validator, the official XRechnung configuration and the Peppol BIS Billing 3.0.21 Schematron, including a control that must be rejected. Details: Official rule sets. - Invoices:
xrechnung-3.0andpeppol-bis-3.0are selectable outputs of the released DE profiles;validate-documentreports the fields each format needs before the file is written (typstgen 0.6.1). Details: E-invoice files. - Invoices: Draft profiles for the 0% rate on photovoltaic systems (
de-zero-rate-section-12-3), § 4 exemptions (de-exempt-section-4), domestic reverse charge (de-domestic-reverse-charge), EU B2C under the Union scheme (de-eu-b2c-oss) and EU small businesses (de-eu-small-business), with examples and CII/UBL validation where the structured file is supported. Details: Further drafts. - Invoices: Draft profiles
de-eu-goods-b2b(intra-Community supply, category K) andde-third-country-export(export, category G) with prerequisites, statutory notes, examples and CII/UBL validation;IntraCommunityandExportVAT codes,delivery_country_code,delivery_cityanddelivery_postal_codein the invoice schema (typstgen 0.6.2). Details: EU goods and export. - Invoices: Draft profile
de-eu-services-b2bfor German services to business customers in other EU member states (reverse charge, category AE), with prerequisites, statutory note check, CII/UBL validation and an example. Details: EU service profile.
Frequently asked questions
Is business-templates published on Typst Universe?
No. It is distributed as a source release tag (currently templates-v0.3.0) and installed locally as @local/business-templates; clone the tagged repository rather than fetching a package.
Do I need typstgen to use these templates?
Yes. This repository holds only the Typst package, JSON schemas and examples; typstgen is the separate project that provides the CLI, Rust library and MCP server with the Typst compiler embedded.
Have the invoice cases been reviewed by a tax adviser?
No. The profiles are templates built from the statutes and standards named in their sources; nobody has certified them for your situation. Released cases are bounded, drafts must be selected explicitly, and you confirm the facts. Have a tax adviser or accountant check them before you issue real invoices.
Can I send XRechnung or Peppol files with it?
It writes the files, and the tested examples pass the validators named in the documentation. Delivery over the Peppol network or to a portal, and your national obligations, are outside the package; validate your own files before sending them.
Are the example tax rates and company details usable as-is?
No. The businesses, accounts and tax rates in the language demos are fictional, and a language demo is not a reviewed national tax preset. Optional reviewed profiles exist separately for cases that need them.
What happened to the old docgen CLI and Rust crate?
They are discontinued. This repository is now the standalone Typst package, and client/project management, numbering and the former --encrypt option were not carried over. Historical tags keep their original meaning.
Can an AI assistant check and compile the documents for me?
Yes, through MCP. Connect an MCP-compatible assistant to typstgen’s local server so it can check the Typst source, inspect a page preview and compile the PDF while you edit the JSON or Typst inputs.













