For PHP developers looking to integrate ZATCA invoice solutions, a dedicated library is available at https://github.com/kpsabithgit/zatcaphase2 to simplify implementation and ensure compliance with electronic invoicing standards.
Getting Started:
To start using Sabith/ZATCAPhase2, simply install it via Composer:
Installation
To install this package, use Composer:
composer require sabith/zatcaphase2
Example Usage
Generate Compliance CSID
<?php
require 'vendor/autoload.php';
use Sabith\Zatcaphase2\ComplianceCSID;
use Sabith\Zatcaphase2\Invoice;
use Sabith\Zatcaphase2\ProductionCSID;
$compliancecsid = new ComplianceCSID;
$compliancecsid->email("[email protected]")
->commonName("Jeem")
->location("Dammam")
->companyName("Jeem IT")
->vatNumber("310565828400003")
->isRequiredSimplifiedDoc(true)
->isRequiredStandardDoc(true)
->deviceSerialNumber1("stackcue")
->deviceSerialNumber2("ESGUnit")
->deviceSerialNumber3("9sfgbdb02-665")
->regAddress("KHOBAR")
->businessCategory("Software and IT")
->otp("272482");
echo $compliancecsid->sendAPIrequest(); //it will display the compliance csid if API call is success.
//stackcueComplianceIdentifier from above method used here
$stackcueComplianceIdentifier = '74e88cd4-fc4a-46f9-afee-b2c4cb4d034a';
$productioncsid = ProductionCSID::sendAPIrequest($stackcueComplianceIdentifier);//it will display the production csid if API call is success.
echo $productioncsid;