XRechnung and ZUGFeRD invoices in one API call
Generate German e-invoices from JSON, check incoming ones against the official KoSIT rules, and read them back as JSON. REST or MCP, with no Java validator to host.
$0.02/call · 10 free calls a day, no signup · REST and MCP
curl https://api.kanagu.dev/v1/einvoice/validate \
-H "Content-Type: application/json" \
-d '{"xml":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0417</cbc:ID>\n <cbc:IssueDate>2026-11-23</cbc:IssueDate><cbc:DueDate>2026-12-23</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>\n <cac:AccountingSupplierParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">billing@example.com</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Lindenstraße 12</cbc:StreetName><cbc:CityName>Berlin</cbc:CityName><cbc:PostalZone>10117</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme><cbc:CompanyID>DE123456789</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>\n <cac:PartyLegalEntity><cbc:RegistrationName>Linden Consulting GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n <cac:Contact><cbc:Name>Kai Weber</cbc:Name><cbc:Telephone>+49 30 5550100</cbc:Telephone><cbc:ElectronicMail>kai@example.com</cbc:ElectronicMail></cac:Contact>\n </cac:Party></cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">invoices@example.org</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Hafenstraße 8</cbc:StreetName><cbc:CityName>Hamburg</cbc:CityName><cbc:PostalZone>20457</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n \n <cac:PartyLegalEntity><cbc:RegistrationName>Nordhafen Verwaltungs GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n \n </cac:Party></cac:AccountingCustomerParty>\n <cac:Delivery><cbc:ActualDeliveryDate>2026-11-20</cbc:ActualDeliveryDate></cac:Delivery>\n <cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans>\n <cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount>\n <cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">950.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">950.00</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"EUR\">1130.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1130.50</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine><cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount>\n <cac:Item><cbc:Name>Software integration workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item>\n <cac:Price><cbc:PriceAmount currencyID=\"EUR\">475.00</cbc:PriceAmount>\n \n \n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>"}'const res = await fetch("https://api.kanagu.dev/v1/einvoice/validate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KANAGU_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0417</cbc:ID>\n <cbc:IssueDate>2026-11-23</cbc:IssueDate><cbc:DueDate>2026-12-23</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>\n <cac:AccountingSupplierParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">billing@example.com</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Lindenstraße 12</cbc:StreetName><cbc:CityName>Berlin</cbc:CityName><cbc:PostalZone>10117</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme><cbc:CompanyID>DE123456789</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>\n <cac:PartyLegalEntity><cbc:RegistrationName>Linden Consulting GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n <cac:Contact><cbc:Name>Kai Weber</cbc:Name><cbc:Telephone>+49 30 5550100</cbc:Telephone><cbc:ElectronicMail>kai@example.com</cbc:ElectronicMail></cac:Contact>\n </cac:Party></cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">invoices@example.org</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Hafenstraße 8</cbc:StreetName><cbc:CityName>Hamburg</cbc:CityName><cbc:PostalZone>20457</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n \n <cac:PartyLegalEntity><cbc:RegistrationName>Nordhafen Verwaltungs GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n \n </cac:Party></cac:AccountingCustomerParty>\n <cac:Delivery><cbc:ActualDeliveryDate>2026-11-20</cbc:ActualDeliveryDate></cac:Delivery>\n <cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans>\n <cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount>\n <cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">950.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">950.00</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"EUR\">1130.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1130.50</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine><cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount>\n <cac:Item><cbc:Name>Software integration workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item>\n <cac:Price><cbc:PriceAmount currencyID=\"EUR\">475.00</cbc:PriceAmount>\n \n \n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "einvoice.validate",
"arguments": {
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0417</cbc:ID>\n <cbc:IssueDate>2026-11-23</cbc:IssueDate><cbc:DueDate>2026-12-23</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>\n <cac:AccountingSupplierParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">billing@example.com</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Lindenstraße 12</cbc:StreetName><cbc:CityName>Berlin</cbc:CityName><cbc:PostalZone>10117</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme><cbc:CompanyID>DE123456789</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>\n <cac:PartyLegalEntity><cbc:RegistrationName>Linden Consulting GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n <cac:Contact><cbc:Name>Kai Weber</cbc:Name><cbc:Telephone>+49 30 5550100</cbc:Telephone><cbc:ElectronicMail>kai@example.com</cbc:ElectronicMail></cac:Contact>\n </cac:Party></cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">invoices@example.org</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Hafenstraße 8</cbc:StreetName><cbc:CityName>Hamburg</cbc:CityName><cbc:PostalZone>20457</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n \n <cac:PartyLegalEntity><cbc:RegistrationName>Nordhafen Verwaltungs GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n \n </cac:Party></cac:AccountingCustomerParty>\n <cac:Delivery><cbc:ActualDeliveryDate>2026-11-20</cbc:ActualDeliveryDate></cac:Delivery>\n <cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans>\n <cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount>\n <cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">950.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">950.00</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"EUR\">1130.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1130.50</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine><cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount>\n <cac:Item><cbc:Name>Software integration workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item>\n <cac:Price><cbc:PriceAmount currencyID=\"EUR\">475.00</cbc:PriceAmount>\n \n \n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>"
}
}
}Why
What it solves
From 2027 German businesses must issue structured e-invoices for domestic B2B sales, and every business must already be able to receive them. The reference validator is a Java application with a versioned rule configuration you would have to host, update and wrap. Kanagu runs it for you and adds generation and parsing on top.
Built for
- Billing and ERP developers who must issue e-invoices to German B2B customers
- Accounts-payable tools that receive XRechnung or ZUGFeRD and need the data as JSON
- AI agents that draft invoices and must check them before they are sent
Example
What goes in, what comes out
In: Invoice data as JSON, or invoice XML or a ZUGFeRD / Factur-X PDF. Out: XRechnung UBL or CII XML, a ZUGFeRD PDF/A-3, the KoSIT report, or parsed JSON.
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" …>
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>
<cbc:ID>2026-0417</cbc:ID>
<cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>
…
</Invoice>{
"valid": true,
"validator": "KoSIT 1.6.3 / XRechnung 3.0.2 (2026-08-31)",
"issues": []
}Remove the BuyerReference element and the same call returns BR-DE-15 on BT-10.
Try it
Run it on the live API
The sample is a valid XRechnung. Delete the BuyerReference element and run it again to see BR-DE-15 on BT-10.
Reference
Operations
| Operation | Price |
|---|---|
| einvoice.generate Generate a KoSIT-validated XRechnung UBL or CII invoice, or a ZUGFeRD PDF/A-3. | $0.02/call |
| einvoice.parse Extract invoice parties, references, dates, amounts, and lines from XML or hybrid PDF. | $0.02/call |
| einvoice.validate Validate an invoice XML or a hybrid invoice PDF's XML against KoSIT rules. | $0.02/call |
curl https://api.kanagu.dev/v1/einvoice/validate \
-H "Authorization: Bearer $KANAGU_KEY" \
-H "Content-Type: application/json" \
-d '{"xml":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0417</cbc:ID>\n <cbc:IssueDate>2026-11-23</cbc:IssueDate><cbc:DueDate>2026-12-23</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>\n <cac:AccountingSupplierParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">billing@example.com</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Lindenstraße 12</cbc:StreetName><cbc:CityName>Berlin</cbc:CityName><cbc:PostalZone>10117</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme><cbc:CompanyID>DE123456789</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>\n <cac:PartyLegalEntity><cbc:RegistrationName>Linden Consulting GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n <cac:Contact><cbc:Name>Kai Weber</cbc:Name><cbc:Telephone>+49 30 5550100</cbc:Telephone><cbc:ElectronicMail>kai@example.com</cbc:ElectronicMail></cac:Contact>\n </cac:Party></cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">invoices@example.org</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Hafenstraße 8</cbc:StreetName><cbc:CityName>Hamburg</cbc:CityName><cbc:PostalZone>20457</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n \n <cac:PartyLegalEntity><cbc:RegistrationName>Nordhafen Verwaltungs GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n \n </cac:Party></cac:AccountingCustomerParty>\n <cac:Delivery><cbc:ActualDeliveryDate>2026-11-20</cbc:ActualDeliveryDate></cac:Delivery>\n <cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans>\n <cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount>\n <cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">950.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">950.00</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"EUR\">1130.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1130.50</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine><cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount>\n <cac:Item><cbc:Name>Software integration workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item>\n <cac:Price><cbc:PriceAmount currencyID=\"EUR\">475.00</cbc:PriceAmount>\n \n \n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>"}'const res = await fetch("https://api.kanagu.dev/v1/einvoice/validate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KANAGU_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0417</cbc:ID>\n <cbc:IssueDate>2026-11-23</cbc:IssueDate><cbc:DueDate>2026-12-23</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>\n <cac:AccountingSupplierParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">billing@example.com</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Lindenstraße 12</cbc:StreetName><cbc:CityName>Berlin</cbc:CityName><cbc:PostalZone>10117</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme><cbc:CompanyID>DE123456789</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>\n <cac:PartyLegalEntity><cbc:RegistrationName>Linden Consulting GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n <cac:Contact><cbc:Name>Kai Weber</cbc:Name><cbc:Telephone>+49 30 5550100</cbc:Telephone><cbc:ElectronicMail>kai@example.com</cbc:ElectronicMail></cac:Contact>\n </cac:Party></cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">invoices@example.org</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Hafenstraße 8</cbc:StreetName><cbc:CityName>Hamburg</cbc:CityName><cbc:PostalZone>20457</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n \n <cac:PartyLegalEntity><cbc:RegistrationName>Nordhafen Verwaltungs GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n \n </cac:Party></cac:AccountingCustomerParty>\n <cac:Delivery><cbc:ActualDeliveryDate>2026-11-20</cbc:ActualDeliveryDate></cac:Delivery>\n <cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans>\n <cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount>\n <cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">950.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">950.00</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"EUR\">1130.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1130.50</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine><cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount>\n <cac:Item><cbc:Name>Software integration workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item>\n <cac:Price><cbc:PriceAmount currencyID=\"EUR\">475.00</cbc:PriceAmount>\n \n \n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();claude mcp add --transport http kanagu https://api.kanagu.dev/mcp \
--header "Authorization: Bearer $KANAGU_KEY"{
"mcpServers": {
"kanagu": {
"url": "https://api.kanagu.dev/mcp",
"headers": {
"Authorization": "Bearer ${env:KANAGU_KEY}"
}
}
}
}{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "einvoice.validate",
"arguments": {
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0417</cbc:ID>\n <cbc:IssueDate>2026-11-23</cbc:IssueDate><cbc:DueDate>2026-12-23</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>90000000-03083-72</cbc:BuyerReference>\n <cac:AccountingSupplierParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">billing@example.com</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Lindenstraße 12</cbc:StreetName><cbc:CityName>Berlin</cbc:CityName><cbc:PostalZone>10117</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme><cbc:CompanyID>DE123456789</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>\n <cac:PartyLegalEntity><cbc:RegistrationName>Linden Consulting GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n <cac:Contact><cbc:Name>Kai Weber</cbc:Name><cbc:Telephone>+49 30 5550100</cbc:Telephone><cbc:ElectronicMail>kai@example.com</cbc:ElectronicMail></cac:Contact>\n </cac:Party></cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty><cac:Party>\n <cbc:EndpointID schemeID=\"EM\">invoices@example.org</cbc:EndpointID>\n <cac:PostalAddress><cbc:StreetName>Hafenstraße 8</cbc:StreetName><cbc:CityName>Hamburg</cbc:CityName><cbc:PostalZone>20457</cbc:PostalZone>\n <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>\n </cac:PostalAddress>\n \n <cac:PartyLegalEntity><cbc:RegistrationName>Nordhafen Verwaltungs GmbH</cbc:RegistrationName></cac:PartyLegalEntity>\n \n </cac:Party></cac:AccountingCustomerParty>\n <cac:Delivery><cbc:ActualDeliveryDate>2026-11-20</cbc:ActualDeliveryDate></cac:Delivery>\n <cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans>\n <cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount>\n <cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">950.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">180.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">950.00</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"EUR\">1130.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1130.50</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine><cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"EUR\">950.00</cbc:LineExtensionAmount>\n <cac:Item><cbc:Name>Software integration workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item>\n <cac:Price><cbc:PriceAmount currencyID=\"EUR\">475.00</cbc:PriceAmount>\n \n \n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>"
}
}
}Every field, error and schema is in the einvoice.validate reference.
Coverage
Limits and coverage
- Formats
- XRechnung 3.0 as UBL or CII; ZUGFeRD PDF/A-3 with embedded CII. Validate and parse also accept Factur-X and ZUGFeRD PDFs.
- Validator
- KoSIT 1.6.3 / XRechnung 3.0.2 (2026-08-31), the official configuration
- Size
- XML up to 1 MiB; XML or PDF up to 4 MiB as Base64
- Not covered
- Sending over Peppol, Italy's SdI, France's PDP platforms
- Data
- Inputs are processed in memory. For keyed calls the JSON result is kept for 30 days so a retry with the same Idempotency-Key returns it, then deleted. Trial calls store only a daily counter.
The German mandate
1 January 2025
Every German business must be able to receive e-invoices.
1 January 2027
Businesses must issue e-invoices. Those with 2026 turnover of at most €800,000 may send other invoices until the end of 2027.
1 January 2028
Every German business must issue e-invoices for domestic B2B sales.
Source: Finanzamt München, E-Rechnung (§ 27 Abs. 38 UStG). Small amounts up to €250, small businesses under § 19 UStG and B2C sales are exempt.
Fields of each failed rule
ruleId- The KoSIT rule that failed, e.g. BR-DE-15.
severity- The level KoSIT reports, e.g. error or warning.
xpath- Where in the invoice XML the rule fired.
field- The EN 16931 business term the rule names, e.g. BT-10 (buyer reference), or the XML element when the rule names none.
message- KoSIT's original rule text. German rules (BR-DE-…) are in German.
fixHint- The rule's requirement without its ID prefix, to show next to the field.
Compare
Compared with the usual approaches
Ways teams usually handle German e-invoices:
| Approach | What you take on |
|---|---|
| Host the KoSIT validator yourself | Run a Java service, track configuration releases, map its report to your fields, and write generation and parsing separately. |
| Fill in an XML template | Maintain EN 16931 and XRechnung rules in your own code and find out about rule failures from your customers. |
| Kanagu | One POST per invoice. Generation, validation and parsing share the same rules and the official validator. |
Pricing
$0.02/call, billed only on success
- einvoice.generate$0.02 / call
- einvoice.parse$0.02 / call
- einvoice.validate$0.02 / call
$1 of usage free every month after sign-in. Then pay as you go with no monthly fee, or the $9/month Bundle with $9 of usage included, shared across every Kanagu product. Compare plans
Sign in, create a key and use $1 of calls free each month, no card needed. Subscribe from your dashboard when you need more. Polar is the merchant of record and handles payment, tax and invoices.
FAQ
E-invoicing questions
- Which validator decides if an invoice is valid?
- The KoSIT validator, KoSIT 1.6.3 / XRechnung 3.0.2 (2026-08-31). Kanagu returns its verdict and each failed rule unchanged, with a short fix hint.
- Can I create a ZUGFeRD PDF?
- Yes. Set format to zugferd on einvoice.generate to get a Base64 PDF/A-3 with the CII invoice embedded, under the XRECHNUNG profile, along with the XML.
- Do you send invoices to my customers?
- No. Kanagu creates, checks and reads invoices. Delivery over email or Peppol stays with you.
- Are German rule messages translated?
- No. The message field carries KoSIT's original text; German rules such as BR-DE-15 are in German. fixHint gives the requirement without the rule ID.
More APIs with the same key
- France e-reportingDGFiP Flux 10 e-reporting XML for B2C sales, cross-border B2B and service receipts, checked against v3.2.
- Bank statementsTurn Chase, Wells Fargo and Barclays PDF statements into reconciled transactions.
- OTA payoutsMatch Airbnb, Booking.com and Vrbo payouts to the deposits on your bank statement.
- Rent rollsReconcile a multifamily rent roll against its T12: occupancy, loss to lease, vacancy and rent collected.
- Pay applicationsCheck AIA G702 and G703 pay applications line by line, against the last certified one and approved change orders.
- VAT validationCheck EU and UK VAT numbers against VIES and HMRC, with audit evidence.
- Packaging EPRPackaging weights by US state EPR category and Germany LUCID reports, traced to each SKU.
- CPSC eFilingCheck CPC and GCC certificates against each CBP entry line and get the PGA fields to file.
- PFAS reportingDecide Minnesota and Maine PFAS-in-products reporting and get the PRISM rows, MDA statements and deadlines.
- Demurrage auditAudit FMC demurrage and detention invoices against 46 CFR 541, recalculate each day and draft the dispute.
- UK CARFHMRC cryptoasset reports as OECD CARF XML, checked against HMRC's file rules and TIN check digits.
- EU PPWREU packaging regulation checks for heavy metals, PFAS, recycled content and empty space, with a draft declaration.
- SEC fundamentalsPoint-in-time SEC XBRL financials with every restatement, for backtests without look-ahead.
- Business daysBusiness-day math and SLA deadlines with public holidays in 207 countries.
- CSV validationCheck uploaded CSV files against a column schema before you import them.
- Email parsingParse raw .eml messages into headers, bodies, attachments and thread IDs.
- Screenshot diffCapture two web pages and get the changed pixels and regions.