Ifriqa Validator

ZATCA validation rules

Every ZATCA business rule the validator checks — EN 16931, BR-KSA and code-list rules — why invoices are rejected, and how to fix each one.

BR-02

An Invoice shall have an Invoice number (BT-1).

BR-03

An Invoice shall have an Invoice issue date (BT-2).

BR-04

An Invoice shall have an Invoice type code (BT-3).

BR-05

An Invoice shall have an Invoice currency code (BT-5).

BR-06

An Invoice shall contain the Seller name (BT-27).

BR-08

An Invoice shall contain the Seller postal address (BG-5)

BR-09

The Seller postal address (BG-5) shall contain a Seller country code (BT-40).

BR-10

An Invoice shall contain the Buyer postal address (BG-8).Not applicable for simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02).

BR-13

An Invoice shall have the Invoice total amount without VAT (BT-109).

BR-14

An Invoice shall have the Invoice total amount with VAT (BT-112).

BR-15

An Invoice shall have the Amount due for payment (BT-115).

BR-16

An Invoice shall have at least one Invoice line (BG-25)

BR-21

Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

BR-22

Each Invoice line (BG-25) shall have an Invoiced quantity (BT-129).

BR-24

Each Invoice line (BG-25) shall have an Invoice line net amount (BT-131).

BR-25

Each Invoice line (BG-25) shall contain the Item name (BT-153).

BR-26

Each Invoice line (BG-25) shall contain the Item net price (BT-146).

BR-31

Each Document level allowance (BG-20) shall have a Document level allowance amount (BT-92).

BR-32

Each Document level allowance (BG-20) shall have a Document level allowance VAT category code (BT-95).

BR-36

Each Document level charge (BG-21) shall have a Document level charge amount (BT-99).

BR-37

Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).

BR-41

Each Invoice line allowance (BG-27) shall have an Invoice line allowance amount (BT-136).

BR-43

Each Invoice line charge (BG-28) shall have an Invoice line charge amount (BT-141).

BR-45

Each VAT breakdown (BG-23) shall have a VAT category taxable amount (BT-116).

BR-46

Each VAT breakdown (BG-23) shall have a VAT category tax amount (BT-117).

BR-47

Each VAT breakdown (BG-23) shall be defined through a VAT category code (BT-118).

BR-48

Each VAT breakdown (BG-23) shall have a VAT category rate (BT-119), except if the Invoice is not subject to VAT.

BR-49

A Payment instruction (BG-16) shall specify the Payment means type code (BT-81).

BR-52

Each Additional supporting document (BG-24) shall contain a Supporting document reference (BT-122).

BR-53

If the VAT accounting currency code (BT-6) is present, then the Invoice total VAT amount in accounting currency (BT-111) shall be provided.

BR-54

Each Item attribute (BG-32) shall contain an Item attribute name (BT-160) and an Item attribute value (BT-161).

BR-55

Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).

BR-CL-01

The document type code MUST be coded by the invoice and credit note related code lists of UNTDID 1001.

BR-CL-03

currencyID MUST be coded using ISO code list 4217 alpha-3

BR-CL-04

Invoice currency code MUST be coded using ISO code list 4217 alpha-3

BR-CL-05

Tax currency code MUST be coded using ISO code list 4217 alpha-3

BR-CL-14

Country codes in an invoice MUST be coded using ISO code list 3166-1

BR-CL-16

Payment means in an invoice MUST be coded using UNCL4461 code list

BR-CL-18

Invoice tax categories MUST be coded using UNCL5305 code list.

BR-CL-KSA-14

Field character limit for QR Code field has been exceeded. The maximum character limit for this field is 1000 characters.

BR-CO-04

Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151).

BR-CO-10

Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).

BR-CO-11

Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92).

BR-CO-12

Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).

BR-CO-13

Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).

BR-CO-14

Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117).

BR-CO-15

Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).

BR-CO-16

Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Pre-Paid amount (BT-113) + Rounding amount (BT-114).

BR-CO-17

VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.

BR-CO-18

An Invoice shall at least have one VAT breakdown group (BG-23).

BR-CUSTOM-VALIDATION-01

The Seller VAT registration number or seller group VAT registration number (BT-31) of The invoice must not match the buyer VAT registration number (BT-48) .

