BOT Solutions

Invoice Submission Workflow

Automatic Submission

When ZATCA integration is enabled, invoices are automatically submitted to ZATCA when:

  1. A Sales Invoice is created and submitted (not saved as draft)
  2. The invoice has all required fields
  3. ZATCA credentials are configured

Submission Process Flow

  1. User creates and submits Sales Invoice
  2. System creates Sales Invoice Additional Fields document
  3. System generates ZATCA-compliant XML
  4. System validates XML (if validation enabled)
  5. System signs XML using ZATCA CLI
  6. System calculates invoice hash and counter
  7. System submits signed XML to ZATCA API
  8. System receives response from ZATCA
  9. System updates Additional Fields with:
    • UUID (if successful)
    • QR Code
    • Integration Status
    • Errors/Warnings (if any)
  10. System creates ZATCA Integration Log entry

Manual submission if working offline

If your system is working offline and cannot submit invoices automatically, you can manually submit them when the system is back online:

Journal Entry Screenshot
  1. Ensure your system is connected to the internet
  2. Open the Sales Invoice Additional Fields document
  3. Check the Integration Status
  4. If status is "Pending/Failed", click "Submit to ZATCA" action button (if available)
  5. Journal Entry Screenshot
  6. System will generate the ZATCA-compliant XML and submit it to the ZATCA API once online
  7. Upon successful submission, the status will update to "Submitted" and you will receive a Popup.
  8. Journal Entry Screenshot
  9. If there are any errors, the system will provide error messages in the Errors and Warnings field

Manual submission in case of Rejection

If automatic submission fails or you need to resubmit:

  1. Open the Sales Invoice Additional Fields document
  2. Check the Integration Status
  3. If status is "Resend" or "Failed":
    • Review errors in the Errors and Warnings field
    • Fix any issues in the parent Sales Invoice
    • Click "Resend to ZATCA" action button (if available)

Submission Types

Reporting Mode

  • Standard submission mode
  • Invoices are reported to ZATCA for record-keeping
  • Used for most invoice types

Clearance Mode

  • Real-time clearance required
  • Invoices must be cleared by ZATCA before being considered valid
  • Used for specific invoice types or high-value transactions

Invoice Counter and Hash Chain

ZATCA requires invoices to be cryptographically chained:

  1. Invoice Counter: Sequential number starting from 1
  2. Invoice Hash: SHA-256 hash of invoice data
  3. Previous Invoice Hash: Hash of the immediately preceding invoice

This creates an unbreakable chain ensuring invoice integrity and preventing tampering.