Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions apps/saudi-arabia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import FAQ from '/snippets/faqs/sa/composers/app-zatca.mdx';
<Columns cols="2">
<div>
<br />
<Card horizontal title="Clearance & Reporting Guide" icon="https://assets.invopop.com/flags/sa.svg" href="/guides/sa-zatca-clearance-reporting">
<Card horizontal title="Clearance & reporting guide" icon="https://assets.invopop.com/flags/sa.svg" href="/guides/sa-zatca-clearance-reporting">
View guide ›
</Card>
<Card horizontal title="Supplier registration guide" icon="https://assets.invopop.com/flags/sa.svg" href="/guides/sa-zatca-registration">
View guide ›
</Card>
</div>
Expand Down Expand Up @@ -54,15 +57,18 @@ import FAQ from '/snippets/faqs/sa/composers/app-zatca.mdx';
The following workflow actions will be available once you install and enable this app.

Registration
<Card title="Register Party" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
<Card title="Register supplier with ZATCA" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
Validate the party, stake the VAT claim, and publish the ZATCA onboarding link the supplier follows.
</Card>
<Card title="Wait for Authorization" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
<Card title="Unregister supplier from ZATCA" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
Removes the party and its stored credentials from Invopop's internal systems.
</Card>
Comment on lines +63 to +65
<Card title="Wait for ZATCA OTP authorization" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
Wait for the supplier to complete onboarding, run the compliance checks, and issue the production CSID.
</Card>

Clearance & Reporting
<Card title="Send Invoice" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
<Card title="Send invoice to ZATCA" icon="https://assets.invopop.com/apps/zatca/icon.svg" horizontal>
<div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 1</div>
Convert the GOBL invoice to UBL 2.1, chain it (ICV/PIH), and clear standard or report simplified invoices to ZATCA.
</Card>
Expand Down
Binary file added assets/guides/sa-register-supplier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/sa-send-invoice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/sa-wizard-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/sa-wizard-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/sa-wizard-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/sa-wizard-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/guides/sa-wizard-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 13 additions & 9 deletions guides/sa-zatca-clearance-reporting.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Saudi Arabia ZATCA clearance & reporting"
title: "ZATCA clearance & reporting in Saudi Arabia"
sidebarTitle: "Clearance & Reporting"
description: Clear standard invoices in real time and report simplified invoices to ZATCA.
---
Expand All @@ -10,10 +10,10 @@ import SaAccordion from '/snippets/invoices/sa/sa-accordion.mdx';
import FAQ from '/snippets/faqs/sa/composers/guide-zatca-invoicing.mdx';

<Note>
This flow requires a party that has completed [registration](/guides/sa-zatca-registration). The same workflow handles both models. Invopop picks clearance or reporting from the invoice itself.
Make sure you have completed the [registration guide](/guides/sa-zatca-registration) before clearing or reporting invoices.
</Note>

Saudi Arabia runs two e-invoicing flows, and both are driven by the **same GOBL invoice** with the ZATCA add-on. A single send workflow converts the document to UBL 2.1, chains it, signs it, and submits it to the right ZATCA endpoint:
Saudi Arabia runs two e-invoicing flows, and both are driven by the **same GOBL invoice** with the ZATCA add-on. A single send workflow converts the document to UBL 2.1, chains it, signs it, and submits it to the corresponding ZATCA endpoint:

| Flow | Invoices |
|---|---|
Expand All @@ -26,15 +26,19 @@ The send workflow claims the next ICV, builds and hashes the UBL document, signs

### How it works

<Frame caption="ZATCA send invoice workflow">
<img src="/assets/guides/sa-send-invoice.png" width="580" />
</Frame>
Comment on lines +29 to +31

<Steps>
<Step title="Set State → processing">
Moves the invoice into a visible "in progress" state for operator dashboards.
<Step title="Set State → Processing">
Sets the state of the silo entry as "Processing".
</Step>
Comment on lines +34 to 36
<Step title="Send to ZATCA">
<Step title="Send invoice to ZATCA">
Converts the GOBL invoice to UBL 2.1, adds the ICV and PIH chain values, hashes the document, and submits it to the clearance or reporting flows.
</Step>
<Step title="Set Statesent">
Marks the invoice as successfully cleared or reported.
<Step title="Set stateSent">
Marks the silo entry as "Sent"
</Step>
Comment on lines +40 to 42
</Steps>

Expand All @@ -56,7 +60,7 @@ The send workflow claims the next ICV, builds and hashes the UBL document, signs

## Credit and debit notes

Issued invoices cannot be cancelled or edited once cleared or reported. Corrections are made with **credit notes** (reduction) or **debit notes** (increase) that reference the original invoice. A note flows through the same clearance or reporting model as the document it corrects, using the same send workflow.
Issued invoices can't be cancelled or edited once cleared or reported. Corrections are made with **credit notes** (reduction) or **debit notes** (increase) that reference the original invoice. A note flows through the same clearance or reporting model as the document it corrects, using the same send workflow.

