BR-KSA-06 📑 Invoice Types & Structure error

BR-KSA-06: Invalid Invoice Transaction Subtype Code (NNPNESB / KSA-2)

BR-KSA-06: كود المعاملة الفرعية للفاتورة غير صحيح (NNPNESB / KSA-2)

Official ZATCA Specification:

The invoice transaction code (KSA-2) must exist and respect NNPNESB structure: NN (pos 1-2) = 01 (Tax Invoice) or 02 (Simplified), P (pos 3) = Third Party (0/1), N (pos 4) = Nominal (0/1), E (pos 5) = Export (0/1), S (pos 6) = Summary (0/1), B (pos 7) = Self-billed (0/1).

XPath Context: /ubl:Invoice/cbc:InvoiceTypeCode/@name

📌 Overview & Impact

The invoice transaction code (KSA-2) must exist in @name attribute of InvoiceTypeCode and respect the 7-digit NNPNESB structure.

الوصف بالعربية: كود المعاملة (KSA-2) في خاصية name يجب أن يتكون من 7 خانات وفق هيكلية NNPNESB المعتمدة من زاتكا.

⚠️ Common Causes for Rejection

  • Missing @name attribute on <cbc:InvoiceTypeCode>
  • Name attribute string length is not exactly 7 characters
  • Using characters other than '0' and '1' in positions 3 to 7
  • Setting invalid positions (e.g. Export '1' on Simplified invoice '02')

How to Fix & Resolve

1

Construct 7-Character Subtype

For Standard B2B Invoice: '0100000'. For Simplified B2C Invoice: '0200000'. For Standard Export Invoice: '0100100'.

2

Validate Export Flags

Ensure Export (pos 5) is only set on Standard Tax Invoices (01), not on Simplified (02).

💻 Code Comparison: Invalid vs Compliant UBL 2.1 XML

❌ Invalid XML (Rejected by ZATCA) Invalid Payload
<cbc:InvoiceTypeCode name="01">388</cbc:InvoiceTypeCode>
✓ Valid XML (Compliant UBL 2.1) Valid Payload
<cbc:InvoiceTypeCode name="0100000">388</cbc:InvoiceTypeCode>

Verify Your Invoice XML Online

Use Qeemah's free developer tools to inspect transforms, C14N digests, and Phase 2 QR codes.

Frequently Asked Questions

What is the transaction code for a standard B2B invoice?

For a standard domestic B2B tax invoice with no special transaction flags, the transaction code is '0100000'.

Stop Fighting Cryptic ZATCA XML Errors

Qeemah handles Phase 2 e-invoicing, cryptographic signing, and real-time clearance automatically. Integrate in minutes.