BR-DEC-01

The allowed maximum number of decimals for the Document level allowance amount (BT-92) is 2.

BR-DEC-02

The allowed maximum number of decimals for the Document level allowance base amount (BT-93) is 2.

BR-DEC-05

The allowed maximum number of decimals for the Document level charge amount (BT-99) is 2.

BR-DEC-06

The allowed maximum number of decimals for the Document level charge base amount (BT-100) is 2.

BR-DEC-09

The allowed maximum number of decimals for the Sum of Invoice line net amount (BT-106) is 2.

BR-DEC-10

The allowed maximum number of decimals for the Sum of allowanced on document level (BT-107) is 2.

BR-DEC-11

The allowed maximum number of decimals for the Sum of charges on document level (BT-108) is 2.

BR-DEC-12

The allowed maximum number of decimals for the Invoice total amount without VAT (BT-109) is 2.

BR-DEC-13

The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.

BR-DEC-14

The allowed maximum number of decimals for the Invoice total amount with VAT (BT-112) is 2.

BR-DEC-15

The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.

BR-DEC-16

The allowed maximum number of decimals for the Pre-Paid amount (BT-113) is 2.

BR-DEC-17

The allowed maximum number of decimals for the Rounding amount (BT-114) is 2.

BR-DEC-18

The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2.

BR-DEC-19

The allowed maximum number of decimals for the VAT category taxable amount (BT-116) is 2.

BR-DEC-20

The allowed maximum number of decimals for the VAT category tax amount (BT-117) is 2.

BR-DEC-23

The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.

BR-DEC-24

The allowed maximum number of decimals for the Invoice line allowance amount (BT-136) is 2.

BR-DEC-25

The allowed maximum number of decimals for the Invoice line allowance base amount (BT-137) is 2.

BR-DEC-27

The allowed maximum number of decimals for the Invoice line charge amount (BT-141) is 2.

BR-DEC-28

The allowed maximum number of decimals for the Invoice line charge base amount (BT-142) is 2.

BR-E-01

An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is "Exempt from VAT" shall contain at least one VAT breakdown (BG-23) with the VAT category code (BT-118) equal to "Exempt from VAT".

BR-E-05

In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Exempt from VAT", the Invoiced item VAT rate (BT-152) shall be 0 (zero).

BR-E-06

In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Exempt from VAT", the Document level allowance VAT rate (BT-96) shall be 0 (zero).

BR-E-07

In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "Exempt from VAT", the Document level charge VAT rate (BT-103) shall be 0 (zero).

BR-E-08

In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Exempt from VAT" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Exempt from VAT".

BR-E-09

The VAT category tax amount (BT-117) In a VAT breakdown (BG-23) where the VAT category code (BT-118) equals "Exempt from VAT" shall equal 0 (zero).

BR-KSA-03

The invoice must contain a unique identifier ("UUID") (KSA-1) given by the unit that issued the document (unique message identifier for interchange process). This value must contain only letters, digits, and dashes.

BR-KSA-04

The document issue date (BT-2) must be less or equal to the current date.

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.

BR-KSA-06

The invoice transaction code (KSA-2) must exist and respect the following structure: NNPNESB where NN (positions 1 and 2) = invoice subtype: - 01 for tax invoice - 02 for simplified tax invoice P (position 3) = 3rd Party invoice transaction, 0 for false, 1 for true N (position 4) = Nominal invoice transaction, 0 for false, 1 for true E (position 5) = Exports invoice transaction, 0 for false, 1 for true S (position 6) = Summary invoice transaction, 0 for false, 1 for true B (position 7) = Self billed invoice

BR-KSA-07

Self billing is not allowed (KSA-2, position 7 cannot be "1") for export invoices (KSA-2, position 5 = 1).

BR-KSA-08

The seller identification (BT-29) must exist only once with one of the scheme ID (BT-29-1) (CRN, MOM, MLS, SAG, OTH, 700) and must contain only alphanumeric characters. Commercial Registration number with "CRN" as schemeID. MOMRAH license with "MOM" as schemeID. MHRSD license with "MLS" as schemeID. 700 Number with "700" as schemeID. MISA license with "SAG" as schemeID. Other OD with "OTH" as schemeID. In case of multiple commercial registrations, the seller should fill the commercial registration of the branch in respect of which the Tax Invoice is being issued. In case multiple IDs exist then one of the above must be entered following the sequence specified above.

