On this page

E-invoicing ​

What this is for ​

For companies in Saudi Arabia: whenever you post a sales invoice, a return or a tax credit note, the system issues an e-invoice in UBL 2.1 format with a QR code and a hash linked to the previous invoice (G5).

Where to find it ​

In the sidebar, go to Tax > E-invoices. The route is /tax/einvoices.

Fields ​

The list shows Document, Type (Tax invoice, Credit note or Debit note), Simplified, Issued at (UTC), Counter, Total, Tax, Status and Last message. You can filter by Status.

The statuses are:

  • Generated: not signed yet.
  • Signed
  • Reported: for simplified invoices.
  • Cleared: for standard invoices.
  • Rejected
  • Failed (retry)

How to ​

  1. In Tax settings, turn on ZATCA e-invoicing and enter the VAT number and the address.

  2. Under E-invoicing units, select Add unit and enter the code and name.

  3. Generate a one-time password on the Fatoora portal (it's valid for an hour). Then select Onboard next to the unit, enter the One-time password (OTP) and, optionally, the Industry / business category, and select Onboard.

    The system creates the key and the certificate signing request (CSR), obtains the compliance certificate, and passes the compliance checks for six samples (an invoice, a credit note and a debit note, each standard and simplified). It then obtains the production certificate and stores it in the secret store (OA-F3). The unit's status becomes Onboarded.

  4. Post your sales invoices as usual. The e-invoice is issued as part of the same posting and sent in the background.

  5. To resend pending invoices, select Submit pending.

Business rules ​

  • A customer with no VAT number gets a simplified invoice, which is reported. A customer with a VAT number gets a standard invoice, which is cleared and needs the buyer's address (TX9).
  • Each unit has its own sequential counter. Each invoice carries the hash of the previous one, and the first starts from the initial value set by ZATCA.
  • Returns and credit notes refer to the number of the original invoice.
  • Nothing is sent until the ZATCA gateway is set up in the server settings. Until then, you see "The ZATCA gateway is not configured; nothing was sent."
  • The certificate and the private key aren't stored in the database. They're read from the organisation's secret store when signing.
  • A signed invoice carries the full signature block (XAdES) at the top of the document: the invoice hash, the signing time, the certificate's fingerprint, issuer and serial number, the signature value and the certificate itself. It also carries the QR code with its nine fields (OA-F3).
  • Onboard again re-registers the unit with a new certificate (for example, when the certificate is about to expire). The unit's counter and hash chain don't change, and the compliance samples never enter the unit's chain.
  • A customer debit or credit note from Cash and banks issues an e-invoice (383 / 381) if it has tax lines. A self-billed purchase invoice is issued in the supplier's name when a self-billing agreement is turned on (OA-F5).

Common errors ​

MessageWhat to do
E-invoicing is on: register an e-invoicing unit (device) for this branch first.Register an e-invoicing unit.
Enter the company's VAT number in the tax settings.Complete the settings.
A standard (B2B) e-invoice needs the buyer's address in the customer's tax profile.Complete the customer's tax profile.
The tax authority refused the onboarding (…): …Check the one-time password (it's valid for one hour and one use) and try again.
The compliance sample … did not pass: …Review the message with your integration administrator. Nothing changes on the unit.
E-invoicing onboarding is not configured on this server.The server administrator needs to set up the ZATCA gateway.

Not available yet ​

  • Certifying the integration with the ZATCA sandbox before the first Saudi tenant (an owner action under OA-F3).