PHPackages                             square-bit/invoicexpress-for-laravel - 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. square-bit/invoicexpress-for-laravel

ActiveLibrary[API Development](/categories/api)

square-bit/invoicexpress-for-laravel
====================================

Laravel package to integrate invoicexpress

v1.0(8mo ago)05211[19 issues](https://github.com/square-bit/invoicexpress_for_laravel/issues)[3 PRs](https://github.com/square-bit/invoicexpress_for_laravel/pulls)MITPHPPHP ^8.2CI passing

Since Jun 20Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/square-bit/invoicexpress_for_laravel)[ Packagist](https://packagist.org/packages/square-bit/invoicexpress-for-laravel)[ Docs](https://github.com/square-bit/invoicexpress-for-laravel)[ RSS](/packages/square-bit-invoicexpress-for-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (15)Versions (9)Used By (0)

InvoiceXpress integration for Laravel
=====================================

[](#invoicexpress-integration-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/80b419fc44c0cb77d5de0ed7f83340b56ffd392dda46c6b1b2f1ca6d5fa8037c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7371756172652d6269742f696e766f6963657870726573732d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/square-bit/invoicexpress_for_laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4cf5acacf82c0e5698be295fa3c3a3748e997e0aaec04589f311a0c7c6aaf596/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7371756172652d6269742f696e766f6963657870726573735f666f725f6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/square-bit/invoicexpress_for_laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/60413f69ab91fd8df6a4fa8aba3121a6bd15f3e45bfce3f9fae187641f5f9a19/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7371756172652d6269742f696e766f6963657870726573735f666f725f6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/square-bit/invoicexpress_for_laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/5acd8882142350e6780eea1a4456043538f10ef75ef6e2c44aceca9ae6e90af8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7371756172652d6269742f696e766f6963657870726573732d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/square-bit/invoicexpress_for_laravel)

Integrate your Laravel application with [InvoiceXpress](https://invoicexpress.com/)' API

Concept
-------

[](#concept)

This package can be used on 2 different layers:

- via the provided Models.
- interacting directly with the API endpoint.

Using the former allows you to **transparently** create, update and delete entities both in your application's database and in InvoiceXpress.

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

[](#installation)

You can install the package via composer:

```
composer require square-bit/invoicexpress-for-laravel
```

Optionally, you can publish and run the migrations:

```
php artisan vendor:publish --tag="invoicexpress-for-laravel-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="invoicexpress-for-laravel-config"
```

This is the contents of the published config file:

```
return [
    'account' => [
        'name' => env('IX_ACCOUNT_NAME'),
        'api_key' => env('IX_API_KEY'),
    ],
    'service_endpoint' => 'app.invoicexpress.com',
    'eloquent' => [
        'persist' => false,
    ],
];
```

`IX_ACCOUNT_NAME` is your InvoiceXpress account name (the XXX in ).

`IX_API_KEY` is the API key you can get from your InvoiceXpress account settings page.

`persist` defines whether to store the entities in your database, when using the "Model" layer. Default is `false`. If you set it to `true`, make sure you ran the migrations.

Usage
-----

[](#usage)

### Option 1 - Via the model layer

[](#option-1---via-the-model-layer)

With this approach, the package handles **both local and remote changes to the entities.**

This however is **not enabled by default**. To enable it:

- publish and run the migrations (see *Installation*)
- set `persist => true` in the config file (see *Installation*)

You can get a specific Item and update it:

```
use Squarebit\InvoiceXpress\API\Data\ItemData;
use Squarebit\InvoiceXpress\Model\IxItem;

$item = IxItem::find(1234);
$item->description = "a serious description";
$item->save();
```

Or you can create one:

```
$data = ItemData::from([...]);
$item = (new IxItem())->fromData($data)
    ->save();
```

Or even delete it:

```
$item->delete();
```

---

#### Invoice lifecycle:

[](#invoice-lifecycle)

```
use Squarebit\InvoiceXpress\API\Data\PdfData;

$invoice = (new IxInvoice())
    ->setClient(IxClient::findOrFail(1234)) // set the invoice's client
    ->addItem(IxItem::find(2345)) // add an IxItem model
    ->addItem(ItemData::from([....])) // you can also add from an ItemData
    ->addItems([  // or from an array
        ItemData::from([...]),
        IxItem::find(3579),
        ...
    ])
    ->save(); // creates the new invoice (locally and in InvoiceXpress)
    ->finalizeDocument() // formally registers the invoice
    ->email(); // email the invoice to the client

// Store the pdf locally
$pdf = $invoice->getPdf()->pdfUrl;
Storage::put('file.jpg', $pdf);

// Pay the invoice and email the receipt
$receipt = $invoice
    ->pay()
    ->email();
```

---

### Option 2 - Directly using the endpoints

[](#option-2---directly-using-the-endpoints)

With this approach, **only remote changes are handled**. If you want, you'll have to manage local changes (in your database) manually.

You can get a specific Item and update it:

```
use Squarebit\InvoiceXpress\Facades\InvoiceXpress;

$itemsEndpoint = InvoiceXpress::items();

$itemData = $itemsEndpoint->get(1234);
$itemData->description = "a serious description";
$itemsEndpoint->update($itemData);
```

Or you can create one:

```
$data = ItemData::from([...]);
$itemData = InvoiceXpress::items()->create($itemData);
```

Or even delete it:

```
InvoiceXpress::items()->delete(1234);
```

#### Invoice lifecycle:

[](#invoice-lifecycle-1)

```
use Squarebit\InvoiceXpress\API\Data\ClientData;
use Squarebit\InvoiceXpress\API\Data\EmailClientData;
use Squarebit\InvoiceXpress\API\Data\EmailData;
use Squarebit\InvoiceXpress\API\Data\InvoiceData;
use Squarebit\InvoiceXpress\API\Data\ItemData;
use Squarebit\InvoiceXpress\API\Data\PartialPaymentData;
use Squarebit\InvoiceXpress\API\Data\StateData;
use Squarebit\InvoiceXpress\Enums\DocumentEventEnum;
use Squarebit\InvoiceXpress\Enums\EntityTypeEnum;
use Squarebit\InvoiceXpress\Facades\InvoiceXpress;

$invoiceEndpoint = InvoiceXpress::invoices();

// Create an Invoice
$invoiceData = $invoiceEndpoint->create(
    EntityTypeEnum::SimplifiedInvoice,
    InvoiceData::from([
        ...
        'client' => ClientData::from([
            ...
        ]),
        'items' => [
            ItemData::from([])
        ]
    ])
);

// Formally register it
$invoiceEndpoint->changeState(
    EntityTypeEnum::SimplifiedInvoice,
    $invoiceData->id,
    StateData::from([
        'state' => DocumentEventEnum::Finalized
    ])
);

// Email the Invoice
$invoiceEndpoint->sendByEmail(
    EntityTypeEnum::SimplifiedInvoice,
    $invoiceData->id,
    EmailData::from([
        'client_data' => EmailClientData::from([
            'email' => 'someone@somewhere.com'
        ]),
        'subject' => '...',
        'body' => '...',
        'cc' => '...',
        'bcc' => '...',
    ])
);

// Get the pdf
$pdfData = $invoiceEndpoint->generatePDF($invoiceData->id)

// Pay the invoice (in total)
$receiptData = $invoiceEndpoint->generatePayment([
    EntityTypeEnum::SimplifiedInvoice,
    $invoiceData->id,
    PartialPaymentData::from([
        'amount' => $invoiceData->total,
    ])
])

```

### You can mix both options, if you want

[](#you-can-mix-both-options-if-you-want)

```
$itemsEndpoint = InvoiceXpress::items();

// get an Item by querying the endpoint directly
$itemData = $itemsEndpoint->get(1234);

// create an IxItem model with that data and update it
$item = (new IxItem())->fromData($itemData);
$item->description = 'a more serious description';

// send the modifed data to InvoiceXpress
$itemsEndpoint->update($item->getData());
```

---

### Available entities

[](#available-entities)

InvoiceXpress entityModel classEndpoint classItemsIxItemItemsEndpointTaxesIxTaxTaxesEndpointClientsIxIClientClientsEndpointInvoices (Invoice)IxInvoiceInvoicesEndpointInvoices (SimplifiedInvoice)IxSimplifiedInvoiceInvoicesEndpointInvoices (InvoiceReceipt)IxInvoiceReceiptInvoicesEndpointInvoices (Receipt)IxReceiptInvoicesEndpointInvoices (CreditNote)IxCreditNoteInvoicesEndpointInvoices (DebitNote)IxDebitNoteInvoicesEndpointInvoices (CashInvoice)IxCashInvoiceInvoicesEndpointInvoices (VatMossInvoice)IxVatMossInvoiceInvoicesEndpointInvoices (VatMossReceipt)IxVatMossReceiptInvoicesEndpointInvoices (VatMossCreditNote)IxVatMossCreditNoteInvoicesEndpointEstimates (Quote)IxQuoteEstimatesEndpointEstimates (Proforma)IxProformaEstimatesEndpointEstimates (FeesNote)IxFeesNoteEstimatesEndpointGuides (Shipping)IxShippingGuidesEndpointGuides (Transport)IxTransportGuidesEndpointGuides (Devolution)IxDevolutionGuidesEndpointSequencesIxSequenceSequencesEndpointSAF-T-SaftEndpointTesting
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Squarebit, Lda](https://github.com/square-bit)
- [All Contributors](../../contributors)
- [Spatie's Laravel Data](https://github.com/spatie/laravel-data)

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance75

Regular maintenance activity

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 87.6% 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 ~265 days

Total

4

Last Release

266d ago

Major Versions

v0.9.2 → v1.02025-08-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/63dd954cd38674cf0319666e08400850a3ef880b42e630d1b6de7b70c4caa332?d=identicon)[saidatom](/maintainers/saidatom)

![](https://www.gravatar.com/avatar/01faacc649020a16c1cceb7ec2dd2cf579c5de812ee9a88aad11be04e41c54bf?d=identicon)[Squarebit](/maintainers/Squarebit)

![](https://www.gravatar.com/avatar/2d983f39b1b70e94a81617ec324d9f613cb618aa0ccce1fbfed6e182f9425179?d=identicon)[tiagof](/maintainers/tiagof)

---

Top Contributors

[![tiagof](https://avatars.githubusercontent.com/u/1729910?v=4)](https://github.com/tiagof "tiagof (99 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![mbarreiro85](https://avatars.githubusercontent.com/u/86309499?v=4)](https://github.com/mbarreiro85 "mbarreiro85 (1 commits)")

---

Tags

laravelsquare-bitinvoicexpress-for-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/square-bit-invoicexpress-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/square-bit-invoicexpress-for-laravel/health.svg)](https://phpackages.com/packages/square-bit-invoicexpress-for-laravel)
```

###  Alternatives

[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[tapp/filament-webhook-client

Add a Filament resource and a policy for Spatie Webhook client

1120.2k](/packages/tapp-filament-webhook-client)

PHPackages © 2026

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