BR-KSA-09

Seller address must contain street name (BT-35), building number (KSA-17), postal code (BT-38), city (BT-37), district (KSA-3), country code (BT-40). For more information please access this link: https://splonline.com.sa/en/national-address-1/

BR-KSA-10

Buyer address must contain a street (BT-50), city (BT-52), country code (BT-55). This rule does not apply on the simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02).

BR-KSA-11

An Invoice line (BG-25) where the VAT category code (BT-151) is "Not subject to VAT", an invoiced item VAT rate (BT-152) shall be 0 (zero), if exist.

BR-KSA-12

A Document level allowance (BG-20) where VAT category code (BT-95) is "Not subject to VAT", a Document level allowance VAT rate (BT-96) shall be 0 (Zero), if exist.

BR-KSA-13

A Document level charge (BG-21) where the VAT category code (BT-102) is "Not subject to VAT", a Document level charge VAT rate (BT-103) shall be 0 (zero), if exist.

BR-KSA-14

The buyer identification (BT-46), required only if buyer is not VAT registered, then the buyer identification (BT-46) must be provided with one of the scheme IDs (BT-46-1) (TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, OTH) and must contain only alphanumeric characters. Tax Identification Number "TIN" as schemeID ;Commercial registration number with "CRN" as schemeID ;MOMRAH license with "MOM" as schemeID ;MHRSD license with "MLS" as schemeID ;700 Number with "700" as schemeID ;MISA license with "SAG" as schemeID ;National ID with "NAT" as schemeID ;GCC ID with "GCC" as schemeID ;Iqama Number with "IQA" as schemeID ;Passport ID with "PAS" as schemeID ;Other ID with "OTH" as schemeID. ;In case of multiple commercial registrations, the seller should fill the commercial registration of the branch in respect of which the Tax Invoice is being issued. In case multiple IDs exist then one of the above must be entered following the sequence specified above

BR-KSA-15

The tax invoice ((invoice type code (BT-30) = 388) and (invoice transaction code (KSA-2) has "01" as first 2 digits)) must contain the supply date (KSA-5).

BR-KSA-16

Payment means code (BT-81) in an invoice exist, then it must contain one of the values from subset of UNTDID 4461 code list

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.

BR-KSA-18

VAT category code must contain one of the values (S, Z, E, O).

BR-KSA-19

Each Document level charge (BG-21) shall have a code for the reason for document level charge (BT-105).

BR-KSA-20

Each Invoice line charge (BG-28) shall have a code for the reason for invoice line charge (BT-145).

BR-KSA-21

Each Document level charge (BG-21) shall have a Reason for document level charge (BT-104).

BR-KSA-22

Each Invoice line charge (BG-28) shall have a Reason for invoice line charge (BT-144).

BR-KSA-23

A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Exempt from VAT' shall have a VAT exemption reason code (BT-121).

BR-KSA-24

A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Not subject to VAT' shall have a VAT exception reason code (BT-121)

BR-KSA-25

If it is a simplified tax invoice or an associated credit note or a debit note (KSA-2, position 1 and 2 = 02) and the tax exemption reason code (BT-121) is equal with VATEX-SA-EDU or VATEX-SA-HEA, then buyer name (BT-44) is mandatory.

BR-KSA-26

If the invoice contains the previous invoice hash (KSA-13), this hash must be base64 encoded SHA256. The hash shall be computed using the following method as described in the ds:transforms block in the XML Invoice Specifications: 1. Remove the <Invoice><ext:UBLExtensions/> block 2. Remove the <Invoice><cac:AdditionalDocumentReference/> block where <cbc:ID/> = QR 3. Remove the <Invoice><cac:Signature/> block 4. Canonicalize the Invoice using the C14N11 standard 5. Hash the resulting string using SHA256 to a binary object 6. Base64 encode the binary object to generate the digest value For the first invoice, the previous invoice hash is "NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==", the equivalent for base64 encoded SHA256 of "0" (zero) character.

BR-KSA-27

The document must contain a QR code (KSA-14), and this code must be base64Binary.

BR-KSA-28

