SAP B1 → ZATCA E-Invoicing (Fatoora Phase 2)

On SAP B1 invoice add, generate signed UBL 2.1 XML, submit to ZATCA Clearance (B2B) or Reporting (B2C simplified) API, then write the QR code, ZATCA UUID, ICV and hash back to invoice UDFs. Enforces strictly-sequential per-device hash chaining and BillingReference on credit notes.

Steps in this flow

  1. SAP B1: Invoice Add Event
  2. SL Login (B1SESSION)
  3. Get Invoice + Lines
  4. Validate: VAT 15% + BillingReference
  5. Build UBL 2.1 XML (+ PIH chain)
  6. Sign (CSID mTLS) + TLV QR
  7. Route by Invoice Type
  8. ZATCA Clearance API (B2B)
  9. ZATCA Reporting API (B2C)
  10. PATCH Invoice UDFs (QR/UUID/ICV/Hash)

All templates