## Example invoices

Expand Down
52 changes: 37 additions & 15 deletions guides/sa-zatca-registration.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Saudi Arabia ZATCA registration"
title: "ZATCA supplier registration in Saudi Arabia"
sidebarTitle: "Registration"
description: Onboard a Saudi VAT-registered party with ZATCA and provision its production CSID.
---
Expand Down Expand Up @@ -37,24 +37,28 @@ The two modes target different ZATCA sandbox endpoints and differ mainly in how

Registration spans two parts: a workflow you run against the party document, and a hosted onboarding wizard the supplier completes to provide the FATOORA OTP.

<Frame caption="ZATCA register supplier">
<img src="/assets/guides/sa-register-supplier.png" width="640" />
</Frame>
Comment on lines +40 to +42

<Steps>
<Step title="Set State → processing">
Moves the silo entry into a visible "in progress" state so operator dashboards reflect that onboarding is underway.
<Step title="Set State → Processing">
Sets the state of the silo entry as "Processing".
</Step>
Comment on lines +45 to 47
<Step title="Register Party">
Validates the party's identity (one of `CRN`, `MOM`, `MLS`, `700`, `SAG`, or `OTH`) and full address and publishes a public onboarding link in the meta section of the party. The supplier follows this link to complete the wizard below.
<Step title="Register supplier with ZATCA">
Validates the party's identity and full address, then publishes a public onboarding link in the meta section of the party. The supplier follows this link to complete the onboarding wizard.
</Step>
<Step title="Wait for Authorization">
Pauses until the supplier finishes the wizard and a Compliance CSID exists. It then submits the mandatory compliance sample invoices and exchanges the Compliance CSID for the **Production CSID**.
<Step title="Wait for ZATCA certificate upload">
Pauses until the supplier uploads the compliance CSID. It will then submit the mandatory compliance sample invoices and swaps the Compliance CSID with the Production CSID.
</Step>
Comment on lines +51 to 53
<Step title="Set State → registered">
Marks the party as fully onboarded and ready to clear and report invoices.
<Step title="Set State → Registered">
Sets the state of the silo entry as "Registered".
</Step>
Comment on lines +54 to 56
</Steps>

<Tabs>
<Tab title="Template">
<Card iconType="duotone" title="Saudi Arabia register party workflow" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=sa-sa-register" cta="Add to my workspace">
<Card iconType="duotone" title="ZATCA register party workflow" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=sa-sa-register" cta="Add to my workspace">
Publishes the ZATCA onboarding link and provisions the party's production CSID.
</Card>
</Tab>
Expand All @@ -66,30 +70,48 @@ Registration spans two parts: a workflow you run against the party document, and

## The onboarding wizard

The link published by **Register Party** opens a hosted wizard the supplier completes once:
The link published by **Register Party** provides an onboarding wizard for the supplier to complete:

<Steps>
<Step title="Company details">
<Frame caption="Company details screen">
<img src="/assets/guides/sa-wizard-1.png" width="640" />
</Frame>
The supplier confirms the legal name and provides the **invoice type** (`1000` standard, `0100` simplified, or `1100` both), **branch name**, **registered address**, and **business category**. These values feed the certificate request.
</Step>
<Step title="Get the OTP from FATOORA">
<Frame caption="FATOORA instructions screen">
<img src="/assets/guides/sa-wizard-2.png" width="640" />
</Frame>
The supplier signs in to the FATOORA portal and generates a One-Time Password for the EGS unit. The wizard shows the relevant FATOORA screens.
</Step>
<Step title="Enter the OTP">
<Frame caption="OTP Code screen">
<img src="/assets/guides/sa-wizard-3.png" width="640" />
</Frame>
The supplier pastes the OTP and reviews the recap of the details that will be sent to ZATCA.
</Step>
<Step title="Confirm details">
<Frame caption="Confirmation screen">
<img src="/assets/guides/sa-wizard-4.png" width="640" />
</Frame>
Here you will make sure all the details you entered were correct. Click "Back" if you need to change anything.
</Step>
<Step title="Submit">
Invopop requests the **Compliance CSID**, and stores the credentials. This unblocks the **Wait for Authorization** step in the workflow.
<Frame caption="Submission screen">
<img src="/assets/guides/sa-wizard-5.png" width="640" />
</Frame>
Upon submit, Invopop requests the **Compliance CSID**, and stores the credentials. This unblocks the **Wait for Authorization** step in the workflow.
</Step>
</Steps>

<Info>
The invoice type chosen here determines which compliance samples Invopop submits: `1000` runs standard tax invoices, credit notes, and debit notes; `0100` runs the simplified equivalents; `1100` runs both sets.
</Info>

## Unregistration
## Unregistration (sandbox only)

Unregistering a party from ZATCA is handled by the **tax payers**, directly in the **FATOORA portal**, signing in with their own credentials.
Unregistering a party from ZATCA in production environment is handled by the **tax payers**, directly in the **FATOORA portal**, signing in with their own credentials.

