django-xrechnung¶
Send an invoice that a German authority or business system will actually accept — and keep the proof that it did.
XRechnung is unforgiving, and that is the whole difficulty. A missing buyer reference, a rounding difference of a single cent, a VAT category that disagrees with its rate: any one of them and the invoice comes back. So this package does not ask you to be careful. It puts the official KoSIT validator in front of every document you issue, and an invoice is either accepted or it is still a draft. There is no third state, and nothing half-issued can be stored.
python -m pip install django-xrechnung
Your invoices stay yours. The validator runs where you put it — by default a process on the same host — against rules pinned to a known version. No invoice data is sent to any third-party service.
Ready to try it? The tutorial takes you from an empty project to a validated XML file and a PDF you can open — both of them real documents you could actually send.
Choose your path¶
New here? Issue your first invoice end to end and watch the validator accept it. Two things to install first, and the guide walks you through both.
You know what you need. Install the validator, pick an output format, get the VAT right, receive documents, retire them when the time comes.
Every setting, model field, service and endpoint — and an honest list of exactly which invoices are supported today.
Why an invoice becomes immutable the moment it is issued, and what that buys you when someone asks about it three years later.
What you can do with it¶
Issue invoices that pass. XRechnung 3.0.2 invoices, credit notes and corrected invoices, as UBL or CII, each one checked by the pinned KoSIT validator before a single byte is stored.
Hand people a PDF, not a puzzle. Factur-X gives you one PDF/A-3b that a person can read and a machine can parse, with the CII invoice tucked inside it and veraPDF confirming the file is conformant.
Receive as well as send. Documents you are sent are admitted immutably, inspected under strict resource limits, validated and parsed into read-only snapshots — so a hostile PDF is a bounded subprocess, not your afternoon.
Answer questions years later. Every issued document records the validator version, the rules it was judged by, and the hashes of what was produced. When someone asks whether an invoice was valid, you do not have to remember.
The part that surprises people is the immutability: once an invoice is finalized, its XML, PDF and validation report cannot be edited or deleted through the application, and that is deliberate. Why invoices have a finalization step explains what follows from it, and why you will probably come to like it.
Where the project stands¶
The project is beta. This documentation describes version 0.5.0. Have a look at Supported invoices before you build on a scenario it does not cover yet, and Compatibility and release policy for what the version number promises. Questions, bug reports and patches are all welcome on Codeberg — the supported set is deliberately narrow, and it grows where people need it to.