Download the PHP package corecave/laravel-zatca without Composer

On this page you can find all versions of the php package corecave/laravel-zatca. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-zatca

Laravel ZATCA

A comprehensive Laravel package for integrating with Saudi Arabia's ZATCA (Zakat, Tax and Customs Authority) e-invoicing system (FATOORA platform).

Features

Requirements

Installation

Publish the configuration file:

Run the migrations:

Optional: QR Code Image Generation

To generate QR code images (PNG/SVG) for embedding in emails or PDFs:

Configuration

Add these environment variables to your .env file:

Understanding ZATCA Environments

Environment Portal API Endpoint Purpose
sandbox Developer Portal /developer-portal Basic development testing with mock certificates
simulation Simulation Portal /simulation Real testing with ZATCA - invoices are validated but not recorded
production FATOORA Portal /core Live production - invoices are legally binding

Important Notes:

Complete Onboarding Process

Overview

The onboarding process involves 4 steps:

  1. Generate CSR - Create a Certificate Signing Request
  2. Get Compliance CSID - Submit CSR with OTP to get a compliance certificate
  3. Pass Compliance Checks - Submit sample invoices for validation
  4. Get Production CSID - Exchange compliance certificate for production certificate

Step 1: Generate CSR

This generates:

Step 2: Get Compliance CSID & Run Compliance Checks

  1. Log in to the appropriate ZATCA portal:

  2. Navigate to your EGS (e-Invoice Generation Solution) unit

  3. Generate a new OTP (One-Time Password)

  4. Run the compliance command within 1 hour (OTP expires):

Step 3: Get Production CSID

After ALL compliance checks pass, request your production certificate:

Important:

Step 4: Start Issuing Invoices

Once you have a production certificate, you can start issuing legally-binding invoices:

Full Usage Example

Here's a complete example from building an invoice to submitting it:

VAT Number & Registration Number Formats

VAT Number (15 digits)

Format: 3XXXXXXXXXX0003

Position Value Description
1 3 Always 3 (country code for Saudi Arabia)
2-11 XXXXXXXXXX Your 10-digit Commercial Registration Number
12-15 0003 Fixed suffix

Example: If your CR is 1234567890, your VAT number is 312345678900003

Commercial Registration Number (10 digits)

This is your company's official registration number from the Ministry of Commerce.

Example: 1234567890

Buyer Identification Schemes

When specifying buyer information for B2B invoices, use the appropriate scheme:

Scheme ID Description Format
CRN Commercial Registration Number 10 digits
MOM Momra License Variable
MLS MLSD License Variable
SAG Sagia License Variable
NAT National ID 10 digits
GCC GCC ID Variable
IQA Iqama Number 10 digits
TIN Tax Identification Number (VAT) 15 digits
700 700 Number Variable
OTH Other ID Variable

Creating Credit Notes (Refunds)

QR Code Image Generation

Generate QR code images for receipts, emails, or PDFs:

Note: Requires simplesoftwareio/simple-qrcode package.

Artisan Commands

Generate CSR

Run Compliance Process

Get Production CSID

Renew Production Certificate

Cleanup Utility

Debugging

Enable debug mode to save XML files for inspection:

Debug files are saved to storage/app/zatca/debug/:

Error Handling

Common ZATCA Validation Errors

Error Code Message Solution
BR-KSA-F-13 Invalid Seller/Buyer ID Check VAT number format (15 digits: 3XXXXXXXXXX0003)
BR-KSA-63 Missing buyer address fields Include all required fields for SA buyers
BR-KSA-18 Invalid building number Building number must be exactly 4 digits
BR-KSA-64 Invalid additional number Additional number must be exactly 4 digits
X509IssuerName Wrong certificate issuer Use simulation/production environment, not sandbox
Invalid-CSR CSR is invalid Regenerate CSR with correct configuration

Events

The package dispatches events you can listen to:

Changelog

v1.2.0 (2024-12-16)

Added

v1.1.0 (2024-12-13)

Fixed

Added

v1.0.0 (2024-12-12)

License

MIT License. See LICENSE for more information.

Resources


All versions of laravel-zatca with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
phpseclib/phpseclib Version ^3.0
robrichards/xmlseclibs Version ^3.1
sabre/xml Version ^4.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package corecave/laravel-zatca contains the following files

Loading the files please wait ...