Invoice type code in XRechnung (BT-3): 380, 381, 384, 389, 326 and the construction codes
Every e-invoice carries a code for the invoice type. Whether it is an ordinary invoice, a credit note, a correction or a partial invoice determines how the recipient books the file. This page shows which codes XRechnung expects, where they are in the XML and which validation messages belong to them.
The allowed codes
The codes come from the list UNTDID 1001. XRechnung expects only these eight (BR-DE-17):
| Code | Name in the standard | Typical use |
|---|---|---|
380 | Commercial invoice | ordinary invoice |
381 | Credit note | credit note from the seller to the buyer, for example after a return or as a cancellation |
384 | Corrected invoice | corrected invoice that replaces an earlier invoice |
389 | Self-billed invoice | self-billing (Gutschriftverfahren): the buyer issues the statement |
326 | Partial invoice | partial or instalment invoice |
875 | Partial construction invoice | instalment invoice in construction |
876 | Partial final construction invoice | partial final invoice in construction |
877 | Final construction invoice | final invoice in construction |
BR-DE-17 is a warning. The KoSIT validation tool accepts a file with a different code (for example 386 for a prepayment invoice) all the same. Whether the recipient processes it depends on their software. If you want to be safe, stay with the eight codes.
Where the code is
In UBL there are two document types. The invoice (Invoice) carries the code in cbc:InvoiceTypeCode, the credit note (CreditNote) in cbc:CreditNoteTypeCode:
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" …>
…
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
<CreditNote xmlns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" …>
…
<cbc:CreditNoteTypeCode>381</cbc:CreditNoteTypeCode>
In CII (also in ZUGFeRD) there is only one document; the code is in rsm:ExchangedDocument/ram:TypeCode:
<rsm:ExchangedDocument>
<ram:ID>R-2026-0815</ram:ID>
<ram:TypeCode>381</ram:TypeCode>
…
Credit note is not the same as credit note: 381 and 389
In everyday use “credit note” usually means: the seller credits the customer with an amount, for example after a complaint. The code 381 is for that. The German VAT Act (UStG, Umsatzsteuergesetz) means something different by “Gutschrift”: the recipient of the service issues the statement themselves (§ 14 (2) sentence 2 UStG), for example a publisher towards its authors or a retailer towards suppliers. The code 389 is for that. Such a statement must contain the word “Gutschrift” (§ 14 (4) no. 10 UStG).
For the format this means:
- With
389the roles stay the same: the seller (BG-4) is still the one who provides the service, the buyer (BG-7) the one who creates the statement. Swapping the roles easily causes a wrong booking at the recipient. - With
381the amounts are positive. The code says that money flows back. Negative amounts in a381reverse the direction a second time.
Which of the two kinds applies in your case for tax purposes is not a question of format. Clarify it with your tax adviser.
Corrected invoice (384) with a reference to the original invoice
A corrected invoice should name the invoice it corrects: in group BG-3 with the invoice number (BT-25) and preferably the date (BT-26). If the reference is missing, the validator reports BR-DE-26 as a warning. Without a reference the recipient often cannot assign the correction.
UBL:
<cac:BillingReference>
<cac:InvoiceDocumentReference>
<cbc:ID>R-2026-0815</cbc:ID>
<cbc:IssueDate>2026-09-30</cbc:IssueDate>
</cac:InvoiceDocumentReference>
</cac:BillingReference>
CII (in ram:ApplicableHeaderTradeSettlement):
<ram:InvoiceReferencedDocument>
<ram:IssuerAssignedID>R-2026-0815</ram:IssuerAssignedID>
<ram:FormattedIssueDateTime>
<qdt:DateTimeString format="102">20260930</qdt:DateTimeString>
</ram:FormattedIssueDateTime>
</ram:InvoiceReferencedDocument>
For a credit note (381) or a cancellation too, this reference helps the recipient, even if no rule requires it.
Partial invoices and construction codes
Mark instalment and partial invoices with 326. For construction services there have been dedicated codes since XRechnung 3.0: 875 for instalment invoices, 876 for partial final invoices and 877 for the final invoice. If instalments already paid are deducted as a prepaid amount (BT-113), the amount due (BT-115) must add up exactly (BR-CO-16, see Rounding, discounts and Skonto). How the VAT of the instalments is shown in the final invoice is a tax question; clarify it with your tax adviser and agree the presentation with the recipient.
Common errors
- Credit note as
380with negative amounts: often formally valid, but booked at the recipient as an invoice with a negative amount. If possible use381and agree with the recipient what their software expects. - UBL credit note as
Invoicewith381: many recipients expect the documentCreditNotefor381in UBL. If in doubt, use that. - Code as text: “Rechnung” or “Invoice” instead of the number leads to an error against the code list (BR-CL-01) or to the warning BR-DE-17.
Whether your file carries the right code and has the reference to the original invoice is shown by the free validator. The check runs in your browser, the invoice is not uploaded.
Technical notes on the data format, not tax or legal advice. Whether VAT rate, supply and amounts are correct in substance is a question for your tax adviser. eRechio is not an offering of KoSIT.