BR-KSA-86: Buyer email should follow the XXX@YYY.ZZ format

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

Warning: accepted with a warningConditional, see belowFields: BT-58

Describes the format of cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail (BT-58): a local part and domain of letters, digits, dots and hyphens (plus underscores in the local part) that start and end alphanumeric, and a 2-3 letter extension. In the SDK 3.4.8 schematron this check is commented out, so the validator does not run it.

How to fix it

Use a plain address such as <cbc:ElectronicMail>name@example.com</cbc:ElectronicMail>; per the message, separate several addresses with ';'.

ZATCA's official text

[BR-KSA-86]- Buyer's Contact Email Address (BT-58) shall follow the following format ** XXX@YYY.ZZ 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.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

string-length(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail) > 0 and not(exists(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail) and matches(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail, '^(?:[a-zA-Z0-9](?:[_a-zA-Z0-9.-]*[a-zA-Z0-9_])?@(?:[a-zA-Z0-9]([-.\w]*[a-zA-Z0-9])+\.)+[a-zA-Z]{2,3}(?:;|$))+$'))

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