InvoiceTypeCode
ZATCA InvoiceTypeCode: 388 invoice, 381 credit note, 383 debit note. Its name attribute (0100000 or 0200000) marks a standard or simplified invoice.
The cbc:InvoiceTypeCode element in the invoice header carries two things. Its value is the document type: 388 invoice, 381 credit note, 383 debit note, 386 prepayment. Anything else breaks BR-KSA-05.
Its name attribute (field KSA-2) is a 7-character transaction code: the first two digits are 01 for standard or 02 for simplified, then 0/1 flags: position 3 third party, 4 nominal, 5 export, 6 summary, 7 self-billed. So 0100000 is a plain standard tax invoice and 0200000 a plain simplified one. The executed check also accepts 8 or 9 characters (continuous supply and B2G).
What goes wrong: a malformed or missing name breaks BR-KSA-06. Self-billing on a simplified invoice (position 7 = 1) breaks BR-KSA-31, and on an export invoice BR-KSA-07. Note that a note takes the same name as its original invoice: a credit note on a simplified invoice is 0200000 with 381.
On Matheel you never write the code: type (standard or simplified) sets name, and document_type (invoice, credit_note or debit_note) sets 388, 381 or 383.
Example
<cbc:InvoiceTypeCode name="0100000">388</cbc:InvoiceTypeCode> <!-- standard tax invoice -->
<cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode> <!-- simplified invoice -->
<cbc:InvoiceTypeCode name="0200000">381</cbc:InvoiceTypeCode> <!-- simplified credit note -->
FAQ
What does 0200000 mean?
02 is a simplified invoice; the five zeros mean not third party, not nominal, not export, not summary, not self-billed.
What is the ZATCA code for a credit note?
381. A debit note is 383 and an invoice 388.
Related ZATCA rules
Related terms
Let Matheel handle this for you
Matheel signs the invoice, files it with ZATCA and keeps the counter and hash in one request, and returns the PDF with the QR.
Try Matheel, no signup Matheel API docs