If the cryptographic stamp (KSA-15) exists in the invoice, this cryptographic stamp (KSA-15) must contain the exact "urn:oasis:names:specification:ubl:signature:1" value for signature information ID.

BR-KSA-29

If the cryptographic stamp (KSA-15) exists in the invoice, this cryptographic stamp (KSA-15) must contain the exact "urn:oasis:names:specification:ubl:signature:Invoice" value for referenced signature ID and signature ID.

BR-KSA-30

The document cryptographic stamp (KSA-15) must contain the exact "urn:oasis:names:specification:ubl:dsig:enveloped:xades" value for signature method.

BR-KSA-31

[BR-KSA-31]-For simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02),only the following transaction types can be "true": - third party (KSA-2, position 3 = 1), - nominal supply (KSA-2, position 4 = 1) and - summary transactions (KSA-2,position 6 = 1). Other transaction types (self-billing and export) are not allowed to be "true" for simplified tax invoices and associated credit notes and debit notes.

BR-KSA-33

Each invoice must have an invoice counter value (KSA-16).

BR-KSA-34

The invoice counter value (KSA-16) contains only digits.

BR-KSA-35

If the invoice contains a supply end date (KSA-24), then the invoice must contain a supply date (KSA-5).

BR-KSA-36

If the invoice contains a supply end date (KSA-24), then this date must be greater than or equal to the supply date (KSA-5).

BR-KSA-37

The seller address building number must contain 4 digits.

BR-KSA-39

The invoice must contain the seller VAT registration number or seller group VAT registration number (BT-31).

BR-KSA-40

If it exists in the invoice, the seller VAT registration number (BT-31) must contain 15 digits. The first and the last digits are "3".

BR-KSA-42

The buyer name (BT-44) must be present in the tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).

BR-KSA-44

If it exists in the invoice,the buyer VAT registration number or buyer group VAT registration number (BT-48) must contain 15 digits. The first digit and the last digit is "3".

BR-KSA-49

If the tax exemption reason code (BT-121) is equal to VATEX-SA-EDU or VATEX-SA-HEA, then the other buyer ID (BT-46) is mandatory and must be national ID (BT-46-1 = NAT).

BR-KSA-51

The line amount with VAT (KSA-12) must be Invoice line net amount (BT-131) + Line VAT amount (KSA-11).

BR-KSA-52

The line VAT amount (KSA-11) is mandatory for tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).

BR-KSA-53

The line amount with VAT (KSA-12) is mandatory for tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).

BR-KSA-56

For credit notes ((BT-3) has the value of 381) and debit notes ((BT-3) has the value of 383), the billing reference ID (BT-25) is mandatory.

BR-KSA-60

Cryptographic stamp (KSA-15) must exist in simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02).

BR-KSA-61

Previous invoice hash (KSA-13) must exist in an invoice.

BR-KSA-63

If the buyer country code (BT-55) is "SA", then these fields are mandatory:street name (BT-50), building number (KSA-18), postal code (BT-53), city (BT-52), District (KSA-4), country code (BT-55).For more information please access this link:https://splonline.com.sa/en/national-address-1/

BR-KSA-66

Seller postal code (BT-38) must be 5 digits.

BR-KSA-67

If the buyer country code (BT-55) is "SA", then the Buyer postal code(BT-53) must be 5 digits.

BR-KSA-68

Tax currency code (BT-6) must exist in an invoice.

BR-KSA-69

A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Zero rated' shall have a VAT exception reason code (BT-121).

BR-KSA-70

The invoice must contain Invoice Issue Time (KSA-25). This value should be in the format: hh:mm:ss for time expressed in local time (eg 19:20:30) or hh:mm:ssZ for time expressed in UTC (eg 19:20:30Z)."The invoice must contain Invoice Issue Time (KSA-25). This value should be in the format: hh:mm:ss for time expressed in local time (eg 19:20:30) or hh:mm:ssZ for time expressed in UTC (eg 19:20:30Z).

BR-KSA-71

If the Invoice is a simplified invoice type and is a summary invoice (KSA-2, position 1 and 2 = 02, position 6 = 1),then the buyer name must be present.

BR-KSA-72

