PHPackages                             kindy/egyptian-e-invoice - 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. kindy/egyptian-e-invoice

ActiveLibrary[API Development](/categories/api)

kindy/egyptian-e-invoice
========================

PHP Package for Egyptian eInvoicing SDK, eInvoicing is the solution of the Egyptian Tax Authority used by taxpayers to register their issued documents with the Tax Authority

v1.1.5(2y ago)185.6k↓43.8%20[1 issues](https://github.com/mrkindy/EgyptianEInvoice/issues)MITPHPPHP &gt;=5.5

Since May 16Pushed 2y ago4 watchersCompare

[ Source](https://github.com/mrkindy/EgyptianEInvoice)[ Packagist](https://packagist.org/packages/kindy/egyptian-e-invoice)[ Docs](https://github.com/mrkindy/EgyaptianEInvoice)[ GitHub Sponsors](https://github.com/mrkindy)[ RSS](/packages/kindy-egyptian-e-invoice/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

Kindy Egyptian EInvoicing PHP SDK
=================================

[](#kindy-egyptian-einvoicing-php-sdk)

PHP Package for Egyptian eInvoicing SDK, eInvoicing is the solution of the Egyptian Tax Authority used by taxpayers to register their issued documents with the Tax Authority

Install
-------

[](#install)

Via Composer

```
$ composer require kindy/egyptian-e-invoice
```

Examples
--------

[](#examples)

Please see [Examples Files](examples).

Usage
-----

[](#usage)

To view all example please vist [Examples Files](examples).

```
require_once "../vendor/autoload.php";
require_once "./config.php";

use Kindy\EgyaptianEInvoice\Document\Document;
use Kindy\EgyaptianEInvoice\Document\DocumentInvoiceLine;
use Kindy\EgyaptianEInvoice\ETAInvoice;

$issuer = [

    "address" => [
        "branchID" => "0",
        "country" => "EG",
        "governate" => "Cairo",
        "regionCity" => "Nasr City",
        "street" => "580 Clementina Key",
        "buildingNumber" => "Bldg. 0",
        "postalCode" => "68030",
        "floor" => "1",
        "room" => "123",
        "landmark" => "7660 Melody Trail",
        "additionalInformation" => "beside Townhall"
    ],
    "type" => "B",
    "id" => "500100200",
    "name" => "Issuer Company"
];

$receiver = [
    "address" => [
        "country" => "EG",
        "governate" => "Cairo",
        "regionCity" => "Nasr City",
        "street" => "580 Clementina Key",
        "buildingNumber" => "Bldg. 0",
    ],
    "type" => "B",
    "id" => "674859545",
    "name" => "Recievr Company"
];
$document = new Document();
$document->setIssuer($issuer)
         ->setReceiver($receiver)
         ->setDateTimeIssued('2022-05-13T12:35:00Z');
$document->setPurchaseOrderReference('3asd1as');

$invoiceLine = new DocumentInvoiceLine();
$invoiceLine->setDescription('Software ERP')
        ->setInternalCode('MA123')
        ->setItemType('EGS')
        ->setItemCode('EG-500100200-001')
        ->setUnitType('JOB')
        ->setQuantity(2)
        ->setUnitValue('EGP',985)
        ->setDiscount(137.9,'A')
        ->setTaxableItems('T1',256.494,14,'V001')
        ->setItemsDiscount(71.804)
        ->setTotal();

$document->setInvoiceLine($invoiceLine);

$invoiceLine = new DocumentInvoiceLine();
$invoiceLine->setDescription('Software CRM')
        ->setInternalCode('CRM123')
        ->setItemType('EGS')
        ->setItemCode('EG-500100200-001')
        ->setUnitType('JOB')
        ->setQuantity(1)
        ->setUnitValue('EGP',600)
        ->setTaxableItems('T1',84,14,'V001')
        ->setTotal();

$document->setInvoiceLine($invoiceLine);

$document->setInternalID('103333')->setTaxpayerActivityCode('6920')->calculate();
if(isset($_POST['signature']))
{
    $document->setSignatures(
        [
            [
                'signatureType' => 'I',
                'value' => $_POST['signature']
            ]
        ]
    );

    $invoice = new ETAInvoice($config['client_id'],$config['client_secret'], 'uat');
    $finalDocument = [$document->toArray()];
    $documentSubmit = $invoice->submitDocument($finalDocument);
    echo $documentSubmit->acceptedDocuments[0]->uuid.'-'.$documentSubmit->acceptedDocuments[0]->longId.'-'.$documentSubmit->acceptedDocuments[0]->internalId;
}

?>
Sign
Send To Eta

    var signature;
    var socket = new WebSocket("ws://localhost:18088");

    $("#sign").click(function(){
        ConnectToSignatureServer();
    });

    $("#sendToEta").click(function(){
        $.ajax({
            type: "POST",
            url: "",
            data: {signature:signature},
            success: function(data){
                $("#result").html('Document Sent To Eta');
            }
        });
    })

    function ConnectToSignatureServer() {

        socket.send('{Document:\'\',TokenCertificate:\'Egypt Trust Sealing CA\',Password:\'15775108\'}');

        socket.onmessage = function (response) {
            var responseObj = JSON.parse(response.data);

            if(responseObj.cades != 'NO_SOLTS_FOUND' && responseObj.cades != 'PASSWORD_INVAILD' && responseObj.cades != 'CERTIFICATE_NOT_FOUND' && responseObj.cades != 'NO_DEVICE_DETECTED')
            {
                $("#sendToEta").show();
                $("#result").html('Document Signed');
                signature = responseObj.cades;
            }else{
                $("#result").html(responseObj.cades);
            }
        };
    }

    socket.onclose = function() {
        $("#result").html('Connection is closed');
    };

    socket.onerror = function() {
        $("#result").html('Connection Error');
    };
    socket.onopen = function() {
        $("#result").html('Connection Open');
    };

```

Integrate with eSign token
--------------------------

[](#integrate-with-esign-token)

I have developed a small tool that you can use to sign invoices through WebSocket before send it to EAT, you can find this tool on [Egyptian Tax EInvoice HttpSignature](https://github.com/mrkindy/ETAHttpSignature)

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

[](#contributing)

Your contribution is welcome

Credits
-------

[](#credits)

- [Ibrahim Abotaleb](https://github.com/mrkindy)
- [Ahmed Abdelnasser](https://github.com/itsnasser)
- [Hossam Hassan](https://github.com/devhus)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~121 days

Recently: every ~181 days

Total

7

Last Release

737d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5fd85e534ea2f57176af791158952e47f137990cf3a4d1c072a5feb7aa24dbc?d=identicon)[mrkindy](/maintainers/mrkindy)

---

Top Contributors

[![mrkindy](https://avatars.githubusercontent.com/u/744360?v=4)](https://github.com/mrkindy "mrkindy (22 commits)")[![devhus](https://avatars.githubusercontent.com/u/58523735?v=4)](https://github.com/devhus "devhus (1 commits)")[![itsnasser](https://avatars.githubusercontent.com/u/32999648?v=4)](https://github.com/itsnasser "itsnasser (1 commits)")

---

Tags

einvoicingetaEEIEgyptian eInvoicing SDKEgyptian eInvoicing Package

### Embed Badge

![Health badge](/badges/kindy-egyptian-e-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/kindy-egyptian-e-invoice/health.svg)](https://phpackages.com/packages/kindy-egyptian-e-invoice)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[klsheng/myinvois-php-sdk

MyInvois SDK for PHP

9813.0k](/packages/klsheng-myinvois-php-sdk)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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