BR-KSA-05: Invoice type code must be 388, 383, 381 or 386

Explained by Matheel from ZATCA's rule text and the condition SDK 3.4.8 executes · Updated

Error: the invoice is rejectedAll invoicesFields: BT-3

cbc:InvoiceTypeCode (BT-3) must be a single value from the KSA subset of UN/CEFACT 1001. The executed check accepts 388 (tax invoice), 383 (debit note), 381 (credit note) and 386 (prepayment invoice); the listed test text omits 386.

How to fix it

Use one of these values with no spaces, e.g. <cbc:InvoiceTypeCode name="0100000">388</cbc:InvoiceTypeCode>.

ZATCA's official text

[BR-KSA-05]-The invoice type code (BT-3) must be equal to one of value from the subset of UN/CEFACT code list 1001, D.16B agreed for KSA electronic invoices. Please refer paragraph 11.2.1 of XML implementation Standards.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

not(not(contains(normalize-space(.), ' ')) and contains(' 388 383 381 386 ', concat(' ', normalize-space(.), ' ')))

Related rules

Validate your invoice against ZATCA's rules

Paste the XML and see every error and warning. It runs in your browser; the invoice goes nowhere.

Validate an invoice or try Matheel