If the Invoice is a simplified invoice type and is a summary invoice (KSA-2, position 1 and 2 = 02, position 6 = 1), then a supply date (KSA-5) and supply end date (KSA-24) must be present

BR-KSA-73

If Pre-Paid amount (BT-113) is provided, then the following data is mandatory to provide as additional invoice line(s) -Prepayment ID (KSA-26) -Sequential invoice number (BT-1) of the prepayment invoice(s)-Prepayment Issue Date (KSA-28) -Issue date (BT-2) of the prepayment invoice(s) Prepayment Issue Time (KSA-29) - Issue time (KSA-25) of the prepayment invoice(s) Prepayment Document Type Code (KSA-30)- Invoice type code (BT-3) must be 386.

BR-KSA-74

Prepayment Document Type Code (KSA-30) for the Invoice line document reference must be '386'.

BR-KSA-75

If Prepayment Document Type code (KSA-30) is provided in an Invoice Line, then the following data is mandatory to provide in that invoice line - Prepayment VAT category Taxable Amount (KSA-31) - Sum total of taxable amounts subject to specific VAT Category code of the prepayment invoice(s); Prepayment VAT Category Tax Amount (KSA-32) - Sum total of tax amounts subject to specific VAT Category code of the prepayment invoice(s); Prepayment VAT category code (KSA-33) - the VAT category code of the associated Prepayment invoice(s); Prepayment VAT rate (KSA-34) - VAT rate of the specific VAT Category code of the prepayment invoice(s)

BR-KSA-76

An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is "Zero rated" the Prepayment VAT rate (KSA-34) shall be 0 (zero).

BR-KSA-77

An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is "Exempt from VAT" the Prepayment VAT rate (KSA-34) shall be 0 (zero).

BR-KSA-78

An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is "Not subject to VAT" the Prepayment VAT rate (KSA-34) shall be 0 (zero).

BR-KSA-79

The Prepayment VAT Category Tax Amount (KSA-32) must be Prepayment VAT category Taxable Amount( (KSA-31) x Prepayment VAT rate (KSA-34) /100).

BR-KSA-80

- The Pre-Paid amount (BT-113) must be equal to the sum total of the Prepayment VAT category Taxable Amount (KSA-31) and the Prepayment VAT Category Tax Amount (KSA-32).

BR-KSA-81

The other Buyer ID (BT-46) must present in the tax invoice and associated debit notes and credit notes (KSA-2, position 1 and 2 = 01), where the buyer VAT registration number or buyer group VAT registration number (BT-48) is not provided.

BR-KSA-82

An Invoice line (BG-25) where Prepayment Document Type Code (KSA-30) is provided, then Item net price (BT-146); Invoice line allowance amount (BT-136); Invoice line charge amount (BT-141); Item line net amount (BT-131); line VAT amount (KSA-11); and line amount with VAT (KSA-12) for that line shall be 0 (Zero), if exist.

BR-KSA-83

A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Exempt from VAT' or 'Zero rated' or 'Not subject to VAT' shall have a VAT exemption (or exception) reason text (BT-120) with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason text - specific to Saudi Arabia.

BR-KSA-84

The Document level allowance VAT rate (BT-96), Document level Charge VAT rate (BT-103), VAT category rate(BT-119), Invoiced item VAT rate (BT-152), Prepayment VAT rate(KSA-34) must be limited to one of the following values (5 or 15) when the relevant Document level allowance VAT category code (BT-95), Document level Charge VAT category code(BT-102), VAT category code(BT-118), Invoiced item VAT category code(BT-151), Prepayment VAT Category Code (KSA-33) is "S"- "Standard rated". In other words, for Standard Rate VAT Category the rate can either be 15% or 5%.

BR-KSA-85

The Buyer's contact phone number (BT-57) shall start with "0" or "+", followed by a maximum of 15 number and minimum 4 character after the "+" or "0" , if exist.

BR-KSA-86

Buyer's Contact Email Address (BT-58) shall follow the following format ** [email protected] where: The [XXX] should consist of alphanumeric characters (a-z, A-Z, 0-9), dots ('.'), underscores ('_'), or hyphens ('-'). It must start and end with an alphanumeric character. The [YYY] should consist of alphanumeric characters (a-z, A-Z, 0-9), hyphens ('-'), and dots ('.'). It must start and end with an alphanumeric character. The [ZZ] should be a valid extension with a maximum 3 and a minimum 2 alphabets (a-z, A-Z), If exist. Multiple emails can be provided using semicolon ';' separator.

