Validate a ZATCA XML file for free · ZATCA error codes
ZATCA BR-KSA-17: credit/debit note reason (KSA-10)
BR-KSA-17 · Error
[BR-KSA-17]-Debit and credit note (invoice type code (BT-3) is equal to 383 or 381) must contain the reason (KSA-10) for this invoice type issuing.
The official rule: a debit or credit note (invoice type code (BT-3) equal to 383 or 381) must contain the reason (KSA-10) for issuing this invoice type.
Official context: /ubl:Invoice[cbc:InvoiceTypeCode = '381' or cbc:InvoiceTypeCode = '383']. The compiled SDK test requires at least one cac:PaymentMeans, and every PaymentMeans must contain cbc:InstructionNote (KSA-10). A missing payment-means block also fails the rule.
Common causes
- Type code 381 or 383 with no
PaymentMeansat all. PaymentMeansis present butInstructionNoteis missing or empty.- The reason was written only in a free-text note (BT-22) instead of KSA-10.
The snippet is a minimal illustration of the field the official test looks at, not advice on when to issue a credit or debit note. Valifakt is not a ZATCA-onboarded EGS.
<cbc:InvoiceTypeCode name="0100000">381</cbc:InvoiceTypeCode>
<cac:PaymentMeans>
<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>
<cbc:InstructionNote>Returned goods — credit note</cbc:InstructionNote>
</cac:PaymentMeans>Which type codes trigger this?
The official text: 383 (debit note) and 381 (credit note).
Where is KSA-10?
In the compiled SDK XSL it is cbc:InstructionNote under each cac:PaymentMeans.
Does this tell me when to issue a credit note?
No. It only requires a reason field on those type codes. Not tax advice.
Related ZATCA rules
- BR-KSA-03 – Invoice UUID (KSA-1) missing or invalid
- BR-KSA-08 – Seller identification (BT-29) missing or wrong scheme
- BR-KSA-26 – Previous invoice hash (PIH, KSA-13) is not base64 SHA-256
- BR-KSA-27 – QR code (KSA-14) missing or not base64Binary
- BR-KSA-39 – Seller VAT number (BT-31) missing
- BR-KSA-40 – Seller VAT number (BT-31) is not 15 digits starting and ending with 3
- BR-KSA-04 – Invoice issue date (BT-2) is in the future or invalid
- BR-KSA-06 – Invoice transaction code (KSA-2) missing or invalid
Validate a ZATCA XML file for free Pricing
Not tax advice. Valifakt is not a ZATCA-onboarded e-invoicing solution (EGS). Official rule text is quoted from the ZATCA SDK validation-rules XSL.