This document provides instructions for integrating with the ZATCA Invoice APIs for submitting sales invoices and generating PDF/A-3 invoices with embedded XML.These APIs provide functionality that can be used for submitting invoices to ZATCA from a third-party invoicing system. Users need to create an intermediary server on Claudion.com before proceeding with this. For more details and clarifications, please contact support@claudion.com. We also have a Swagger page on the Claudion.com portal to assist developers.
-
📘 Postman Documentation:
View the full API reference here -
🧾 Swagger UI Reference:
Access Swagger docs here
This repo is referenced in the Postman documentation.
You can view it directly in Postman under:
"You can see the GitHub repository for this app here"
This API allows third-party systems to submit invoices to ZATCA through an intermediary server. It handles all cases, including the first submission and subsequent calls to check the status.
On first submission, the intermediary server will attempt to post the invoice to ZATCA immediately. In case of success, the intermediary server will respond to the user with the QR code, XML, and full ZATCA response.
If the intermediary server fails to receive a response from ZATCA immediately, it will respond with a "Waiting for Response" status. For any subsequent calls for the same invoice, the intermediary server will respond with the QR code, XML, and ZATCA response if available. Otherwise, it will return either a "Pending" or "Error" status. In such cases, the user needs to either re-submit (in case of "Pending") or correct the error (in case of "Error").
Details are as follows:
As mentioned above, This API allows users to create and submit a Sales Invoice by providing customer details, a unique invoice number, items, taxes, and other relevant parameters. Upon successful creation, the invoice is submitted to ZATCA and the API returns the Sales Invoice number, UUID, ZATCA response, generated XML, and a link to download the QR code image.
Functionality
- If an invoice with the provided custom_user_invoice_number already exists in the system, the API will fetch the corresponding Sales Invoice, extract and decode the associated ZATCA XML, and retrieve the link to download the QR image . Instead of creating a new invoice, it returns the existing invoice details in the response with a 200 status, ensuring no duplicates are created and allowing clients to reuse previously submitted data.
- If a customer with the provided name does not already exist, the API will automatically create a new Customer record, defaulting the customer type to "Individual" and assigning them to the "Demo Customer Group.
- For each item in the provided list, the API checks whether the item exists in the system. If not, it automatically creates the item under the "All Item Groups" category. Key fields such as description, price, tax template, and income account are validated to ensure completeness before adding the item to the invoice.
- The API constructs a new Sales Invoice using the provided customer, posting date, and due date. It includes all specified line items along with any tax configurations applied. Optional discounts can be set either as a percentage or a fixed amount. Additionally, custom fields such as custom_user_invoice_number and custom_zatca_tax_category are included to support personalized tracking and ZATCA compliance.
- Once the invoice is submitted, the system reloads it to check for a ZATCA response. If ZATCA returns a "503 Service Unavailable" error, the API responds with a 503 status and includes the UUID along with the full ZATCA response. If there is no response from ZATCA yet, it returns a 202 Accepted status with the message "Waiting for response." In such cases, if the API is called again with the same custom_user_invoice_number, it will return the same invoice details. If ZATCA responds successfully, the API extracts and decodes the XML, embeds the QR image (via direct link), and returns all relevant fields in the final JSON response.
- If is_return is set to 1, the API creates a Return Sales Invoice (Credit Note) linked to the original invoice using the return_against field. It ensures that return_against is provided, and automatically converts all item quantities to negative values to represent a return. This process maintains correct stock, customer balances, and full traceability between the original and returned invoices.
- The API supports applying discounts at both the item level (per line item) and the document level (overall invoice discount). Taxes can be applied either through the Item Tax Template (specific to each item) or by setting a general Tax Category at the invoice level, along with an optional Exemption Reason Code to comply with specific tax regulations.
- The API allows handling both tax-inclusive and tax-exclusive item rates. If the tax setting included_in_print_rate is set to 1, the item prices are treated as tax-inclusive (i.e., tax is already included in the item rate). If included_in_print_rate is 0 or not set, the item prices are considered tax-exclusive, and taxes are added separately on top of the item rate during invoice calculation.EndFragment
- If income_account, charge_type, or account_head are not provided in the API request, the system will automatically fall back to values defined in the Intermediate Server Setting single Doctype.
- In the create_simple_sales_invoice API, the tax_id parameter is used to set the customer's tax identification number. This field is applied when the invoice is for a business (i.e., is_b2c is set to 0). If the customer does not already exist, the API will create a new customer and assign the provided tax_id for B2B transactions. For B2C transactions (is_b2c = 1), the tax_id can be blank.
curl --location 'https://zatca.erpgulf.com:3717/api/method/zatca_erpgulf_sync.zatca_erpgulf_sync.invoice_sync.create_simple_sales_invoice' \
--header 'Content-Type: application/json' \
--header 'Cookie: full_name=Guest; sid=Guest; system_user=yes; user_id=Guest; user_image=' \
--data '{
"customer_name": "customer1234",
"custom_user_invoice_number": "IND-989098",
"tax_id" : 311523216200003,
"posting_date": "2025-11-06",
"due_date": "2025-11-20",
"discount_amount": 10,
"tax_category": "Standard",
"custom_exemption_reason_code":"Standard 15%",
"is_b2c": false,
"is_return": 0,
"return_against": "ACC-SINV-2025-00815",
"items": [
{
"item_name": "Tpppshirt",
"quantity": 1,
"rate": 800,
"income_account": "",
"description": "High-quality T-shirt",
"discount_amount": 20,
"item_tax_template" : "zero rated - ZA"
}
],
"taxes": [
{
"charge_type": "",
"account_head": "",
"rate": 0,
"description": "VAT",
"included_in_print_rate": 0
}
]
}
'
{
"data": {
"invoice_id": "ACC-SINV-2025-00826",
"uuid": "2611e100-2598-11f0-b7e4-020017019f27",
"zatca_full_response": "SUCCESS: <br><br>Status Code: 200<br><br>Zatca Response: {\"validationResults\":{\"infoMessages\":[{\"type\":\"INFO\",\"code\":\"XSD_ZATCA_VALID\",\"category\":\"XSD validation\",\"message\":\"Complied with UBL 2.1 standards in line with ZATCA specifications\",\"status\":\"PASS\"}],\"warningMessages\":[],\"errorMessages\":[],\"status\":\"PASS\"},\"clearanceStatus\":\"CLEARED\",\"clearedInvoice\":\"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPEludm9pY2UgeG1sbnM9InVybjpvYXNpczpuYW1lczpzcGVjaWZpY2F0aW9uOnVibDpzY2hlbWE6eHNkOkludm9pY2UtMiIgeG1sbnM6Y2FjPSJ1cm46b2FzaXM6bmFtZXM6c3BlY2lmaWNhdGlvbjp1Ymw6c2NoZW1hOnhzZDpDb21tb25BZ2dyZWdhdGVDb21wb25lbnRzLTIiIHhtbG5zOmNiYz0idXJuOm9hc2lzOm5hbWVzOnNwZWNpZmljYXRpb246dWJsOnNjaGVtYTp4c2Q6Q29tbW9uQmFzaWNDb21wb25lbnRzLTIiIHhtbG5zOmV4dD0idXJuOm9hc2lzOm5hbWVzOnNwZWNpZmljYXRpb246dWJsOnNjaGVtYTp4c2Q6Q29tbW9uRXh0ZW5zaW9uQ29tcG9uZW50cy0yIj48ZXh0OlVCTEV4dGVuc2lvbnM+CiAgICA8ZXh0OlVCT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bmZvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOkNhbm9uaWNhbGl6YXRpb25NZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDA2LzEyL3htbC1jMTRuMTEiLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkczpTaWduYXR1cmVNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNlY2RzYS1zaGEyNTYiLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkczpSZWZlcmVuY2UgSWQ9Imludm9pY2VTaWduZWREYXRhIiBVUkk9IiI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOlRyYW5zZm9ybXM+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkczpUcmFuc2Zvcm0gQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy9UUi8xOTk5L1JFQy14cGF0aC0xOTk5MTExNiI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZHM6WFBhdGg+bm90KC8vYW5jZXN0b3Itb3Itc2VsZjo6ZXh0OlVCTEV4dGVuc2lvbnMpPC9kczpYUGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kczpUcmFuc2Zvcm0+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkczpUcmFuc2Zvcm0gQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy9UUi8xOTk5L1JFQy14cGF0aC0xOTk5MTExNiI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZHM6WFBhdGg+bm90KC8vYW5jZXN0b3Itb3Itc2VsZjo6Y2FjOlNpZ25hdHVyZSk8L2RzOlhQYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2RzOlRyYW5zZm9ybT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnL1RSLzE5OTkvUkVDLXhwYXRoLTE5OTkxMTE2Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkczpYUGF0aD5ub3QoLy9hbmNlc3Rvci1vci1zZWxmOjpjYWM6QWRkaXRpb25hbERvY3VtZW50UmVmZXJlbmNlW2NiYzpJRD0nUVInXSk8L2RzOlhQYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2RzOlRyYW5zZm9ybT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDYvMTIveG1sLWMxNG4xMSIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZHM6VHJhbnNmb3Jtcz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZHM6RGlnZXN0TWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxlbmMjc2hhMjU2Ii8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOkRpZ2VzdFZhbHVlPjJyeVArWjJERVBEWGt1NmxxbW9KVWdVSmFvZUV0Z1l4a25MczluVnlkckU9PC9kczpEaWdlc3RWYWx1ZT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZHM6UmVmZXJlbmNlPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOlJlZmVyZW5jZSBUeXBlPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjU2lnbmF0dXJlUHJvcGVydGllcyIgVVJJPSIjeGFkZXNTaWduZWRQcm9wZXJ0aWVzIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZHM6RG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ICAgICAgICAgICAgICAgICAgICAgICAgICAgPHhhZGVzOlNpZ25pbmdDZXJ0aWZpY2F0ZT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8eGFkZXM6Q2VydD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHhhZGVzOkNlcnREaWdlc3Q+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZHM6RGlnZXN0TWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxlbmMjc2hhMjU2Ii8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZHM6RGlnZXN0VmFsdWU+WkRNd01tSTBNVEUxTnpWak9UVTJOVGs0WXpWbE9EaGhZbUkwT0RVMk5EVXlOVFUyWVRWaFlqaGhNREZtTjJGallqazFZVEEyT1dRME5qWTJNalE0TlE9PTwvZHM6RGlnZXN0VmFsdWU+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwveGFkZXM6Q2VydERpZ2VzdD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHhhZGVzOklzc3VlclNlcmlhbD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkczpYNTA5SXNzdWVyTmFtZT5DTj1QUlpFSU5WT0lDRVNDQTQtQ0EsIERDPWV4dGdhenQsIERDPWdvdiwgREM9bG9jYWw8L2RzOlg1MDlJc3N1ZXJOYW1lPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRzOlg1MDlTZXJpYWxOdW1iZXI+Mzc5MTEyNzQyODMxMzgwNDcxODM1MjYzOTY5NTg3Mjg3NjYzNTIwNTI4Mzg3PC9kczpYNTA5U2VyaWFsTnVtYmVyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3hhZGVzOklzc3VlclNlcmlhbD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3hhZGVzOkNlcnQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3hhZGVzOlNpZ25pbmdDZXJ0aWZpY2F0ZT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC94YWRlczpTaWduZWRTaWduYXR1cmVQcm9wZXJ0aWVzPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwveGFkZXM6U2lnbmVkUHJvcGVydGllcz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwveGFkZXM6UXVhbGlmeWluZ1Byb3BlcnRpZXM+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvZHM6T2JqZWN0PgogICAgICAgICAgICAgICAgICAgIDwvZHM6U2lnbmF0dXJlPgogICAgICAgICAgICAgICAgPC9zYWM6U2lnbmF0dXJlSW5mb3JtYXRpb24+CiAgICAgICAgICAgIDwvc2lnOlVCTERvY3VtZW50U2lnbmF0dXJlcz4KICAgICAgICA8L2V4dDpFeHRlbnNpb25Db250ZW50PgogICAgPC9leHQ6VUJMRXh0ZW5zaW9uPgo8L2V4dDpVQkxFeHRlbnNpb25zPgogIAogIDxjYmM6UHJvZmlsZUlEPnJlcG9ydGluZzoxLjA8L2NiYzpQcm9maWxlSUQ+CiAgPGNiYzpJRD5BQ0MtU0lOVi0yMDI1LTAwODI2PC9jYmM6SUQ+CiAgPGNiYzpVVUlEPjI2MTFlMTAwLTI1OTgtMTFmMC1iN2U0LTAyMDAxNzAxOWYyNzwvY2JjOlVVSUQ+CiAgPGNiYzpJc3N1ZURhdGU+MjAyNS0wNC0zMDwvY2JjOklzc3VlRGF0ZT4KICA8Y2JjOklzc3VlVGltZT4xMDo1MzowNDwvY2JjOklzc3Vl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bnQgY3VycmVuY3lJRD0iU0FSIj4wLjAwPC9jYmM6VGF4QW1vdW50PgogICAgICA8Y2JjOlJvdW5kaW5nQW1vdW50IGN1cnJlbmN5SUQ9IlNBUiI+NzgwLjAwPC9jYmM6Um91bmRpbmdBbW91bnQ+CiAgICA8L2NhYzpUYXhUb3RhbD4KICAgIDxjYWM6SXRlbT4KICAgICAgPGNiYzpOYW1lPklNUC0wMDAyMTpUcHBwc2hpcnQ8L2NiYzpOYW1lPgogICAgICA8Y2FjOkNsYXNzaWZpZWRUYXhDYXRlZ29yeT4KICAgICAgICA8Y2JjOklEPlo8L2NiYzpJRD4KICAgICAgICA8Y2JjOlBlcmNlbnQ+MC4wMDwvY2JjOlBlcmNlbnQ+CiAgICAgICAgPGNhYzpUYXhTY2hlbWU+CiAgICAgICAgICA8Y2JjOklEPlZBVDwvY2JjOklEPgogICAgICAgIDwvY2FjOlRheFNjaGVtZT4KICAgICAgPC9jYWM6Q2xhc3NpZmllZFRheENhdGVnb3J5PgogICAgPC9jYWM6SXRlbT4KICAgIDxjYWM6UHJpY2U+CiAgICAgIDxjYmM6UHJpY2VBbW91bnQgY3VycmVuY3lJRD0iU0FSIj43ODAuMDAwMDAwPC9jYmM6UHJpY2VBbW91bnQ+CiAgICA8L2NhYzpQcmljZT4KICA8L2NhYzpJbnZvaWNlTGluZT4KPC9JbnZvaWNlPg==\"}<br><br>",
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\" xmlns:ext=\"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2\"><ext:UBLExtensions>\n <ext:UBLExtension>\n <ext:ExtensionURI>urn:oasis:names:specification:ubl:dsig:enveloped:xades</ext:ExtensionURI>\n <ext:ExtensionContent>\n <sig:UBLDocumentSignatures xmlns:sig=\"urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2\" xmlns:sac=\"urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2\" xmlns:sbc=\"urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2\">\n <sac:SignatureInformation> \n <cbc:ID>urn:oasis:names:specification:ubl:signature:1</cbc:ID>\n <sbc:ReferencedSignatureID>urn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>\n <ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"signature\">\n <ds:SignedInfo>\n <ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2006/12/xml-c14n11\"/>\n <ds:SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\"/>\n <ds:Reference Id=\"invoiceSignedData\" URI=\"\">\n <ds:Transforms>\n <ds:Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\">\n <ds:XPath>not(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>\n </ds:Transform>\n <ds:Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\">\n <ds:XPath>not(//ancestor-or-self::cac:Signature)</ds:XPath>\n </ds:Transform>\n <ds:Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\">\n <ds:XPath>not(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID='QR'])</ds:XPath>\n </ds:Transform>\n <ds:Transform Algorithm=\"http://www.w3.org/2006/12/xml-c14n11\"/>\n </ds:Transforms>\n <ds:DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\"/>\n <ds:DigestValue>2ryP+Z2DEPDXku6lqmoJUgUJaoeEtgYxknLs9nVydrE=</ds:DigestValue>\n </ds:Reference>\n <ds:Reference Type=\"http://www.w3.org/2000/09/xmldsig#SignatureProperties\" URI=\"#xadesSignedProperties\">\n <ds:DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\"/>\n <ds:DigestValue>MmMyODdhYzVkNjY0MzZlZmJlNDI5YjhiMzRlMGUyMzRkYTMxZWUyOWQ3OGEzYWZhOTI1ODZiNmQyZDEyOGQzZA==</ds:DigestValue>\n </ds:Reference>\n </ds:SignedInfo>\n <ds:SignatureValue>MEUCIDo+Es5b/SfhSazApJ0qpRh13GnDTMv12KgF7aABdVxbAiEAyQpdwkUBrTQRLRQIvZp2VSe95hCTFM2ys1F33BI18+I=</ds:SignatureValue>\n <ds:KeyInfo>\n <ds:X509Data>\n <ds:X509Certificate>MIID3jCCA4SgAwIBAgITEQAAOAPF90Ajs/xcXwABAAA4AzAKBggqhkjOPQQDAjBiMRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEzARBgoJkiaJk/IsZAEZFgNnb3YxFzAVBgoJkiaJk/IsZAEZFgdleHRnYXp0MRswGQYDVQQDExJQUlpFSU5WT0lDRVNDQTQtQ0EwHhcNMjQwMTExMDkxOTMwWhcNMjkwMTA5MDkxOTMwWjB1MQswCQYDVQQGEwJTQTEmMCQGA1UEChMdTWF4aW11bSBTcGVlZCBUZWNoIFN1cHBseSBMVEQxFjAUBgNVBAsTDVJpeWFkaCBCcmFuY2gxJjAkBgNVBAMTHVRTVC04ODY0MzExNDUtMzk5OTk5OTk5OTAwMDAzMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEoWCKa0Sa9FIErTOv0uAkC1VIKXxU9nPpx2vlf4yhMejy8c02XJblDq7tPydo8mq0ahOMmNo8gwni7Xt1KT9UeKOCAgcwggIDMIGtBgNVHREEgaUwgaKkgZ8wgZwxOzA5BgNVBAQMMjEtVFNUfDItVFNUfDMtZWQyMmYxZDgtZTZhMi0xMTE4LTliNTgtZDlhOGYxMWU0NDVmMR8wHQYKCZImiZPyLGQBAQwPMzk5OTk5OTk5OTAwMDAzMQ0wCwYDVQQMDAQxMTAwMREwDwYDVQQaDAhSUlJEMjkyOTEaMBgGA1UEDwwRU3VwcGx5IGFjdGl2aXRpZXMwHQYDVR0OBBYEFEX+YvmmtnYoDf9BGbKo7ocTKYK1MB8GA1UdIwQYMBaAFJvKqqLtmqwskIFzVvpP2PxT+9NnMHsGCCsGAQUFBwEBBG8wbTBrBggrBgEFBQcwAoZfaHR0cDovL2FpYTQuemF0Y2EuZ292LnNhL0NlcnRFbnJvbGwvUFJaRUludm9pY2VTQ0E0LmV4dGdhenQuZ292LmxvY2FsX1BSWkVJTlZPSUNFU0NBNC1DQSgxKS5jcnQwDgYDVR0PAQH/BAQDAgeAMDwGCSsGAQQBgjcVBwQvMC0GJSsGAQQBgjcVCIGGqB2E0PsShu2dJIfO+xnTwFVmh/qlZYXZhD4CAWQCARIwHQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMCMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwMwCgYIKwYBBQUHAwIwCgYIKoZIzj0EAwIDSAAwRQIhALE/ichmnWXCUKUbca3yci8oqwaLvFdHVjQrveI9uqAbAiA9hC4M8jgMBADPSzmd2uiPJA6gKR3LE03U75eqbC/rXA==</ds:X509Certificate>\n </ds:X509Data>\n </ds:KeyInfo>\n <ds:Object>\n <xades:QualifyingProperties xmlns:xades=\"http://uri.etsi.org/01903/v1.3.2#\" Target=\"signature\">\n <xades:SignedProperties Id=\"xadesSignedProperties\">\n <xades:SignedSignatureProperties>\n <xades:SigningTime>2025-04-30T10:53:06</xades:SigningTime>\n <xades:SigningCertificate>\n <xades:Cert>\n <xades:CertDigest>\n <ds:DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\"/>\n <ds:DigestValue>ZDMwMmI0MTE1NzVjOTU2NTk4YzVlODhhYmI0ODU2NDUyNTU2YTVhYjhhMDFmN2FjYjk1YTA2OWQ0NjY2MjQ4NQ==</ds:DigestValue>\n </xades:CertDigest>\n <xades:IssuerSerial>\n <ds:X509IssuerName>CN=PRZEINVOICESCA4-CA, DC=extgazt, DC=gov, DC=local</ds:X509IssuerName>\n <ds:X509SerialNumber>379112742831380471835263969587287663520528387</ds:X509SerialNumber>\n </xades:IssuerSerial>\n </xades:Cert>\n </xades:SigningCertificate>\n </xades:SignedSignatureProperties>\n </xades:SignedProperties>\n </xades:QualifyingProperties>\n </ds:Object>\n </ds:Signature>\n </sac:SignatureInformation>\n </sig:UBLDocumentSignatures>\n </ext:ExtensionContent>\n </ext:UBLExtension>\n</ext:UBLExtensions>\n \n <cbc:ProfileID>reporting:1.0</cbc:ProfileID>\n <cbc:ID>ACC-SINV-2025-00826</cbc:ID>\n <cbc:UUID>2611e100-2598-11f0-b7e4-020017019f27</cbc:UUID>\n <cbc:IssueDate>2025-04-30</cbc:IssueDate>\n <cbc:IssueTime>10:53:04</cbc:IssueTime>\n <cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>\n <cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>\n <cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>\n <cac:AdditionalDocumentReference>\n <cbc:ID>ICV</cbc:ID>\n <cbc:UUID>202500826</cbc:UUID>\n </cac:AdditionalDocumentReference>\n <cac:AdditionalDocumentReference>\n <cbc:ID>PIH</cbc:ID>\n <cac:Attachment>\n <cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">sD6JFtZ9Hxq03To8/9HSqWSrkzQtmBTnfWMx6or+i1Q=</cbc:EmbeddedDocumentBinaryObject>\n </cac:Attachment>\n </cac:AdditionalDocumentReference>\n \n \n <cac:AdditionalDocumentReference>\n <cbc:ID>QR</cbc:ID>\n <cac:Attachment>\n <cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">AQVaYXRjYQIPMzk5OTk5OTk5OTAwMDAzAxMyMDI1LTA0LTMwVDEwOjUzOjA0BAY3NzAuMDAFBDAuMDAGLDJyeVArWjJERVBEWGt1NmxxbW9KVWdVSmFvZUV0Z1l4a25MczluVnlkckU9B2BNRVVDSURvK0VzNWIvU2ZoU2F6QXBKMHFwUmgxM0duRFRNdjEyS2dGN2FBQmRWeGJBaUVBeVFwZHdrVUJyVFFSTFJRSXZacDJWU2U5NWhDVEZNMnlzMUYzM0JJMTgrST0IWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABKFgimtEmvRSBK0zr9LgJAtVSCl8VPZz6cdr5X+MoTHo8vHNNlyW5Q6u7T8naPJqtGoTjJjaPIMJ4u17dSk/VHg=</cbc:EmbeddedDocumentBinaryObject>\n </cac:Attachment>\n</cac:AdditionalDocumentReference><cac:Signature>\n <cbc:ID>urn:oasis:names:specification:ubl:signature:Invoice</cbc:ID>\n <cbc:SignatureMethod>urn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod>\n</cac:Signature><cac:AccountingSupplierParty>\n <cac:Party>\n <cac:PartyIdentification>\n <cbc:ID schemeID=\"CRN\">1234567</cbc:ID>\n </cac:PartyIdentification>\n <cac:PostalAddress>\n <cbc:StreetName>riyadh</cbc:StreetName>\n <cbc:BuildingNumber>4444</cbc:BuildingNumber>\n <cbc:PlotIdentification>riyadh</cbc:PlotIdentification>\n <cbc:CitySubdivisionName>8659</cbc:CitySubdivisionName>\n <cbc:CityName>riyadh</cbc:CityName>\n <cbc:PostalZone>87695</cbc:PostalZone>\n <cbc:CountrySubentity>Saudi Arabia</cbc:CountrySubentity>\n <cac:Country>\n <cbc:IdentificationCode>SA</cbc:IdentificationCode>\n </cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme>\n <cbc:CompanyID>399999999900003</cbc:CompanyID>\n <cac:TaxScheme>\n <cbc:ID>VAT</cbc:ID>\n </cac:TaxScheme>\n </cac:PartyTaxScheme>\n <cac:PartyLegalEntity>\n <cbc:RegistrationName>Zatca</cbc:RegistrationName>\n </cac:PartyLegalEntity>\n </cac:Party>\n </cac:AccountingSupplierParty>\n <cac:AccountingCustomerParty>\n <cac:Party>\n <cac:PartyIdentification>\n <cbc:ID schemeID=\"NAT\">786531</cbc:ID>\n </cac:PartyIdentification>\n <cac:PostalAddress>\n <cbc:StreetName>riyadh</cbc:StreetName>\n <cbc:BuildingNumber>4444</cbc:BuildingNumber>\n <cbc:PlotIdentification>riyadh</cbc:PlotIdentification>\n <cbc:CitySubdivisionName>8659</cbc:CitySubdivisionName>\n <cbc:CityName>riyadh</cbc:CityName>\n <cbc:PostalZone>87695</cbc:PostalZone>\n <cbc:CountrySubentity>Saudi Arabia</cbc:CountrySubentity>\n <cac:Country>\n <cbc:IdentificationCode>SA</cbc:IdentificationCode>\n </cac:Country>\n </cac:PostalAddress>\n <cac:PartyTaxScheme>\n <cbc:CompanyID>311523216200003</cbc:CompanyID>\n <cac:TaxScheme>\n <cbc:ID>VAT</cbc:ID>\n </cac:TaxScheme>\n </cac:PartyTaxScheme>\n <cac:PartyLegalEntity>\n <cbc:RegistrationName>customer1234</cbc:RegistrationName>\n </cac:PartyLegalEntity>\n </cac:Party>\n </cac:AccountingCustomerParty>\n <cac:Delivery>\n <cbc:ActualDeliveryDate>2025-11-20</cbc:ActualDeliveryDate>\n </cac:Delivery>\n <cac:PaymentMeans>\n <cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>\n </cac:PaymentMeans>\n <cac:AllowanceCharge>\n <cbc:ChargeIndicator>false</cbc:ChargeIndicator>\n <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>\n <cbc:AllowanceChargeReason>Discount</cbc:AllowanceChargeReason>\n <cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>\n <cac:TaxCategory>\n <cbc:ID>Z</cbc:ID>\n <cbc:Percent>0.00</cbc:Percent>\n <cac:TaxScheme>\n <cbc:ID>VAT</cbc:ID>\n </cac:TaxScheme>\n </cac:TaxCategory>\n </cac:AllowanceCharge>\n <cac:TaxTotal>\n <cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>\n </cac:TaxTotal>\n <cac:TaxTotal>\n <cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>\n <cac:TaxSubtotal>\n <cbc:TaxableAmount currencyID=\"SAR\">770.00</cbc:TaxableAmount>\n <cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>\n <cac:TaxCategory>\n <cbc:ID>Z</cbc:ID>\n <cbc:Percent>0.00</cbc:Percent>\n <cbc:TaxExemptionReasonCode>VATEX-SA-HEA</cbc:TaxExemptionReasonCode>\n <cbc:TaxExemptionReason>Private healthcare to citizen.</cbc:TaxExemptionReason>\n <cac:TaxScheme>\n <cbc:ID>VAT</cbc:ID>\n </cac:TaxScheme>\n </cac:TaxCategory>\n </cac:TaxSubtotal>\n </cac:TaxTotal>\n <cac:LegalMonetaryTotal>\n <cbc:LineExtensionAmount currencyID=\"SAR\">780.0</cbc:LineExtensionAmount>\n <cbc:TaxExclusiveAmount currencyID=\"SAR\">770.0</cbc:TaxExclusiveAmount>\n <cbc:TaxInclusiveAmount currencyID=\"SAR\">770.00</cbc:TaxInclusiveAmount>\n <cbc:AllowanceTotalAmount currencyID=\"SAR\">10.0</cbc:AllowanceTotalAmount>\n <cbc:PayableAmount currencyID=\"SAR\">770.00</cbc:PayableAmount>\n </cac:LegalMonetaryTotal>\n <cac:InvoiceLine>\n <cbc:ID>1</cbc:ID>\n <cbc:InvoicedQuantity unitCode=\"Nos\">1.0</cbc:InvoicedQuantity>\n <cbc:LineExtensionAmount currencyID=\"SAR\">780.0</cbc:LineExtensionAmount>\n <cac:TaxTotal>\n <cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>\n <cbc:RoundingAmount currencyID=\"SAR\">780.00</cbc:RoundingAmount>\n </cac:TaxTotal>\n <cac:Item>\n <cbc:Name>IMP-00021:Tpppshirt</cbc:Name>\n <cac:ClassifiedTaxCategory>\n <cbc:ID>Z</cbc:ID>\n <cbc:Percent>0.00</cbc:Percent>\n <cac:TaxScheme>\n <cbc:ID>VAT</cbc:ID>\n </cac:TaxScheme>\n </cac:ClassifiedTaxCategory>\n </cac:Item>\n <cac:Price>\n <cbc:PriceAmount currencyID=\"SAR\">780.000000</cbc:PriceAmount>\n </cac:Price>\n </cac:InvoiceLine>\n</Invoice>",
"qr_image": "https://zatca.erpgulf.com:3717/private/files/QR_Phase2_ACC-SINV-2025-00826.png"
}
}
This API generates a PDF/A-3 version of a Sales Invoice by accepting the invoice number, print format, and language as input parameters. It embeds the related XML into the PDF and returns a download link to the generated PDF/A-3 file..
- Compliance with ZATCA Guidelines: • PDF/A-3 is mandated by ZATCA for e-invoicing because it ensures invoices are digitally preserved in a non-editable format while supporting embedded machine-readable data, like XML files (UBL format).
- Embedded Attachments: • PDF/A-3 allows embedding of additional files, such as XML data for e-invoicing. This is crucial for ZATCA compliance, as invoices need to include a human-readable PDF and machine-readable XML data in one file.
- Long-Term Archiving: • The format ensures that invoices remain readable and unalterable over time, meeting regulatory and auditing requirements.
- Integration with Business Systems: • By supporting both visual presentation and data integration, PDF/A-3 enables seamless sharing and processing of invoices in enterprise systems and tax portals.
curl --location --request GET 'https://zatca.erpgulf.com:3717/api/method/zatca_erpgulf_sync.zatca_erpgulf_sync.invoice_sync.embed_file_in_pdf' \
--header 'Content-Type: application/json' \
--header 'Cookie: full_name=Guest; sid=Guest; system_user=yes; user_id=Guest; user_image=' \
--data '{
"invoice_name": "ACC-SINV-2025-00603",
"print_format": "Claudion Invoice Format",
"language": "en"
}'
"message": {
"file_name": "PDF-A3 ACC-SINV-2025-00603 outputc3510c.pdf",
"file_url": "https://zatca.erpgulf.com:3717/private/files/PDF-A3 ACC-SINV-2025-00603 outputc3510c.pdf",
"file_doc": "1ded1cd0ff"
}
}