# ZATCA Phase 2 E-Invoicing Integration Guide for Saudi Arabian Enterprise Software
Saudi Arabia's Zakat, Tax and Customs Authority (ZATCA) requires VAT-registered businesses to integrate their ERPs, e-commerce, and billing platforms with the central Fatoora platform under Phase 2 (Integration Phase).
Core Architecture Requirements
1. Cryptographic Stamp & Signing
Phase 2 mandates ECDSA secp256k1 digital signatures. Each invoice must be hashed using SHA-256 and signed with a valid Cryptographic Stamp Identifier (CSID).
2. UBL 2.1 XML Format
Invoices must conform to the ZATCA-compliant UBL 2.1 XML schema containing mandatory fields:
- Invoice Hash (cbc:DigestValue)
- Previous Invoice Hash (Blockchain-like chaining mechanism PiH)
- Cryptographic Stamp (cac:DigitalSignature)
- QR Code encoding TLV (Tag-Length-Value) parameters.
Integration Lifecycle Stages
1. Compliance CSID Onboarding: Issue OTP from the ZATCA Fatoora portal and submit a CSR to obtain a temporary compliance certificate.
2. API Verification Testing: Pass all automated ZATCA validation checks for standard (B2B clearance) and simplified (B2C reporting) invoices.
3. Production PCSID Generation: Upgrade certificate to Production status and start live API clearance.
Learn how Wise Hustlers implements ZATCA Phase 2 engines for Saudi enterprises in Riyadh, Jeddah, and Dammam.
