Skip to main content

Invoices and CSV export

E-invoices, ZUGFeRD, XML, routing ID, BT-13, BT-19, girocode and other special features

Written by Patric

🚨 In this article, you’ll find all the details about e-invoices / XRechnung and ZUGFeRD! 🚨


As soon as an order is in production, it can be invoiced. Whatever the product’s status, you always start invoicing with the post-calculation.
​
Under Accounting/Invoicing you can search directly for orders, products or keywords and create the post-calculation.


Invoices can be marked as paid either manually in the user interface or automatically via the API.

For example, your accounting system can pass payment information directly to Keyline and update invoices automatically.

You can find more information in our Knowledgebase article on the API.


Invoices are sent to the general email address. If an additional contact person is specified, the invoice is sent directly to that contact, with a copy to the general email address. You can store the address under “Organizations”.

Under Accounting/Outgoing Invoices you’ll find all invoiced documents and can also perform a CSV export for your accounting.
Keyline always exports all the currently filtered records.
So you can filter by time period or, for example, customer and export your selected records.

If you want to choose a completely custom date, you can also adjust it manually in the URL at the top.
​

You can create invoices in Keyline at any time, even without an order. Simply click Accounting/Outgoing Invoices and create an invoice or credit note.

All data, parameters and invoice line items with descriptions and booking categories can be entered manually.

All invoices from Keyline comply with the XRechnung or ZUGFeRD standard.
You can download the XML directly from the user interface, or the PDF, which also contains the embedded XML.
To enable XML generation, you need to store some details in the admin area such as your VAT ID, managing director, etc.

You can also retrieve the XML via the API:
​

https://app.keyline-mis.com/api/v2/accounting/customer_invoices/{invoice_ID}

Header:

Accept application/xml
​
​The complete recipient address is part of the XML. Make sure you store the correct billing address. Only one reference is supported per product and per order. Keyline includes the first reference in each case in the XML.
​


Remove the girocode from invoices

By default, the girocode is automatically displayed on invoices.

If you don’t want to display the girocode, you can easily remove it from the document template you use:

👉 Open the invoice document template and delete the following code block.

 {% if invoice.has_bank_account? %}
<table>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td colspan="2"><strong>GiroCode</strong> - Zahlen via Banking-App</td>
</tr>
<tr>
<td rowspan="2">
{{ invoice | girocode_tag: 4 }}
</td>
<td>
<strong>Konto / Zahlbar an</strong><br>
{{ invoice.business_unit_name }}
<br>
{{ invoice.bank_name }}
<br>
{{ invoice.iban }}
<br><br>
<strong>Referenz</strong><br>
{{ invoice.number }}
</td>
</tr>
<tr>
<td>

</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<strong>Betrag:</strong>
{{ invoice.gross_total }}
<br>
<strong>Währung:</strong>
{{ invoice.currency }}
</td>
</tr>
</table>
</td>
<td></td>
</tr>
</table>
{% endif %}

After saving, the girocode will no longer appear on newly generated invoices.


🚨 Special notes for e-invoices / ZUGFeRD:

For each organization, you can store the electronic invoice address.
This field is also referred to as BT-10 or routing ID (Leitweg-ID).


You can add references at order level, which are then included in the XML automatically:

You can also enter the references directly on the invoice if you wish.

BuyerReference: is populated in the following order of priority:

  1. If a routing ID (Leitweg-ID) (electronic invoice address on the organization) is available → this is used

  2. If not, the first entry from custom_references is used

  3. If that is also missing, the customer number is used



​

BT-13 – Purchase Order Reference (order number)

  • Definition: This field contains the purchase order number assigned by the buyer.

  • Usage: It clearly links the invoice to a previous purchase order or order. It appears under IssuerAssignedID.

  • Required field: If the customer supplies a purchase order number when placing the order, it must be included in the e-invoice in field BT-13.

  • In the PDF, the reference appears as “Purchase order number”.


BT-19 – Buyer Accounting Reference

  • Definition: This field specifies how the invoice should be recorded in the buyer’s financial accounts.

  • Usage: It allows the buyer to allocate the invoice correctly internally, for example to a cost center or project. It appears under ReceivableSpecifiedTradeAccountingAccount.

  • Required field: BT-19 is optional and is used when the buyer supplies specific accounting information.

  • In the PDF, the reference appears as “Accounting reference”.


✅ Valid examples:

  • key = "BT13" # no hyphen, number 13

  • key = "BT-13" # with hyphen, number 13

  • key = "bt13" # lowercase, allowed by `i` (case-insensitive)

  • key = "Bt-13" # mixed case

  • key = "BT19" # no hyphen, number 19

  • key = "bt-19" # with hyphen, lowercase

  • key = "Bt19" # mixed case, no hyphen

  • key = "BT-19" # standard format

❌ Invalid examples

  • key = "BT-20" # 20 is not allowed

  • key = "BT1319" # a combination rather than an exact number

  • key = "XBT-13" # does not start exactly with BT

  • key = "13BT" # incorrect order

  • key = "BT-13abc" # does not end immediately after the number

  • key = " BT-13" # leading space

  • key = "BT--13" # double hyphen


We validate our XML files using several publicly accessible portals officially provided by Germany’s federal government and individual federal states.

As the overall system is still in its introductory phase, many different XML versions and profiles are currently in circulation.

We always use the latest available version or work to bring it up to date promptly. You can find our current profile version in the XML under <GuidelineSpecifiedDocumentContextParameter>
​
You can find XML validation portals here, for example:
​
​https://erechnungs-validator.de
​https://www.portinvoice.com
​https://erechnungsvalidator.service-bw.de


Here you’ll find a PDF file with a detailed description of the individual fields. Feel free to share it with your accountant so they can define the import.

Did this answer your question?