PHPackages                             budgetinvoice/easyinvoice - 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. budgetinvoice/easyinvoice

ActiveLibrary[API Development](/categories/api)

budgetinvoice/easyinvoice
=========================

A wrapper package for the Budget Invoice invoice creator API.

3.0.2(2y ago)24MITPHPPHP &gt;=7.2.0

Since Jun 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dveldhoen/easyinvoice-composer)[ Packagist](https://packagist.org/packages/budgetinvoice/easyinvoice)[ RSS](/packages/budgetinvoice-easyinvoice/feed)WikiDiscussions master Synced 3w ago

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

Easy Invoice
============

[](#easy-invoice)

A product by

[![Easy Invoice logo](https://camo.githubusercontent.com/3d257c812065d10eab2a81a19d41365f85f8b2bb41e2fafac8812c97d68e3b10/68747470733a2f2f7075626c69632e627564676574696e766f6963652e636f6d2f696d672f6c6f676f5f656e5f6f726967696e616c2e706e67)](https://budgetinvoice.com)

#### Build for Web and Backend 💪

[](#build-for-web-and-backend-)

 [![Version](https://camo.githubusercontent.com/f0f13c2f26765bdd6aec9d306fbc2faa01020d381260e5c933e5f228c68344db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f627564676574696e766f6963652f65617379696e766f696365)](https://packagist.org/packages/budgetinvoice/easyinvoice) [![Coverage Status](https://camo.githubusercontent.com/d6929877c59afff28785ab188aeb8ef0ca02582c6567726d9eb8bb5b6d8c2c3a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6476656c64686f656e2f65617379696e766f6963652d636f6d706f7365722f6d61737465722e737667)](https://codecov.io/github/dveldhoen/easyinvoice-composer)
 [![Downloads](https://camo.githubusercontent.com/8f38ecad361a709a5733d353b66e49bf0b990e62ad25ff5e94d89e48e11cb768/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f627564676574696e766f6963652f65617379696e766f696365)](https://packagist.org/packages/budgetinvoice/easyinvoice/stats) [![License](https://camo.githubusercontent.com/8f346d90e400b357c9688a59840c010773f07d3ec6e9dd4aad2a54c4649176d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f627564676574696e766f6963652f65617379696e766f696365)](https://packagist.org/packages/budgetinvoice/easyinvoice) [![Pull Request's Welcome](https://camo.githubusercontent.com/25b3e6d0d42c98de74a98cbb4d149a1c09020cf6d1361993b72d7d5b8ffed363/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/dveldhoen/easyinvoice-composer)

[![](https://camo.githubusercontent.com/86d1f4531be7dd1a0a296e93dcd3157a8cb5a90f31f109ec1d3d4767ff982a35/68747470733a2f2f7075626c69632e627564676574696e766f6963652e636f6d2f696d672f61707073746f72652d6261646765732f6170706c652d61707073746f72652d75732e706e67)](https://apple.co/3ySZ5JY)[![](https://camo.githubusercontent.com/1541bb643072cf6b0a952b24165085a5b30c8acfb6b68bce9d90fd384d5d578d/68747470733a2f2f7075626c69632e627564676574696e766f6963652e636f6d2f696d672f61707073746f72652d6261646765732f676f6f676c652d706c61792d75732e706e67)](https://play.google.com/store/apps/details?id=nl.dashweb.factuursimpel)

If this package helped you out please star us on Github!
Much appreciated!

[![Pull Request's Welcome](https://camo.githubusercontent.com/531e4435aa4c5f3d3b0c61a028591e38ef7ea484f7844c492db963b205fabdee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6476656c64686f656e2f65617379696e766f6963652d636f6d706f7365722e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/dveldhoen/easyinvoice-composer/)

Important
---------

[](#important)

1. Please note that this package is a wrapper for an API, so it's logic runs on external servers.
2. Your data is secure and will not be shared with third parties.
3. We try to keep the API up and running at all times, but we cannot guarantee 100% uptime. Please build in a retry mechanism in case the API is down for maintenance.

Installing
----------

[](#installing)

Using composer:

```
$ composer require budgetinvoice/easyinvoice
```

Sample
------

[](#sample)

 [![Easy Invoice Sample Logo Only](https://camo.githubusercontent.com/d4a6dd82bc2db4aacd61ed41deaa15e340905c25cf82a8e9c1acfa334078c94b/68747470733a2f2f7075626c69632e65617379696e766f6963652e636c6f75642f696d672f73616d706c652d696e766f6963652e706e67)](https://camo.githubusercontent.com/d4a6dd82bc2db4aacd61ed41deaa15e340905c25cf82a8e9c1acfa334078c94b/68747470733a2f2f7075626c69632e65617379696e766f6963652e636c6f75642f696d672f73616d706c652d696e766f6963652e706e67) [![Easy Invoice Sample With Background](https://camo.githubusercontent.com/72b47a262deaec8e701dbc7241cb15cafc2281f4d93d4db24e571cb7f250cae2/68747470733a2f2f7075626c69632e65617379696e766f6963652e636c6f75642f696d672f73616d706c652d696e766f6963652d6261636b67726f756e642e706e67)](https://camo.githubusercontent.com/72b47a262deaec8e701dbc7241cb15cafc2281f4d93d4db24e571cb7f250cae2/68747470733a2f2f7075626c69632e65617379696e766f6963652e636c6f75642f696d672f73616d706c652d696e766f6963652d6261636b67726f756e642e706e67)

### JSON Configs used for above samples:

[](#json-configs-used-for-above-samples)

Note: Since these samples are in JSON, don't forget to convert them to PHP notation when used

- [\[View JSON\] First Sample](https://public.easyinvoice.cloud/json/easyinvoice-sample.json)
- [\[View JSON\] Second Sample](https://public.easyinvoice.cloud/json/easyinvoice-sample-background.json)

Demo
----

[](#demo)

[![PHPSandbox Notebook](https://camo.githubusercontent.com/941d7a990f5ba5f4706c54008f64e752f72fb3374deee2ce3d10f8bd4cf529b1/68747470733a2f2f70687073616e64626f782e696f2f696d672f6272616e642f62616467652e706e67)](https://phpsandbox.io/e/x/3czoi?layout=EditorPreview&defaultPath=%2F&theme=dark&showExplorer=no&openedFiles=)

Plans
-----

[](#plans)

**Plan**RatePriceLinkFree25 invoices / 15 days$0Not required to registerPaidUnlimited- 30 day free trial
- 1st month $1.99
- $17.99 per month
\*Prices include VAT[![Register here](https://camo.githubusercontent.com/fe289ff29d29b0d5c426890a683ba90aa84f6c9a08637ecee486ad45e43c824a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656769737465722532306f6e2d627564676574696e766f6963652e636f6d2d626c7565)](https://app.budgetinvoice.com/register)
To use paid
-----------

[](#to-use-paid)

1. Register through:
    - Web: [](https://app.budgetinvoice.com/register)
    - iOS:
    - Android:
2. Create an API key through the app: settings -&gt; API keys
3. Use the API Key as shown in the complete example below. Add the apiKey property to the data object.

Note: The GUI is not (yet) fully translated to English, though the path to getting an apiKey should mostly be in English. Also this will allow you to use the in app purchase mechanism to pay for the subscription.

Development mode
----------------

[](#development-mode)

When using the free version, you can set the mode to 'development' to make sure you are not running into rate limits while testing this package or developing your invoices. The free version is limited to 25 invoices per 15 days. When your invoice looks good, you can switch to 'production' mode to create your production invoices. Production mode is activated by either not setting the mode or setting the mode to 'production'.

Direct REST API access
----------------------

[](#direct-rest-api-access)

In case you don't want to use the pip package, but you want to call our invoice creation api directly.

```
# HTTPS POST
https://api.budgetinvoice.com/v2/free/invoices

# POST Data
Format: JSON
Structure: {
  "data": { # Parent parameter must be 'data'
    "mode": "development", # Production or development, defaults to production
    "products": [
      {
        "quantity": 2,
        "description": "Test product",
        "taxRate": 6,
        "price": 33.87
      }
    ],
  }
}

# Optionally add your paid apiKey to the header
Header: "Authorization": "Bearer 123abc" # Please register to receive a production apiKey: https://app.budgetinvoice.com/register
```

Getting Started - Basic Example
-------------------------------

[](#getting-started---basic-example)

```
require __DIR__ . '/vendor/autoload.php';

use BudgetInvoice\EasyInvoice

// Set the data you wish to see on your invoice
$invoiceData = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "product": [
        "quantity" => 2,
        "description" => "Product 1",
        "tax-rate" => 6,
        "price" => 33.87
    ]
];

// Sample code to test the library
$invoice = EasyInvoice::create($invoiceData);

// The invoice['pdf'] variable wil contain a base64 PDF string
echo $invoice['pdf'];

// Save the file locally as PDF
$fileName = 'invoice';
EasyInvoice::save($invoice['pdf'], $fileName);
```

High volumes: asynchronous invoice creation
-------------------------------------------

[](#high-volumes-asynchronous-invoice-creation)

Our API is able to handle high volumes of requests. If you need to create a lot of invoices fast, make sure to create them asynchronously. This will allow you to create multiple invoices at the same time.

Full Example
------------

[](#full-example)

```
require __DIR__ . '/vendor/autoload.php';

use BudgetInvoice\EasyInvoice

//Set the data you wish to see on your invoice
$invoiceData = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "images" => [
        // The logo on top of your invoice
        "logo" => "https://public.easyinvoice.cloud/img/logo_en_original.png",
        // The invoice background
        "background" => "https://public.easyinvoice.cloud/img/watermark-draft.jpg"
    ],
    // Your own data
    "sender" => [
        "company" => "Sample Corp",
        "address" => "Sample Street 123",
        "zip" => "1234 AB",
        "city" => "Sampletown",
        "country" => "Samplecountry"
        //"custom1" => "custom value 1",
        //"custom2" => "custom value 2",
        //"custom3" => "custom value 3"
    ],
    // Your recipient
    "client" => [
        "company" => "Client Corp",
        "address" => "Clientstreet 456",
        "zip" => "4567 CD",
        "city" => "Clientcity",
        "country" => "Clientcountry"
        // "custom1" => "custom value 1",
        // "custom2" => "custom value 2",
        // "custom3" => "custom value 3"
    ],
    "information" => [
        // Invoice number
        "number" => "2021.0001",
        // Invoice data
        "date" => "12-12-2021",
        // Invoice due date
        "dueDate" => "31-12-2021"
    ],
    // The products you would like to see on your invoice
    // Total values are being calculated automatically
    "products" => [
        [
            "quantity" => 2,
            "description" => "Product 1",
            "taxRate" => 6,
            "price" => 33.87
        ],
        [
            "quantity" => 4.1,
            "description" => "Product 2",
            "taxRate" => 6,
            "price" => 12.34
        ],
        [
            "quantity" => 4.5678,
            "description" => "Product 3",
            "taxRate" => 21,
            "price" => 6324.453456
        ]
    ],
    // The message you would like to display on the bottom of your invoice
    "bottomNotice" => "Kindly pay your invoice within 15 days.",
    // Settings to customize your invoice
    "settings" => [
        "currency" => "USD", // See documentation 'Locales and Currency' for more info. Leave empty for no currency.
        // "locale" => "nl-NL", // Defaults to en-US, used for number formatting (See documentation 'Locales and Currency')
        // "marginTop" => 25, // Defaults to '25'
        // "marginRight" => 25, // Defaults to '25'
        // "marginLeft" => 25, // Defaults to '25'
        // "marginBottom" => 25, // Defaults to '25'
        // "format" => "A4", // Defaults to A4, options => A3, A4, A5, Legal, Letter, Tabloid
        // "height" => "1000px", // allowed units: mm, cm, in, px
        // "width" => "500px", // allowed units: mm, cm, in, px
        // "orientation" => "landscape" // portrait or landscape, defaults to portrait
    ],
    // Translate your invoice to your preferred language
    "translate" => [
        // "invoice" => "FACTUUR",  // Default to 'INVOICE'
        // "number" => "Nummer", // Defaults to 'Number'
        // "date" => "Datum", // Default to 'Date'
        // "dueDate" => "Verloopdatum", // Defaults to 'Due Date'
        // "subtotal" => "Subtotaal", // Defaults to 'Subtotal'
        // "products" => "Producten", // Defaults to 'Products'
        // "quantity" => "Aantal", // Default to 'Quantity'
        // "price" => "Prijs", // Defaults to 'Price'
        // "productTotal" => "Totaal", // Defaults to 'Total'
        // "total" => "Totaal" // Defaults to 'Total',
        // "taxNotation" => "btw", // Defaults to 'vat'
    ],

    // Customize enables you to provide your own templates
    // Please review the documentation for instructions and examples
    //    "customize" => [
        //  "template" => base64_encode("Hello World"); // Must be base64 encoded html
    //    ],
];

//Sample code to test the library
$invoice = EasyInvoice::create($invoiceData);

//The invoice object wil contain a base64 PDF string
echo $invoice['pdf'];

// Save the file locally as PDF
$fileName = 'invoice';
EasyInvoice::save($invoice['pdf'], $fileName);
```

Return values
-------------

[](#return-values)

**Key**ValueData Type**result\['pdf'\]****The PDF file as base64 string****String**result\['calculations'\]\['products'\]Array of objects reflecting the products used in creationArrayresult\['calculations'\]\['products'\]\[key\]\['subtotal'\]Rounded price without tax per productNumberresult\['calculations'\]\['products'\]\[key\]\['tax'\]Rounded tax per productNumberresult\['calculations'\]\['products'\]\[key\]\['total'\]Rounded price including tax per productNumberresult\['calculations'\]\['tax'\]Array of objects containing total calculated tax per unique tax rateArrayresult\['calculations'\]\['tax'\]\[rate\]Total tax for all products with same tax rateNumberresult\['calculations'\]\['subtotal'\]Rounded price without tax for all productsNumberresult\['calculations'\]\['total'\]Rounded price without tax for all productsNumberError handling
--------------

[](#error-handling)

```
require __DIR__ . '/vendor/autoload.php';

use BudgetInvoice\EasyInvoice

// Set the data you wish to see on your invoice
$invoiceData = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "product": [
        "quantity" => 2,
        "description" => "Product 1",
        "tax-rate" => 6,
        "price" => 33.87
    ]
];

try {
   // Sample code to test the library
   $invoice = EasyInvoice::create($invoiceData);

   // The invoice['pdf'] variable wil contain a base64 PDF string
   echo $invoice['pdf'];

   // Save the file locally as PDF
   $fileName = 'invoice';
   EasyInvoice::save($invoice['pdf'], $fileName);
} catch (Exception $e){
    echo $e->getMessage();
}
```

Locales and Currency
--------------------

[](#locales-and-currency)

Used for number formatting and the currency symbol:

```
//E.g. for Germany, prices would look like 123.456,78 €
$data = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "settings" => [
        "locale" => "de-DE",
        "currency" => "EUR"
    ]
];

//E.g. for US, prices would look like $123,456.78
$data = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "settings" => [
        "locale" => "en-US",
        "currency" => "USD"
    ]
];
```

Formatting and symbols are applied through the [ECMAScript Internationalization API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)

[Click here for a list of locale codes](https://datahub.io/core/language-codes/r/3.html)
[Click here for a list of currency codes](https://www.iban.com/currency-codes)

Disclaimer: Not all locales and currency codes found in the above lists might be supported by the ECMAScript Internationalization API.

Logo and Background
-------------------

[](#logo-and-background)

The logo and url inputs accept either a URL or a base64 encoded file.

Supported file types:

- Logo: image
- Background: image, pdf

### URL

[](#url)

```
$invoiceData = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "images" => [
        "logo" => "https://public.easyinvoice.cloud/img/logo_en_original.png",
        "background" => "https://public.easyinvoice.cloud/img/watermark_draft.jpg"
    ]
];
```

### Base64

[](#base64)

```
$invoiceData = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    //Note: Sample base64 string
    //Please use the link below to convert your image to base64
    "images":[
        "logo" => "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
        "background" => "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
    ]
];
```

[Click here for an online tool to convert an image to base64](https://base64.guru/converter/encode/image)

Template customization
----------------------

[](#template-customization)

Download our default template (invoice-v2) [here](https://public.easyinvoice.cloud/templates/invoice-v2/index.txt) to have an example which you can customize.

Supported file types:

- Base64
- URL (soon)

```
// You are able to provide your own html template
$html = "Hello world! This is invoice number %number%";

$invoiceData = [
    "apiKey" => "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
    "mode" => "development", // Production or development, defaults to production
    "customize" => [
        "template" => base64_encode($html) // Your template must be base64 encoded
    ],
    "information" => [
        "number" => "2022.0001"
    ]
];

$invoice = EasyInvoice::create($invoiceData);
// This will return a pdf with the following content
// Hello world! This is invoice number 2022.0001
```

### Variable placeholders

[](#variable-placeholders)

The following placeholders can be put into your template. They will be replaced by their corresponding value upon creation.

**Placeholder** **Will be replaced by**%document-title% translate.invoice%logo% images.logo%company-from% sender.company%address-from%  sender.address%zip-from%  sender.zip%city-from% sender.city%country-from% sender.country%sender-custom-1% sender.custom1%sender-custom-2% sender.custom2%sender-custom-3% sender.custom3%company-to% client.company%address-to%  client.address%zip-to%  client.zip%city-to% client.city%country-to% client.country%client-custom-1% client.custom1%client-custom-2% client.custom2%client-custom-3% client.custom3%number-title% translate.number%number% settings.number%date-title% translate.date%date% settings.date%due-date-title% translate.due-date%due-date% settings.due-date%products-header-products% translate.products%products-header-quantity% translate.quantity%products-header-price% translate.price%products-header-total% translate.product-totalA custom product row must be enclosed in products tags like: ```

```

Don't leave out the product tags or your custom product row won't be iterable by the template parser and you will end up with a single product row. Customize the html as you wish.

products```
Within:

```

%description%

 products\[\].description```
Within:

```

%quantity%

 products\[\].quantity```
Within:

```

%price%

 products\[\].price```
Within:

```

%row-total%

 products\[\].quantity \* products\[\].price (rounded)%subtotal-title% translate.subtotal%subtotal% **Auto inserted:**
Calculated total price excluding taxA custom tax row must be enclosed in tax tags like: ```

```

Don't leave out the tax tags or your custom tax row won't be iterable by the template parser and you will end up with a single tax row. Customize the html as you wish.

tax```
Within:

```

%tax-notation%

 settings.tax-notation```
Within:

```

%tax-rate%

 **Auto inserted:**
Distinct tax rate used in products```
Within:

```

%tax%

 **Auto inserted:**
Calculated total tax for rate%total% **Auto inserted:**
Calculated total price including tax

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~138 days

Recently: every ~188 days

Total

8

Last Release

874d ago

Major Versions

1.0.0 → 2.0.02022-01-09

2.0.3 → 3.0.02024-01-31

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bf698278e47eb2df537b5314eab70b8171a7dc027ba734035b3b3803b2ca96b?d=identicon)[dveldhoen](/maintainers/dveldhoen)

---

Top Contributors

[![dveldhoen](https://avatars.githubusercontent.com/u/4952924?v=4)](https://github.com/dveldhoen "dveldhoen (22 commits)")

### Embed Badge

![Health badge](/badges/budgetinvoice-easyinvoice/health.svg)

```
[![Health](https://phpackages.com/badges/budgetinvoice-easyinvoice/health.svg)](https://phpackages.com/packages/budgetinvoice-easyinvoice)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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