# Saudi Arabia ZATCA Simplified Tax Invoice (UBL)

Source: https://xmlvalid.com/schemas/sa-zatca-simplified-invoice

> A Saudi simplified tax invoice (B2C) for FATOORA, checked against the UBL 2.1 schema and the EN 16931 and KSA rules of ZATCA's SDK.

A simplified tax invoice is usually issued by a business to a consumer. It has InvoiceTypeCode 388 (381, 383 or 386 for credit and debit notes and prepayments) with a name starting 02, and is submitted to ZATCA within 24 hours of its issue.
ZATCA validates it against the UBL schema, a subset of the EN 16931 rules and the KSA rules (BR-KSA-\*). For simplified invoices these require a cryptographic stamp (BR-KSA-60), and for every invoice a QR code and the hash of the previous invoice.

- Type: XSD + Schematron
- Version: XML Implementation Standard 1.2, SDK 3.4.6 rules
- Namespace: `urn:oasis:names:specification:ubl:schema:xsd:Invoice-2`
- Root element: `Invoice`
- Publisher: ZATCA (Zakat, Tax and Customs Authority) (GNU LGPL 3.0 (the rules)), source: https://zatca.gov.sa/en/E-Invoicing/SystemsDevelopers/Pages/E-Invoice-specifications.aspx
- Rules: [EN 16931 rules as ZATCA ships them (UBL) SDK 3.4.6](https://xmlvalid.com/rules/sets/sa-zatca-en16931)
- Rules: [ZATCA e-invoicing rules (Saudi Arabia) SDK 3.4.6](https://xmlvalid.com/rules/sets/sa-zatca)
- Validate against it: https://xmlvalid.com/validate?schema=sa-zatca-simplified-invoice

## Notes

- Rules run only when the document matches the schema. Documents over 50 MB are checked against the schema only.
- The rules are the two stylesheets of ZATCA's SDK 3.4.6: its copy of the EN 16931 rules and the KSA rules, both under the LGPL.
- BR-KSA-98 warns when a simplified invoice is more than 24 hours old, measured against the time of the check: it shows on the example, which dates from 2022.
- The schema is UBL 2.1 with one change: the certificate serial number in the signature (X509SerialNumber) is read as an integer of any length, as libxml2 reads integers of up to 24 digits only.
- The example is the simplified tax invoice of ZATCA's SDK 3.4.6, as phive-rules keeps the SDK's samples.
