Start a project
Saudi Arabia · Multiple (product)

ZATCA Phase 2 bridge for SAP Business One

Kodenova delivered a ready-to-install bridge that clears and reports SAP Business One invoices to ZATCA, where a guided setup replaces manual configuration and rejected invoices are visible and fixable from one screen.

SummaryA ready-to-install bridge that clears and reports SAP Business One invoices to ZATCA, with a friendly web interface on top of a background sync service.

The challenge

SAP B1 users in Saudi Arabia had a working but hard-to-operate ZATCA Windows service: no clear status, no easy setup, and errors hidden in logs.

Context

ZATCA Phase 2 (the integration phase of Saudi e-invoicing) requires every tax invoice to be produced as UBL 2.1 XML, signed with a cryptographic stamp, linked to the previous invoice by its hash and carrying a QR code. Standard (B2B) tax invoices must be cleared by ZATCA before they are shared with the buyer, and simplified (B2C) invoices must be reported within 24 hours. Before a system can submit, it has to be onboarded with a compliance CSID, pass the compliance checks and then receive a production CSID.

SAP Business One users in Saudi Arabia already had a Windows service that did this work, but it was hard to operate. There was no clear status screen, setup meant editing configuration by hand, and when ZATCA rejected an invoice the reason was buried in log files. For a finance team that must issue compliant invoices every day, a rejection that nobody notices quickly becomes a compliance and cash-flow problem.

What we built

  • ASP.NET Core web UI with a 6-step guided setup wizard
  • Background worker that syncs SAP B1 documents to ZATCA and writes results back
  • Submissions inspector, run history and readable error messages
  • Secrets encrypted at rest; hardware-bound licence with trial mode
  • Runs as a Windows service or under IIS

How it fits together

  • The background worker reads new invoices and credit notes from the SAP B1 company through the DI API.
  • Each document is turned into ZATCA-compliant XML, signed and sent to the ZATCA Fatoora API for clearance (B2B) or reporting (B2C).
  • The ZATCA response (status, warnings, errors and the cleared result) is written back to the SAP B1 document, so users see the outcome inside SAP.
  • A local SQLite database, accessed through EF Core, stores settings, submissions and run history; certificates and other secrets are encrypted at rest.
  • An ASP.NET Core MVC web UI sits on top: the 6-step setup wizard, the submissions inspector and readable error messages.
  • The same application runs either as a Windows service or under IIS, and a hardware-bound licence with trial mode controls activation.

How we delivered it

  1. Discovery and scope. Review the existing Windows service, the SAP B1 document types in use (invoices, credit notes, simplified invoices) and how the client is onboarded with ZATCA. Agree the scope of the phase.
  2. Build on a test company and the ZATCA sandbox. Build the setup wizard, the sync worker and the write-back against a SAP B1 test company, and submit only to the ZATCA developer and simulation environments until compliance checks pass.
  3. Testing. Run normal invoices, credit notes and deliberately broken documents through the bridge. Check that every rejection shows a clear message in the submissions inspector and can be fixed and resent.
  4. Go-live. Request the production CSID, switch the bridge to the production endpoint, install it as a Windows service or under IIS and activate the licence. Watch the first live submissions together with the finance team.
  5. Support. After go-live, support covers new rejection cases, ZATCA rule updates and questions from users.

Result

  • Guided setup replaces manual configuration
  • Rejected invoices are visible and fixable from one screen

Setup that used to need manual configuration is now a guided wizard, and the finance team can see and fix rejected invoices from one screen instead of searching log files.

Lessons for a similar project

  • Plan ZATCA onboarding early: the compliance CSID, compliance checks and production CSID are separate steps and each needs access to the Fatoora portal.
  • Keep the invoice hash chain and counter in one place; resending or skipping documents without care breaks the chain.
  • Make rejections visible to finance users, not only to IT. A readable error next to the document saves more time than any log file.

Technology

.NET 10ASP.NET Core MVCSAP B1 DI APIEF CoreSQLiteWindows Service

Services used

Delivered by Zain Abbas, Kodenova.

Want something similar?

Tell us what you need. You get a clear technical answer, a fixed scope and a price, usually within 24 hours.