To make integrating the Aloaha ZUGFeRD SDK easier, we provide sample code in VB.NET and VB6. Most of the samples are documented in German; the code itself is the same in every language.
For Delphi (from version 5) and for VB6, VB5 and VBA there are dedicated guides: Creating ZUGFeRD and XRechnung with Delphi and Creating ZUGFeRD and XRechnung with VB6, VB5 and VBA; for Visual FoxPro 9: Creating ZUGFeRD and XRechnung with Visual FoxPro.
If you have suggestions for further samples, please do not hesitate to send them to us at info@aloaha.com.
Please make sure to read this article: Creating a ZUGFeRD/XRechnung XML file (German).
Where to start
- Quick start: create a ZUGFeRD invoice in VB.NET and embed it in PDF/A-3
- Sample code for XRechnung with the Aloaha ZUGFeRD SDK – a larger example with allowances and two VAT rates (German)
- Creating a ZUGFeRD/XRechnung XML file via the COM interface (VB6/VBA) or .NET – early binding (German)
- The same with late binding (German)
- Reading line items from a ZUGFeRD invoice or XRechnung (German)
- Creating e-invoices via CSV and zugcmd from your own application – without programming against the SDK
Samples by topic
| Topic | Articles |
|---|---|
| Invoice lines | Adding invoice lines with AddProduct_Comfort, buyer's article number per line (BT-156, BT-155) |
| Totals, allowances and charges | WriteTotals, AddTradeAllowanceCharge (BG-20, BG-21) |
| Payment terms | Cash discount and default interest (BT-20) |
| Free texts | Invoice-relevant free texts – IncludedNote (BG-1, BT-21, BT-22) |
| VAT special cases | Margin scheme under § 25a UStG |
| CSV import and export | Importing CSV files into an XRechnung, converting ZUGFeRD invoices to CSV |
| Word and PDF output | Converting ZUGFeRD XML to Word (DOCX), converting XRechnung XML directly into a Word file or ZUGFeRD PDF |
All articles listed above are in German.
Code categories
- All sample code
- VB.NET – e.g. CreateInvoice, WriteSeller, WriteBuyer, AddTradeTax, MergeXMLIntoPDF, CreateDocFromXML, ImportCSV, ZUGFeRD_Structure
- VB6 – e.g. early binding, late binding, registration, SaveXML, LastError
- Web services – e.g. MergeXMLIntoPDF, CreateDOCXFromXML
- Further topics: KoSIT, Leitweg-ID, cash discount, unitCode, TradeAllowanceCharge, WriteTotals
The complete method reference is in the API reference, and every EN 16931 business term is explained in the BT/BG explorer.
Frequently asked questions
In which languages is sample code available?
Mainly in VB.NET and VB6/VBA; the same methods work in C# and other COM-capable languages. There are dedicated guides for Delphi and for VB6, VB5 and VBA.
Where do I start if I want to create my first ZUGFeRD invoice?
With the quick start for VB.NET: it shows the complete path from creating the object to the finished PDF/A-3 with embedded XML. A larger example with allowances and two VAT rates is the sample code for XRechnung.
Can I create e-invoices without programming against the SDK?
Yes. With the command-line tool zugcmd you create ZUGFeRD and XRechnung invoices from CSV files and start it from any application, batch file or script.