Academy index
Page referenceAdvanced/integrations/zatca
Saudi e-invoicing (ZATCA)
Really onboards e-invoicing units with ZATCA's Fatoora platform and sends posted invoices for clearance or reporting. The main fields and buttons, and refusals.
Reviewed independently, claim by claim against the sources and the screens, on 4 December 2026.
Last checked against the screen and the code: 4 December 2026, version 080e20835.
This page of the program is under construction: the reference states only what works in it today.
What this page is
What really happens: the program's server calls the Fatoora platform of the Zakat, Tax and Customs Authority (gw-fatoora.zatca.gov.sa) in the environment each e-invoicing unit is registered in: the developer portal (a test), the simulation (pre-production) or production. Registering a unit generates its key and certificate request on the server from the company's data; you then send the one-time code the company generates on the Fatoora portal and ZATCA issues the compliance certificate; the program then signs test documents in the company's name and sends them to the compliance checks; then the production certificate is issued. The unit's key and certificate secrets stay sealed on the server and never reach the browser.
Sending: the program reads the posted invoice itself (its header, lines and customer), checks it, signs it, places it in the unit's chain (a running counter and the previous invoice's hash), then sends it: a standard invoice for clearance, a simplified one for reporting. The program keeps ZATCA's answer, and the cleared invoice ZATCA stamped with its QR code. An invoice ZATCA did not receive (an outage or an error on its server) is sent again as the same signed document: with «Resend», or automatically every 15 minutes for seven days.
Read the environment written under each status: on the developer portal a simplified invoice goes to ZATCA's checker and is not reported, so it becomes «Accepted», not «Reported»; and what a unit on the developer portal or in the simulation sends is a test, not production. The «Live» badge shows for every unit with a production certificate, in whatever environment.
What does not work on this page today: «Download XML» always says «No XML yet», even for an invoice that was sent, because the list the page reads carries no file; the «QR code» window always reads «UUID: -»; the search box on the «Invoices» tab searches only the ten rows shown; the «Cleared or reported» share divides by every invoice in the list, unsent ones and drafts included, although its text says «share of the invoices sent», the «Pending» card counts unsent, draft and cancelled invoices, and an «Accepted» invoice is in no card but the total; the «Invoices List» description says «Invoices sent to ZATCA» while it lists every sales invoice, sent or not; the «Invoice Submitted» message also shows when the developer portal only checked a simplified invoice; when the compliance checks fail, a general message shows without the documents and ZATCA's reasons; and the status card, the checklist and the units need the accounting view right: without it they read «Phase2 Not Ready» as if there were no unit, whatever exists, and an extra «No data available» row appears under the invoices.
Before you start
- In Settings ▸ Company: the company's country Saudi Arabia and its VAT number (15 digits starting and ending with 3) are required to register a unit; the legal name (else the company name), the CR number and the national address go into the invoice.
- The company's own login to the Fatoora portal, to generate the code for the unit's environment.
- Posted sales invoices. What an invoice lacks is named by the program when it refuses to send it.
Fields
| Field as on the screen | Meaning | Required |
|---|---|---|
| Vat Number | In the «Settings» window: the company's VAT number; kept in the company's data.15 digits starting and ending with 3, otherwise saving is refused. | No |
| Search... | On the «Invoices» tab: searches every value of a row, but only in the ten rows shown. | No |
| Type | The column shows the invoice's own type: standard, simplified, credit note or debit note (an invoice with no type shows as standard). The program sends as simplified, for reporting, an invoice marked simplified or one whose customer has no VAT number and no CR number; otherwise as standard, for clearance. So a row reading «Standard» can be reported, not cleared. | No |
| Cleared or reported | A card on the «Dashboard»: cleared and reported invoices divided by every invoice in the list, sent or not. | No |
| Setup checklist | Ten items on the «Checklist» tab, ticked from the units: a VAT number saved; a unit registered; a compliance certificate; a production certificate; a key; signing ready (a key and a compliance certificate); QR and hash (a production certificate); clearance for standard and reporting for simplified (a live unit issuing that type). The list does not name the environment. | No |
| Branch | The branch name written in the unit's certificate request. Left empty, the program takes the company's city, or «Head Office». | No |
| Invoices issued by this unit | The invoices the unit issues: standard and simplified, standard only, or simplified only. The program picks by it the unit that signs each invoice, and the number of compliance-check documents: six for both, three for one type. | No |
| ZATCA environment | The ZATCA environment the unit is registered in: simulation (the first choice), production, or the developer sandbox. The program calls it for every request of the unit, and no button changes it after registration. | No |
| OTP (6 digits) | The one-time code the company generates on the Fatoora portal for this environment. The program sends it to ZATCA with the certificate request.6 digits; the box takes digits only and the button stays disabled until they are complete. | Yes |
Buttons and actions
| Button | When it shows | What it does | Posts |
|---|---|---|---|
| Export | At the top of the page. | On the «Invoices» tab it saves the rows shown as a CSV file; the other three tabs have no table, so it says there is nothing to export. | No |
| Register unit | At the top of the page, and on the «Certificates» tab. | At the top it takes you to the «Certificates» tab; on that tab it opens the register window: the branch, the invoices it issues, and the ZATCA environment. | No |
| Settings | At the top of the page. | Opens a window with the company's VAT number and a note that the units' keys are generated on the server. | No |
| Save | In the «Settings» window. | Saves the VAT number on the company. | No |
| Refresh | On the «Invoices» tab. | Reads the list again from the program. | No |
| Submit | For an invoice never sent, neither draft nor cancelled. | Checks the invoice, signs it with a live unit issuing its type, sends it to ZATCA in that unit's environment and keeps the answer. If ZATCA refuses it, its reasons show. | No |
| Resend | For an invoice in «Not delivered — resend». | Sends the same signed document again, with its counter and hash, without signing anew. | No |
| QR code | Beside each invoice. | Draws in the browser the QR code kept for the invoice after it was sent, and its hash; before sending it says there is none yet. | No |
| Download XML | Beside each invoice. | Always says «No XML yet», even for an invoice that was sent; it downloads nothing. | No |
| Register | In the «Register unit» window. | Generates the unit's key and certificate request on the server from the company's data, and keeps the key sealed. It does not call ZATCA yet. Refused when the company's country is not Saudi Arabia or its VAT number is not 15 digits starting and ending with 3. | No |
| Enter OTP | For a unit with no compliance certificate. | Opens the one-time code window. | No |
| Request compliance CSID | In the one-time code window, after the six digits. | Sends the certificate request and the code to ZATCA in the unit's environment. If ZATCA accepts, the compliance certificate is kept and its secret sealed; if it refuses, ZATCA's reasons show and «Enter OTP» stays, to try again with a new code. | No |
| Run compliance checks | For a unit with a compliance certificate, not yet live. | Signs test documents from the company's data (an invoice, a credit note and a debit note for each type the unit issues) and sends them to ZATCA's checker. If all pass, the list of documents and each result shows; if not, only a general message shows. | No |
| Obtain production CSID | After the compliance checks passed, for a unit not yet live. | Asks ZATCA for the production certificate and keeps it: the unit becomes «Live» and signs and sends invoices in its environment. | No |
The document's statuses
- Not submitted: The invoice has not been sent to ZATCA.
- Pending: The invoice is signed and being sent; a passing moment.
- Cleared: ZATCA cleared the standard invoice; the stamped invoice and its code are kept.
- Reported: The simplified invoice was reported to ZATCA, in the simulation or production.
- Accepted: ZATCA accepted the document without clearing or reporting it: for example, on the developer portal, a simplified invoice only ZATCA's checker read.
- Rejected: ZATCA rejected the invoice: its reasons show in the message after «Submit»; the list keeps only the badge. It is not resent as it is, and «Submit» does not show for it on this page.
- Not delivered — resend: The invoice did not reach ZATCA; it is sent again with «Resend» or automatically every 15 minutes for seven days.
- Live: The badge of a unit with a production certificate, in any environment; the environment is written under its name.
- Onboarding: A unit without its production certificate yet.
Permissions
| To | Permission needed |
|---|---|
| Open the invoice list and statuses (the sales view right is enough) | Sales — View |
| … or the accounting view right | Accounting — View |
| «Submit» an invoice to ZATCA and «Resend» (the sales edit right is enough) | Sales — Edit |
| … or the accounting edit right | Accounting — Edit |
| See the units, the status card and the checklist | Accounting — View |
| Save the VAT number, register a unit, request certificates and run the compliance checks | Settings — Edit |
Refusals and fixes
NO_PRODUCTION_UNITYou pressed «Submit» and no live unit issues this invoice's type (standard or simplified).
Fix: Complete the onboarding of a unit issuing this type on the «Certificates» tab.
NOT_READYThe invoice, the company's or the customer's data lacks something the e-invoice needs; the first missing item is named.
Fix: Complete what is named, then submit again.
NOT_POSTEDThe invoice's status is not a posted one, and only posted documents go to ZATCA.
Fix: Issue the invoice on the invoices page, then submit it.
VALIDATION_ERRORThe VAT number in the «Settings» window is not 15 digits starting and ending with 3.
Fix: Correct the number and save.
COMPANY_INCOMPLETEYou registered a unit while the company's country in its settings is not Saudi Arabia, or its VAT number is not 15 digits starting and ending with 3. «Run compliance checks» also sends it when a test document fails the program's own checks before it is sent.
Fix: Set the company's country and VAT number in Settings ▸ Company (for the compliance checks, complete the company data the message names), then try again.
ZATCA_REJECTEDZATCA refused the certificate request, for example because the code was wrong or made for another environment. ZATCA's reasons are shown.
Fix: Generate a new code on the Fatoora portal for the unit's own environment, then ask again; the screen's help says a code is valid for one hour.
VAULT_NOT_CONFIGUREDThe server has no sealing key to keep the unit's key with, so nothing was stored.
Fix: This is the server's setup, not the screen's: tell support.
Related pages
Educational content for general understanding, not accounting, tax or legal advice. Sources · About the Academy