PHPackages                             saudiza/zatca-fatoora - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. saudiza/zatca-fatoora

ActiveLibrary[API Development](/categories/api)

saudiza/zatca-fatoora
=====================

🇸🇦 Fatoora - ZATCA Phase 2 E-Invoice Integration for Laravel | Complete Saudi Arabia Tax Authority Compliance

v2.0.0(5mo ago)06MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Jan 18Pushed 5mo agoCompare

[ Source](https://github.com/inaat/zatca-fatoora)[ Packagist](https://packagist.org/packages/saudiza/zatca-fatoora)[ RSS](/packages/saudiza-zatca-fatoora/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (3)Used By (0)

🇸🇦 Fatoora - Laravel ZATCA E-Invoice Integration
================================================

[](#-fatoora---laravel-zatca-e-invoice-integration)

[![Latest Version](https://camo.githubusercontent.com/a311bf1f632538e3635f2e03fc263ad06c324b0eb3d02bd42e3c330c74e7d3f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73617564697a612f7a617463612d6661746f6f72612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/saudiza/zatca-fatoora)[![License](https://camo.githubusercontent.com/5f6238ca36bb33a224d5367570da70757ee539e279c036d8c27f4ade709b9939/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73617564697a612f7a617463612d6661746f6f72612e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/1053fa7c8c9c72281708fd7cb43d5ffdd55da1389e9273f5b7d6b6a7e6dd354b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73617564697a612f7a617463612d6661746f6f72612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/saudiza/zatca-fatoora)

> **Complete ZATCA Phase 2 e-invoicing integration for Laravel** - Saudi Arabia Tax Authority compliance made simple.

Features
--------

[](#features)

🚀 **Complete Phase 2 Support**

- ✅ Automated onboarding &amp; certificate generation
- ✅ Standard invoices (B2B) &amp; Simplified invoices (B2C)
- ✅ Credit notes &amp; Debit notes
- ✅ Digital signatures &amp; QR codes
- ✅ UBL 2.1 XML compliant

💼 **Laravel First**

- Laravel 9.x, 10.x &amp; 11.x support
- Beautiful Facade API (`Fatoora::invoice()`)
- Artisan commands for setup
- Multiple environments (sandbox, production)

🔒 **Security**

- ECDSA secp256k1 signatures
- Certificate-based authentication
- Hash validation
- Cryptographic stamps

Installation
------------

[](#installation)

```
composer require saudiza/zatca-fatoora
```

### Quick Setup

[](#quick-setup)

```
# 1. Install package
php artisan zatca:install

# 2. Configure .env
ZATCA_ENVIRONMENT=sandbox
ZATCA_VAT_NUMBER="300000000000003"
# ... add other credentials

# 3. Run onboarding
php artisan zatca:onboarding --otp=YOUR_OTP
```

Usage
-----

[](#usage)

### Generate Invoice

[](#generate-invoice)

```
use Saudiza\Fatoora\Facades\Fatoora;

// Create invoice
$invoice = Fatoora::invoice();

$invoice->setInvoiceNumber('INV-001')
    ->setInvoiceUuid(\Illuminate\Support\Str::uuid())
    ->setInvoiceIssueDate(now()->format('Y-m-d'))
    ->setInvoiceIssueTime(now()->format('H:i:s'))
    ->setInvoiceType('0100000', '388') // Standard invoice
    ->setInvoiceCurrencyCode('SAR')
    ->setInvoiceTaxCurrencyCode('SAR');

// Configure supplier
$supplier = new \Saudiza\Fatoora\Invoice\Supplier();
$supplier->setVatName('Your Company')
    ->setVatNumber('300000000000003')
    ->setCityName('Riyadh')
    ->setPostalCode('12345')
    ->setBuildingNumber('1234')
    ->setStreet('King Fahd Road')
    ->setDistrict('Al Olaya');

$invoice->setInvoiceSupplier($supplier);

// Add items, totals, etc... (see documentation)

// Submit to ZATCA
$result = $invoice->sendDocument(true);

if ($result['success']) {
    echo "✅ Invoice submitted! QR: " . $result['qr_value'];
}
```

### Using Facade Alias

[](#using-facade-alias)

```
// You can use either:
Fatoora::invoice()  // New name
Zatca::invoice()    // Backward compatibility
```

Configuration
-------------

[](#configuration)

All settings are in `config/zatca.php`:

```
return [
    'environment' => env('ZATCA_ENVIRONMENT', 'sandbox'),
    'organization' => [
        'vat_number' => env('ZATCA_VAT_NUMBER'),
        // ... more settings
    ],
];
```

Artisan Commands
----------------

[](#artisan-commands)

```
# Install package
php artisan zatca:install

# Run onboarding
php artisan zatca:onboarding --otp=YOUR_OTP

# Check configuration
php artisan tinker
>>> Fatoora::config()->get('environment')
```

Invoice Types
-------------

[](#invoice-types)

TypeCodeDescriptionStandard`0100000`Tax Invoice (B2B)Simplified`0200000`Tax Invoice (B2C)Credit Note`381`Credit NoteDebit Note`383`Debit NoteEnvironments
------------

[](#environments)

EnvironmentDescription`sandbox`Testing environment`simulation`Simulation environment`production`Live ZATCA systemDocumentation
-------------

[](#documentation)

- 📖 [Installation Guide](INSTALLATION.md)
- 💡 [Usage Examples](USAGE_EXAMPLES.md)
- 📦 [Package Summary](PACKAGE_SUMMARY.md)
- 🚀 [Quick Start](QUICKSTART.md)

Requirements
------------

[](#requirements)

- PHP 8.0+
- Laravel 9.x, 10.x, or 11.x
- OpenSSL extension
- XMLReader extension

Testing
-------

[](#testing)

```
php artisan test
```

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md)

License
-------

[](#license)

MIT License - see [LICENSE](LICENSE)

Support
-------

[](#support)

- 📧 Email:
- 🐛 Issues: [GitHub Issues](https://github.com/inaat/zatca-fatoora/issues)
- 📚 Documentation: See docs folder
- 💼 LinkedIn: [Inayat Ullah](https://www.linkedin.com/in/inayat-ullah-927b09146/)

Credits
-------

[](#credits)

Built with ❤️ for the Saudi developer community by [Inayat Ullah](https://github.com/inaat).

---

**Made in Saudi Arabia 🇸🇦**

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance71

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

164d ago

Major Versions

v1.0.0 → v2.0.02026-01-20

PHP version history (2 changes)v1.0.0PHP ^8.1|^8.2|^8.3

v2.0.0PHP ^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/81f0edbeb06959f64e7aa62419646221dc42d5628d0321303d290a3e6b960250?d=identicon)[inaat](/maintainers/inaat)

---

Top Contributors

[![EnayatKhn](https://avatars.githubusercontent.com/u/221482862?v=4)](https://github.com/EnayatKhn "EnayatKhn (8 commits)")

---

Tags

laravelvatE-Invoicetaxdigital invoiceZATCAfatoorae-invoicingksasaudi-arabiaqr-invoicephase2saudi-taxgaztsaudi-vat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saudiza-zatca-fatoora/health.svg)

```
[![Health](https://phpackages.com/badges/saudiza-zatca-fatoora/health.svg)](https://phpackages.com/packages/saudiza-zatca-fatoora)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
