Download the PHP package sevaske/php-zatca-xml without Composer
On this page you can find all versions of the php package sevaske/php-zatca-xml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-zatca-xml
Please feel free to contribute if you are missing features or tags
View Examples
Β·
Report a bug
FORK!
Note: The original author of the repository Saleh7/php-zatca-xml has been inactive and unresponsive for several months.
This repository is a community-maintained fork with fixes and updates to keep the library functional and improved.
API Integration:
API-related functionality has been refactored and moved to a separate library for better modularity and maintainability:
π sevaske/zatca-api:^1.0
Original project: https://github.com/Saleh7/php-zatca-xml
π Introduction
This is an unofficial PHP library for generating ZATCA Fatoora e-invoices (simplified invoice, simplified credit note, simplified debit note, standard invoice, standard credit note, standard debit note), certificates, and for interacting with the API.
β¨ Features
- π ZATCA-Compliant β Easily generate valid e-invoices for ZATCA regulations
- π Invoice Creation β Generate standard and simplified invoices in XML format
- π Digital Signing β Sign invoices securely to ensure compliance
- π· QR Code Generation β Automatically generate QR codes for invoices
- π‘ Direct Submission to ZATCA β Send invoices directly to ZATCAβs servers
π Requirements
β PHP Version
- PHP 8.1 or higher
π Installation
π Usage
This library simplifies the process of generating ZATCA-compliant e-invoices, handling certificates, signing invoices, and submitting them to ZATCAβs API.
You can find working examples for generating and signing invoices and notes here:
π examples
π 1. Generating a Compliance Certificate
First, generate a certificate signing request (CSR) and private key:
π 2. Requesting a Compliance Certificate from ZATCA
Once the CSR is generated, you need to request a compliance certificate from ZATCA's API.
π§Ύ 3. Generating and signing an Invoice XML
Now that we have the compliance certificate, we can generate a ZATCA-compliant e-invoice in XML format.
Example of the simplified invoice:
Other examples you can find in the ./examples folder.
π€ 5. Submitting the Signed Invoice to ZATCA
Once the invoice is digitally signed, it can be submitted to ZATCAβs API for compliance validation and clearance.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
This project is licensed under the MIT License.