BR-KSA-87

If the tax exchange rate (KSA-36) exists, then Source Currency Code (KSA-37), Target Currency Code (KSA-38) and Calculation Rate (KSA-39) shall be provided

BR-KSA-88

If exist, Source Currency Code (KSA-37) must be the same as Invoice currency code (BT-5)

BR-KSA-89

If exists, Target Currency Code (KSA-38) must be the same as the Tax currency code (BT-6)

BR-KSA-90

If exists, the allowed maximum number of digits for the Tax Exchange Rate (KSA-39) is 14.

BR-KSA-91

For B2G supplies attracting provisions of Article 20(5) of VAT Regulations, Company Legal Form (KSA-40) should be provided with a static value "GOV" in case of a tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).

BR-KSA-92

If the Company Legal Form (KSA-40) is provided as 'GOV', then the Tax Point Date (BT-7) must present in a tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01) and it must refer to the Payment Order Date.

BR-KSA-93

An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is "Zero-rated" the Prepayment VAT exception reason code (KSA-41) should be provided.

BR-KSA-94

An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is " Exempt from VAT " the Prepayment VAT exemption reason code (KSA-41) should be provided.

BR-KSA-95

An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is " Not subject to VAT " the Prepayment VAT exception reason code (KSA-41) should be provided.

BR-KSA-96

An Invoice line (BG-25) with the Prepayment VAT category code (KSA-33) 'Exempt from VAT' or 'Zero rated' or 'Not subject to VAT' shall have a Prepayment VAT exemption(or exception) reason text (KSA-42) with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason text - specific to Saudi Arabia.

BR-KSA-97

If the Document Currency Code (BT-5) is different from "SAR", then the value in "Invoice total VAT amount (BT-110)" cannot be the same as the value in "Invoice total VAT amount in accounting currency (BT-111)".

BR-KSA-CL-01

Currency code (BT-5) must be according to ISO 4217:2005

BR-KSA-CL-02

All currencyID attributes (BT-5) must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).

BR-KSA-CL-03

Mime code must be according to subset of IANA code list.

BR-KSA-CL-04

If VAT category Code (BT-118) is 'Z', or 'E', VAT exemption (or exception) reason code (BT-121) must exist with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason code - specific to Saudi Arabia.

BR-KSA-CL-06

Code for the reason for document level charge (BT-105) and the code for the reason for invoice line charge (BT-145) MUST be coded using UNTDID 7161 code list. https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred7161.htm

BR-KSA-CL-07

If the Prepayment VAT Category Code(KSA-33) is 'Z', or 'E' or 'O', the Prepayment VAT exemption (or exception) reason code(KSA-41) must exist with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason code - specific to Saudi Arabia.

BR-KSA-DEC-01

The allowance percentage values (BT-94, BT-138) must be from 0.00 to 100.00, with maximum two decimal places. Only numerals are accepted, the percentage symbol (%) is not allowed.

BR-KSA-DEC-02

The VAT rates (BT-96, BT-103, BT-119, BT-152, KSA-34) must be from 0.00 to 100.00, with maximum two decimals.Only numerals are accepted, the percentage symbol (%) is not allowed.

BR-KSA-DEC-03

VAT amount at line level (KSA-11) must have a maximum two decimals.

BR-KSA-DEC-04

Amount with VAT at line level (KSA-12) must have a maximum two decimals.

BR-KSA-DEC-06

Prepayment VAT category Taxable Amount (KSA-31) and Prepayment VAT Category Tax Amount (KSA-32) must have a maximum two decimals.

BR-KSA-EN16931-01

Business process (BT-23) must be "reporting:1.0".

BR-KSA-EN16931-02

VAT accounting currency code (BT-6) must be "SAR".

BR-KSA-EN16931-03

Allowance/Charge amount (BT-92, BT-99, BT-136, BT-141) must equal base amount (BT-93, BT-100, BT-137, BT-142) * percentage (BT-94, BT-101, BT-138, BT-143) / 100 if base amount and percentage exists.

