Phase 1 QR Code Generation
Generate a basic QR code with 5 TLV tags for offline invoice validation.
š¦ Included Data (5 Tags):
- Tag 1: Seller Name
- Tag 2: VAT Registration Number
- Tag 3: Invoice Timestamp
- Tag 4: Invoice Total (with VAT)
- Tag 5: VAT Amount
ā ļø Note:
Invoice must be saved first before generating QR code
Phase 2 QR Code Generation
Generate advanced QR code with 9 TLV tags including cryptographic hash.
š¦ Included Data (9 Tags):
Basic Tags (1-5):
- Tag 1: Seller Name
- Tag 2: VAT Number
- Tag 3: Timestamp
- Tag 4: Total Amount
- Tag 5: VAT Amount
Advanced Tags (6-9):
- Tag 6: Invoice Hash (SHA256)
- Tag 7: Digital Signature
- Tag 8: Public Key
- Tag 9: Certificate Signature
ā¹ļø Process:
1. Generate UBL XML ā 2. Canonicalize ā 3. Hash (SHA256) ā 4. Create QR
QR Code:
Cryptographic Hash:
QR Base64:
Full Invoice Submission
Complete ZATCA submission with XML generation, signing, and clearance.
š Submission Process:
1.
Build InvoiceDocument DTO from invoice data
2.
Generate UBL 2.1 compliant XML with namespaces
3.
Canonicalize XML (C14N) for consistent hashing
4.
Generate SHA256 hash (Previous Invoice Hash - PIH)
5.
Create Phase 2 QR code with TLV encoding (9 tags)
6.
Save all artifacts (XML, hash, QR) to database
š¦ Generated Artifacts:
- UBL 2.1 XML file (zatca_xml)
- Canonical XML (for hashing)
- SHA256 Invoice Hash (previous_invoice_hash)
- Phase 2 QR Code (PNG Base64)
- Submission timestamp and status
ā
Submission Successful
Status:
QR Code:
Check Submission Status
Verify invoice submission status and view validation results.
š Status Checks:
- ZATCA submission status (generated/pending/submitted/cleared)
- Clearance status (CLEARED/REJECTED)
- Validation warnings and errors
- Submission timestamp
- ZATCA response details
Submission Status:
Clearance Status: