API Documentation
Complete reference for the ZATCA Integration API. Build compliant e-invoicing solutions with ease.
Base URL: https://zatcaapi.avtax.net
Authentication (Partner)
Manage your partner account and authentication.
Endpoint for Partner Account Authentication
POST /api/Partner/LoginThis endpoint authenticates a partner and returns a Partner Access Token. This token is required for all EGS Unit management operations (Create, List, Revoke).
{
"email": "partner@example.com",
"password": "SecurePassword123!"
}
Creates a new user and returns a JWT upon successful creation.
POST /api/Partner/CreateAccount{
"email": "newpartner@example.com",
"password": "SecurePassword123!",
"confirmPassword": "SecurePassword123!",
"fullName": "Partner Name",
"phoneNumber": "+966500000000"
}
Endpoint for Changing Partner Account Password
POST /api/Partner/ChangePasswordThis `ChangePassword` endpoint is designed to provide a secure method for partners to change their account password.
{
"currentPassword": "OldPassword123!",
"newPassword": "NewPassword456!",
"confirmNewPassword": "NewPassword456!"
}
Endpoint for Resetting User Password
POST /api/Partner/ResetPasswordThis `ResetPassword` endpoint allows partners to reset their password by providing their email address.
{
"email": "partner@example.com"
}
Endpoint for Finalizing Password Reset
POST /api/Partner/FinalizePasswordResetThis `FinalizePasswordReset` endpoint allows users to finalize their password reset by providing their email, reset token, and new password.
{
"email": "partner@example.com",
"token": "reset-token-string",
"newPassword": "NewPassword789!",
"confirmNewPassword": "NewPassword789!"
}
EGS Units
Manage E-Invoicing Generation Solution (EGS) Units.
Endpoint for EGS Unit Authentication
POST /api/UserAuthentication/LoginAsEgsUnitAuthenticates a specific EGS Unit using its `ClientId` and `ClientSecret`. Returns an EGS Unit Access Token required for all invoice operations.
{
"clientId": "fa005886-b6b4-4c0d-bd8a-a7dc4fe000b2",
"clientSecret": "1cecadc0-4f32-49c7-bd51-ca1a5864d6b3"
}
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires": "2025-11-21T12:33:58.3063591Z"
}
{
"errors": [
"The client ID or client secret you entered is incorrect. Please check and try again."
]
}
Creates a new Egs Unit. Requires Partner Access Token
POST /api/EgsUnits/CreateNewEgsUnitThis endpoint allows for the creation of a new Egs Unit. It requires detailed organization information, tax registration data (VAT, Group VAT), a comprehensive address, and an OTP for verification.
{
"commonName": "Default Common Name",
"organizationName": "Default Organization Name",
"organizationUnitName": "Default Organization Unit Name",
"serialNumber": "1-Manufacturer or Solution Provider Name|2-Model or Version|3-SerialNumber",
"vatNumber": "300075588700003",
"additionalID": "string",
"additionalIDSchemeID": "None",
"invoiceType": "1100",
"industry": "Default Industry",
"isProduction": false,
"address": {
"streetName": "شارع الأمير محمد بن عبد العزيز",
"additionalStreetName": "الرياض",
"buildingNumber": "1234",
"plotIdentification": "5678",
"citySubdivisionName": "الرياض",
"cityName": "الرياض",
"postalZone": "11564",
"countrySubentity": "منطقة الرياض",
"country": "SA"
},
"otp": "537888"
}
{
"clientId": "e403acba-5ce4-4628-9653-51279c5b907d",
"clientSecret": "35e62a20-15ad-4070-a890-98e9f3728b1c",
"egsUnitId": "913a1541-9d6d-44c2-bd2d-b26d4ecbbd94"
}
{
"errors": [
"The Egs Unit Name field is required.",
"The Party Vat Id field is required."
]
}
Retrieves all Egs Units associated with the current partner. Requires Partner Access Token
GET /api/EgsUnits/GetEgsUnits[
{
"clientId": "69daa8bb-e8c0-45b0-a8fc-5d7da22f7d30",
"clientSecret": "abb65afc-56a4-442f-83bb-cded60fe2b11",
"egsUnitId": "245e46d1-82fd-477a-b5c6-69e581adc2fe",
"organizationName": "Company Name 1",
"vatNumber": "3000000000003",
"additionalIDSchemeID": "None",
"schemeIDName": "Commercial Registration Number",
"additionalID": "1221356",
"isProduction": true,
"maximumNumberOfInvoicesPerMonth": 10000,
"rateLimitPerMinute": 50
}
]
Revokes the secret associated with a specific Egs Unit. Requires Partner Access Token
POST /api/EgsUnits/{egsUnitId}/revoke{
"clientSecret": "new-client-secret-12345",
"egsUnitId": "egsunit-id-67890"
}
Invoices
Submit and manage invoices.
Submits an invoice for clearance or reporting. Requires EGS Unit Access Token
POST /api/Invoice/SubmitInvoiceThis endpoint allows you to submit an invoice. The system will validate, sign, and report/clear the invoice with ZATCA.
{
"documentType": "TaxInvoice",
"invoiceIndicator": "Nominal",
"currency": "SAR",
"exchangeRate": null,
"documentIssueDateTime": "2025-11-20T17:28:30.7241792",
"supplyDate": "2025-11-20T17:28:30.7241803",
"buyer": {
"buyerAddress": {
"streetName": null,
"additionalStreetName": null,
"buildingNumber": null,
"plotIdentification": null,
"citySubdivisionName": null,
"cityName": "الرياض",
"postalZone": null,
"countrySubentity": null,
"country": null
},
"buyerName": "Taj Al Mulook General Trading LLC",
"buyerVatId": "310285784400003",
"additionalIDSchemeID": "None",
"additionalCustomerID": null
},
"documentLineItems": [
{
"lineItemName": "POLYETHYLENE HDPE HHM TR - 131",
"lineItemPrice": 3950,
"lineItemQty": 27.5,
"discountOnLineItem": 0,
"allowanceCode": null,
"taxCategoryCode": "Z",
"taxReasonCode": "VATEX_SA_32",
"taxReasonDescription": null,
"vatRateOnLineItem": 0
},
{
"lineItemName": "POLYETHYLENE HDPE HHM TR - 132",
"lineItemPrice": 3950,
"lineItemQty": 27.5,
"discountOnLineItem": 0,
"allowanceCode": null,
"taxCategoryCode": "S",
"taxReasonCode": "None",
"taxReasonDescription": null,
"vatRateOnLineItem": 15
}
],
"referenceId": null,
"documentId": "7788",
"notes": null,
"documentAllowanceOrChange": [
{
"allowanceChargeReasonCode": "95",
"amount": 10,
"taxCategoryCode": "S",
"taxReasonCode": "None",
"vatRate": 15
}
],
"invoiceTypeReason": null,
"payment": {
"paymentMethod": "InCash",
"paymentAccountIdentifier": null,
"paymentNote": null
},
"prepaymentDetails": [
{
"sequentialInvoiceUUID": "892a7039-d5bd-47e9-8f70-7fe44ad15ce9"
}
]
}
{
"uuid": "03bfd07c-14f9-4f16-81ec-e526d86d5558",
"status": "CLEARED",
"validationResults": {
"infoMessages": [
{
"type": "INFO",
"code": "XSD_ZATCA_VALID",
"message": "Complied with UBL 2.1 standards"
}
],
"status": "PASS"
},
"qrCodeString": "SampleQRCodeString...",
"signedInvoice": "PD94bWwgdmVyc2lvbj0iMS4w..."
}
{
"errors": [
"The seller's tax registration number is required.",
"The street must contain at least one character."
]
}
{
"message": "You must be associated with a Egs Unit to access this resource.",
"loginAsEgsUnitsUrl": "https://zatcaapi.avtax.net/api/UserAuthentication/LoginAsEgsUnit"
}
Retrieves the invoices associated with the current user. Requires EGS Unit Access Token
GET /api/Invoice/GetInvoices{
"items": [
{
"invoiceStatus": {
"invoiceUUID": "12345678-90ab-cdef-1234-567890abcdef",
"invoiceStatus": "REPORTED"
},
"documentType": "SimplifiedTaxInvoice",
"documentIssueDateTime": "2025-11-20T13:33:58.3035992+01:00",
"buyer": {
"buyerName": "Buyer Company Ltd."
}
}
],
"pageNumber": 1,
"totalPages": 10,
"totalCount": 100
}
Retrieves the status of an invoice based on the provided Invoice UUID. Requires EGS Unit Access Token
GET /api/Invoice/GetInvoiceStatus/{invoiceUuid}/status{
"invoiceUUID": "12345678-90ab-cdef-1234-567890abcdef",
"invoiceStatus": "CLEARED",
"invoiceClearanceResponse": {
"clearanceStatus": "CLEARED"
}
}
Generates a PDF/A-3 invoice with embedded XML. Requires EGS Unit Access Token
POST /api/Invoice/PrintInvoice/PrintA3Generates a ZATCA-compliant PDF/A-3 file. You can specify a standard template or provide your own custom XSLT template.
{
"signedInvoice": "string",
"logoUrl": "string",
"pdfInvoiceBase64": "string",
"pdfA3Templete": "ZatcaTemplate"
}
%PDF-1.7 ... (Binary PDF Content)
Zatca UI Data
Helper endpoints to retrieve reference data for building your UI.