BR-KSA-EN16931-04

Allowance/Charge base amount (BT-93, BT-100, BT-137, BT-142) must be provided when allowance/Charge percentage (BT-94, BT-101,BT-138, BT-143) is provided.

BR-KSA-EN16931-05

Allowance/Charge percentage (BT-94, BT-101, BT-138, BT-143) must be provided when the allowance/Charge base amount (BT-93, BT-100, BT-137, BT-142) is provided.

BR-KSA-EN16931-06

Charge on price level (BG-29) is allowed. The value of Indicator should be ' True'.

BR-KSA-EN16931-07

Item net price (BT-146) must equal (Item Gross price (BT-148) - Allowance amount (BT-147)) when gross price is provided.

BR-KSA-EN16931-08

Only one tax total (BG-22) with tax subtotals must be provided.Refer to Calculation of VAT.

BR-KSA-EN16931-09

Only one tax total (BG-22) without tax subtotals (BG-23) must be provided when tax currency code is provided .

BR-KSA-EN16931-11

Invoice line net amount (BT-131) must equal (Invoiced quantity (BT-129) * (Item net price (BT-146) / item price base quantity (BT-149))-) + Sum of invoice line charge amount (BT-141) - Sum of invoice line allowance amount (BT-136).

BR-KSA-EN16931-12

Base quantity (BT-149) must be a positive number above zero.

BR-KSA-F-01

A date MUST be formatted YYYY-MM-DD, in accordance to the "Calendar date complete representation" as specified by ISO 8601:2004, format YYYY-MM-DD.

BR-KSA-F-02

Allowance/Charge Indicator value MUST equal to 'false'/’True’ respectively.

BR-KSA-F-04

All the document amounts and quantities must be positive, unless specified otherwise.

BR-KSA-F-05

Prepayment Issue Time (KSA-29) must be in the format: hh:mm:ss for time expressed in local time or hh:mm:ssZ for time expressed in UTC.(eg 19:20:30)

BR-KSA-F-06-C1

- Field character limits for Invoice number field (BT-1) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.

BR-KSA-F-06-C10

- Field character limits for Seller name field (BT-27) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.

BR-KSA-F-06-C11

- Field character limits for the Buyer Address - Additional street field (BT-51) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C12

- Field character limits for Buyer name field (BT-44) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.

BR-KSA-F-06-C13

- Field character limits for Reasons for issuance of credit / debit note field (KSA-10) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters .

BR-KSA-F-06-C14

Field character limits for Payment terms field (KSA-22) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C15

- Field character limits for Payment account identifier field (BT-84) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C16

Field character limits for VAT exemption reason text field (BT-120) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.

BR-KSA-F-06-C17

- Field character limits for Invoice line identifier field (BT-126) have not been met. The minimum limit is 1 character and the maximum limit is 6 characters.

BR-KSA-F-06-C18

- Field character limits for Invoiced quantity unit of measure field (BT-130) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C19

- Field character limits for Item name field (BT-153) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.

BR-KSA-F-06-C2

- Field character limits for Invoice note field (BT-22) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C20

- Field character limits for Item standard identifier field (BT-157) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C21

- Field character limits for Item price base quantity unit code field (BT-150) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C22

Field character limits for Billing reference ID field (BT-25) have not been met. The minimum limit is 1 character and the maximum limit is 5000 characters.

BR-KSA-F-06-C23

- Field character limits for the Buyer Address - Street field (BT-50) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.

BR-KSA-F-06-C24

- Field character limits for the Buyer Address - Street field (BT-50) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C25

- Field character limits for the Buyer Address - City field (BT-52) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.

BR-KSA-F-06-C26

- Field character limits for the Buyer Address - City field (BT-52) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C27

- Field character limits for the Buyer Address - Province/State field (BT-54) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C28

- Field character limits for the Buyer Address - District field (KSA-4) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.

BR-KSA-F-06-C29

- Field character limits for the Buyer Address - District field (KSA-4) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C3

- Field character limits for Purchase order ID field (BT-13) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C30

- Field character limits for Item Buyer's identifier field (BT-156) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C31

- Field character limits for Item Seller's identifier field (BT-155) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C32

- Field character limits for Buyer name field (BT-44) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C33

