Go live in Saudi Arabia

Work through this checklist before you send Saudi invoices to ZATCA in production. You need Saudi documents that already pass in sandbox and access to the company's account on ZATCA's FATOORA portal.

Onboard the company in production

A company onboarded in sandbox is not registered in production.

  1. In the Invoice Portal, select Saudi Arabia and Production.
  2. Follow Onboard a Saudi Arabian company with the company’s real details.
  3. At Enter OTP, enter a code the company generates on the FATOORA portal.

You should see the screen that confirms the registration. This registers the company’s e-invoicing identity with ZATCA.

Create a production API key

In Developer portal › API keys, create a key under Production API keys. Give it Write access if it sends invoices. See Create an API key.

With Production selected, open Source management and link the source you added during onboarding to your integration mapping and the company’s branch. See Manage sources and their links.

Pass the required test cases

Check that the test cases for Saudi Arabia show Passed in Test your mapping. If your workspace uses the Default GETS Mapping, production documents are refused with 412 until they do.

Switch your requests to production

  • Load the production key in place of the sandbox key.
  • Send "environment": "production" in every Unify request.
  • Set source to the production source’s name:version.
  • If you use an SDK, change its environment setting to production. Each SDK guide shows where.

Check credits and webhooks

  • In the Invoice Portal, open Credits with Production selected and check the balance. See Check your credit balance and usage.
  • If you receive purchase invoices through webhooks, create a separate webhook for Production that points to your live endpoint. See Set up a webhook.

Send the first production invoice

Send one real invoice and follow it with its documentId until isTerminal is true. See Submit and retrieve. final_valid means ZATCA accepted it. rejected or final_invalid means it did not: read errors and government for the reason.

Saudi checks

  • Production documents go to ZATCA’s production system. They are real tax invoices: correct one with a credit or debit note rather than sending it again.
  • Use the company’s own VAT number in the seller’s details. It must match the company you onboarded.
  • Check each document type against the Saudi Arabia field reference and the validation rules.

If something goes wrong

The OTP is rejected: generate a new code on the FATOORA portal for this company and enter it before it expires.

403 with permission_denied: the key is a sandbox key. Use a production key with "environment": "production".

404: the source is not in production. Check its name and version in Source management with Production selected.

412 with failed_precondition: the required test cases for Saudi Arabia have not all passed. Run them, then send the document again.

ZATCA rejects the document: read the rule identifier in the status, such as a BR-KSA-* rule, and look it up in Saudi Arabia validation rules.

Last updated