Attestwire › Rule reference › BR-CL-01

BR-CL-01 The document type code must be a UNTDID 1001 invoice or credit note code

noun · EN 16931 · fatal · BT-3

For a sample invoice, the library reports: The document type code (BT-3) must be a code from the invoice-related or the credit-note-related subset of UNTDID 1001, but "999" is in neither.

Business term
BT-3
Severity
fatal

The fix

Use "380" for an ordinary commercial invoice and "381" for an ordinary credit note. Other codes you are likely to want: "326" partial invoice, "384" corrected invoice, "389" self-billed invoice, "875"/"876"/"877" construction invoices, "261" self-billed credit note. Under XRechnung the list narrows sharply — BR-DE-17 admits only 326, 380, 381, 384, 389, 875, 876 and 877.

A passing value

the shape this field expects
"invoiceTypeCode": "380"

What the library returns

The full error returned by @attestwire/en16931. It includes the rule ID, affected field and suggested correction. Developers can use this object in their application:

TeachingError
{
  "rule": "BR-CL-01",
  "field": "BT-3",
  "severity": "fatal",
  "message": "The document type code (BT-3) must be a code from the invoice-related or the credit-note-related subset of UNTDID 1001, but \"999\" is in neither. The two lists decide which document you get: an invoice code emits a ubl:Invoice carrying cbc:InvoiceTypeCode (50 codes, beginning \"71\", \"80\", \"81\", \"82\", \"84\", \"102\"), a credit-note code emits a ubl:CreditNote carrying cbc:CreditNoteTypeCode (13 codes: \"81\", \"83\", \"261\", \"262\", \"296\", \"308\", \"381\", \"396\", \"420\", \"458\", \"502\", \"503\", \"532\"). In CII both live on one ram:TypeCode and the schematron tests the union of the two lists.",
  "fix": "Use \"380\" for an ordinary commercial invoice and \"381\" for an ordinary credit note. Other codes you are likely to want: \"326\" partial invoice, \"384\" corrected invoice, \"389\" self-billed invoice, \"875\"/\"876\"/\"877\" construction invoices, \"261\" self-billed credit note. Under XRechnung the list narrows sharply — BR-DE-17 admits only 326, 380, 381, 384, 389, 875, 876 and 877.",
  "example": "\"invoiceTypeCode\": \"380\"",
  "xpath": "/ubl:Invoice/cbc:InvoiceTypeCode",
  "docsUrl": "https://attestwire.com/rules/BR-CL-01"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.