-Field character limits for Reason for the document level charge (BT-104) have not been met. The maximum limit is 1,000 characters.

BR-KSA-F-06-C34

-Field character limits for Reason for invoice line charge (BT-144) have not been met. The maximum limit is 1,000 characters.

BR-KSA-F-06-C35

-Field character limits for Reason for the document level allowance (BT-97) have not been met. The maximum limit is 1,000 characters.

BR-KSA-F-06-C36

-Field character limits for Reason for the invoice line allowance (BT-139) have not been met. The maximum limit is 1,000 characters.

BR-KSA-F-06-C37

- Field character limits for the contact name - Buyer's contact point field (BT-56) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C38

- Field character limits for the contact note - Buyer's Contact Note field (KSA-35) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C39

- Field character limits for the Prepayment VAT exemption reason text (KSA-42) have not been met. The maximum limit is 1000 characters.

BR-KSA-F-06-C4

- Field character limits for the Seller Address - Street field (BT-35) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.

BR-KSA-F-06-C5

- Field character limits for Contract ID field (BT-12) have not been met. The maximum limit is 127 characters .

BR-KSA-F-06-C6

- Field character limits for the Seller Address - Additional street field (BT-36) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C7

- Field character limits for the Seller Address - City field (BT-37) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.

BR-KSA-F-06-C8

- Field character limits for the Seller Address - Province/State field (BT-39) have not been met. The maximum limit is 127 characters.

BR-KSA-F-06-C9

- Field character limits for the Seller Address - District field (KSA-3) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.

BR-O-01

An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is "Not subject to VAT" shall contain exactly at least one VAT breakdown group (BG-23) with the VAT category code (BT-118) equal to "Not subject to VAT".

BR-O-08

In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Not subject to VAT" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Not subject to VAT".

BR-O-09

The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where the VAT category code (BT-118) is "Not subject to VAT" shall be 0 (zero).

BR-S-01

An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151, BT-95 or BT-102) is "Standard rated" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with "Standard rated".

BR-S-05

For invoice items (BG-25) in which the VAT category code of invoiced items (BT-151) is "Standard rated" the VAT rate of the invoiced item (BT-152) must be greater than zero.

BR-S-06

In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Standard rated" the Document level allowance VAT rate (BT-96) shall be greater than zero.

BR-S-07

-In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "Standard rated" the Document level charge VAT rate (BT-103) shall be greater than zero.

BR-S-08

In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Standard rated" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Standard Rate".

BR-S-09

The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Standard rated" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119) / 100), rounded to two decimals.

BR-S-10

A VAT breakdown (BG-23) with VAT Category code (BT-118) "Standard rate" shall not have a VAT exemption reason code (BT-121) or VAT exemption reason text (BT-120).

BR-Z-01

An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is "Zero rated" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with "Zero rated".

BR-Z-05

In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Zero rated" the Invoiced item VAT rate (BT-152) shall be 0 (zero).

BR-Z-06

In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Zero rated" the Document level allowance VAT rate (BT-96) shall be 0 (zero).

BR-Z-07

In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "Zero rated" the Document level charge VAT rate (BT-103) shall be 0 (zero).

BR-Z-08

In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Zero rated" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Zero Rated".

BR-Z-09

The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Zero rated" shall equal 0 (zero).

ZATCA code lists

Reference values enforced by the official ZATCA rules. Extracted from the official schematron — not hand-authored.

VAT category codes

  • S — Standard rate
  • Z — Zero rated
  • E — Exempt from VAT
  • O — Not subject to VAT / outside scope of tax

VAT exemption reason codes (by category)

Zero rated (Z)

VATEX-SA-32VATEX-SA-33VATEX-SA-34-1VATEX-SA-34-2VATEX-SA-34-3VATEX-SA-34-4VATEX-SA-34-5VATEX-SA-35VATEX-SA-36VATEX-SA-DIPLOMATVATEX-SA-DUTYFREEVATEX-SA-EDUVATEX-SA-HEAVATEX-SA-MLTRY

Exempt (E)

VATEX-SA-29VATEX-SA-29-7VATEX-SA-30

Not subject / outside scope (O)

VATEX-SA-OOS
ZATCA (BR-KSA) validation rules — full reference | Ifriqa