Invopop also provides an unregister action that removes the party and its stored credentials from **Invopop's internal systems only**. It does not touch the party's registration with ZATCA.
Comment on lines +112 to 116

Expand All @@ -99,7 +121,7 @@ Invopop also provides an unregister action that removes the party and its stored

<Tabs>
<Tab title="Template">
<Card iconType="duotone" title="Saudi Arabia unregister party workflow" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=sa-sa-unregister" cta="Add to my workspace">
<Card iconType="duotone" title="ZATCA unregister supplier workflow (sandbox only)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=sa-sa-unregister" cta="Add to my workspace">
Removes the party's registration and stored credentials from Invopop's internal systems.
</Card>
</Tab>
Expand Down
14 changes: 7 additions & 7 deletions snippets/workflows/sa/sa-register.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: "Register supplier in ZATCA"
title: "ZATCA register supplier"
description: "Registers a supplier with ZATCA and provisions its production CSID"
countryCode: "sa"
appId: "gov-sa"
schema: "org/party"
---
```json Register supplier in ZATCA
{
"name": "Register supplier in ZATCA",
"name": "ZATCA register supplier",
"description": "",
Comment on lines 8 to 11
"schema": "org/party",
"steps": [
{
"id": "f60b2e30-6fce-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `processing`{.state .processing}",
"config": {
Expand All @@ -22,7 +22,7 @@ schema: "org/party"
},
{
"id": "fd448bb0-6fce-11f1-b09d-79f60b032746",
"name": "Register supplier in ZATCA",
"name": "Register supplier with ZATCA",
"provider": "gov-sa.party.register",
"summary": "Developer Portal",
"config": {
Expand All @@ -31,12 +31,12 @@ schema: "org/party"
},
{
"id": "0064b770-6fcf-11f1-b09d-79f60b032746",
"name": "Wait for authorization",
"name": "Wait for ZATCA OTP authorization",
"provider": "gov-sa.wait.authorization"
},
{
"id": "0236df60-6fcf-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `registered`{.state .registered}",
"config": {
Expand All @@ -47,7 +47,7 @@ schema: "org/party"
"rescue": [
{
"id": "04aa0240-6fcf-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `error`{.state .error}",
"config": {
Expand Down
14 changes: 7 additions & 7 deletions snippets/workflows/sa/sa-send-invoice.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: "Send to ZATCA"
title: "ZATCA send invoice"
description: "Clears standard invoices and reports simplified invoices to ZATCA"
countryCode: "sa"
appId: "gov-sa"
schema: "bill/invoice"
---
```json Send to ZATCA
{
"name": "Send to ZATCA",
"description": "",
"name": "ZATCA send invoice",
"description": "Clears standard invoices and reports simplified invoices to ZATCA",
Comment on lines 8 to +11
"schema": "bill/invoice",
"steps": [
{
"id": "cf001030-6fce-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `processing`{.state .processing}",
"config": {
Expand All @@ -22,12 +22,12 @@ schema: "bill/invoice"
},
{
"id": "d0badf90-6fce-11f1-b09d-79f60b032746",
"name": "Send to ZATCA",
"name": "Send invoice to ZATCA",
"provider": "gov-sa.invoice.send"
},
{
"id": "d5f9cca0-6fce-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `sent`{.state .sent}",
"config": {
Expand All @@ -38,7 +38,7 @@ schema: "bill/invoice"
"rescue": [
{
"id": "d9c3a5e0-6fce-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `error`{.state .error}",
"config": {
Expand Down
14 changes: 7 additions & 7 deletions snippets/workflows/sa/sa-unregister.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: "Unregister supplier in ZATCA"
title: "ZATCA unregister supplier"
description: "Removes a supplier's registration from Invopop's internal systems"
countryCode: "sa"
appId: "gov-sa"
schema: "org/party"
---
```json Unregister supplier in ZATCA
{
"name": "Unregister supplier in ZATCA",
"description": "",
"name": "ZATCA unregister supplier",
"description": "Removes a supplier's registration from Invopop's internal systems",
Comment on lines 8 to +11
"schema": "org/party",
"steps": [
{
"id": "572ac450-6fcf-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `processing`{.state .processing}",
"config": {
Expand All @@ -22,12 +22,12 @@ schema: "org/party"
},
{
"id": "5c0e9910-6fcf-11f1-b09d-79f60b032746",
"name": "Unregister supplier in ZATCA",
"name": "Unregister supplier from ZATCA",
"provider": "gov-sa.party.unregister"
},
{
"id": "5e800e40-6fcf-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `void`{.state .void}",
"config": {
Expand All @@ -38,7 +38,7 @@ schema: "org/party"
"rescue": [
{
"id": "60e4d940-6fcf-11f1-b09d-79f60b032746",
"name": "Set State",
"name": "Set state",
"provider": "silo.state",
"summary": "Set state to `error`{.state .error}",
"config": {
Expand Down