PHPackages                             xhubio/magento2-invoice-api-xhub - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. xhubio/magento2-invoice-api-xhub

ActiveMagento2-module[PDF &amp; Document Generation](/categories/documents)

xhubio/magento2-invoice-api-xhub
================================

Invoice-api.xhub for Magento 2 / Adobe Commerce — generate compliant e-invoices (PDF, XRechnung 3.0, ZUGFeRD 2.3/2.4) from Magento orders via the invoice-api.xhub.io API.

1.0.0(2mo ago)01[1 PRs](https://github.com/xhubio/magento2-invoice-api-xhub/pulls)OSL-3.0PHPPHP ^8.1 || ^8.2 || ^8.3CI failing

Since May 11Pushed 2mo agoCompare

[ Source](https://github.com/xhubio/magento2-invoice-api-xhub)[ Packagist](https://packagist.org/packages/xhubio/magento2-invoice-api-xhub)[ Docs](https://invoice-api.xhub.io)[ RSS](/packages/xhubio-magento2-invoice-api-xhub/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Invoice-api.xhub for Magento 2 / Adobe Commerce
===============================================

[](#invoice-apixhub-for-magento-2--adobe-commerce)

[![CI](https://github.com/xhubio/magento2-invoice-api-xhub/actions/workflows/ci.yml/badge.svg)](https://github.com/xhubio/magento2-invoice-api-xhub/actions/workflows/ci.yml)[![License: OSL-3.0](https://camo.githubusercontent.com/4eb54d9090a0153863042e4ce52dfb9eab3f2a86008527ae65afc4f377cf3136/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4f534c253230332e302d626c75652e737667)](https://opensource.org/licenses/OSL-3.0)[![Magento 2.4.4 – 2.4.7](https://camo.githubusercontent.com/8e4a25730cecb91c5480ed9f362ca8688a39ef62cef2335fd89ac6e2544a0552/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e342e34253230254532253830253933253230322e342e372d6f72616e67652e737667)](https://magento.com)[![PHP 8.1 – 8.3](https://camo.githubusercontent.com/5a7861fc07218f6153836738b64c46f0b67551e5bf121e26dc66f5fb63caf3e1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e31253230254532253830253933253230382e332d3737376262342e737667)](https://www.php.net)

Generate compliant e-invoices (PDF, XRechnung 3.0, ZUGFeRD 2.3/2.4) from Magento orders via the [invoice-api.xhub.io](https://invoice-api.xhub.io) service.

- **Live formats today**: PDF, XRechnung 3.0 (DE B2G), ZUGFeRD 2.3/2.4 (DE/AT hybrid PDF+XML)
- **Coming Q3 2026**: Factur-X, FatturaPA, Facturae, ebInterface, UBL, ISDOC, NAV
- **License**: OSL-3.0 (Open Software License 3.0) — the Adobe Commerce Marketplace standard
- **Module ID**: `Xhubio_InvoiceApiXhub`
- **Composer package**: `xhubio/magento2-invoice-api-xhub`

Screenshots
-----------

[](#screenshots)

[![Admin Dashboard](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/01-admin-dashboard.png)](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/01-admin-dashboard.png)[![All settings expanded](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/02-settings-section.png)](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/02-settings-section.png)Admin Dashboard after the plugin processed two test ordersStores → Configuration → Sales → Invoice-api.xhub — all three sections expanded[![General settings](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/03-settings-general.png)](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/03-settings-general.png)[![Seller details with bank fields](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/06-seller-bank-fields.png)](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/06-seller-bank-fields.png)General settings: API key, format, trigger, number formatSeller Details with IBAN/BIC fields (required for ZUGFeRD B2B)[![Orders list](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/04-orders-list.png)](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/04-orders-list.png)[![Order detail with metabox](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/05-order-detail-with-metabox.png)](https://raw.githubusercontent.com/xhubio/magento2-invoice-api-xhub/main/assets/screenshots/05-order-detail-with-metabox.png)Sales → Orders listOrder detail page with the Invoice-api.xhub metaboxA 16-page PDF User-Guide with all installation, configuration and troubleshooting steps lives at [`docs/Invoice-api-xhub-User-Guide-v1.0.0.pdf`](docs/Invoice-api-xhub-User-Guide-v1.0.0.pdf).

Requirements
------------

[](#requirements)

- Magento 2.4+ / Adobe Commerce 2.4+
- PHP 7.4+
- MySQL 8.0+ or MariaDB 10.4+
- Elasticsearch 7.17+ (Magento 2.4.x default catalog search backend)
- An invoice-api.xhub.io account — sign up at

Install — Composer (recommended)
--------------------------------

[](#install--composer-recommended)

```
composer require xhubio/magento2-invoice-api-xhub
bin/magento module:enable Xhubio_InvoiceApiXhub
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

For developer-mode installs you can skip `setup:di:compile`; for production deploys it's required.

Install — manual (ZIP from GitHub)
----------------------------------

[](#install--manual-zip-from-github)

1. Download the latest `magento2-invoice-api-xhub.zip` from
2. Unzip into `/app/code/Xhubio/InvoiceApiXhub/`
3. Run the same `bin/magento` commands as in the Composer install above

Configure
---------

[](#configure)

1. Open the Admin panel -&gt; **Stores** -&gt; **Configuration** -&gt; **Sales** -&gt; **Invoice-api.xhub**
2. Set your **API Key** (get one at )
3. Set your **Seller Details** (name, VAT ID, address, email — these go on every invoice)
4. Pick a **Format** (PDF / XRechnung / ZUGFeRD) and **Country** (14 EU countries)
5. Choose the **Auto-Generate Trigger** — typically `on_complete` so an invoice is generated when an order reaches the "complete" state
6. Optional: set a **PDF Template ID** from  for custom branding
7. **Save Config** and **Flush Cache**

Use
---

[](#use)

### Automatic generation

[](#automatic-generation)

When an order transitions to the configured trigger state (default: `complete`), the module:

1. Maps the order to the invoice-api.xhub.io schema
2. Calls the API to generate the file
3. Stores the file under `pub/media/invoice-api-xhub//`
4. Writes a row in `xhubio_invoice_meta`
5. Adds a status-history comment on the order

If **Attach to Order Email** is enabled, the file is attached to the customer order confirmation.

### Manual generation

[](#manual-generation)

On the order view page in admin, scroll to the **Invoice-api.xhub** section to:

- See the current invoice status (number, format, country, generated timestamp)
- Click **Generate invoice** (or **Re-generate**) to trigger a run on demand
- Click **Download** to fetch the file directly

### Invoice number tokens

[](#invoice-number-tokens)

The **Invoice Number Format** setting accepts these tokens:

TokenExpands to`{order_number}`Magento order increment id (e.g. `000000123`)`{order_id}`Internal entity id`{year}`Year of order creation (e.g. `2026`)`{month}`2-digit month`{day}`2-digit day`{seq}`Next sequence value (atomic, yearly reset)`{seq:0000}`Same, zero-padded to 4 digitsDefault: `INV-{order_number}`. A common production pattern: `INV-{year}-{seq:0000}`.

The sequence is atomic at the DB level via `INSERT ... ON DUPLICATE KEY UPDATE current = LAST_INSERT_ID(current+1)` — two simultaneous generates can never share a number even under load.

Schema
------

[](#schema)

Two tables are created on `setup:upgrade`:

```
xhubio_invoice_seq
  period       varchar(32)  PRIMARY KEY    -- "all" | "YYYY" | "YYYY-MM"
  current      bigint unsigned             -- last allocated number
  updated_at   timestamp                   -- last increment

xhubio_invoice_meta
  id              int unsigned    PRIMARY KEY AUTO_INCREMENT
  order_id        int unsigned    UNIQUE  FK -> sales_order.entity_id ON DELETE CASCADE
  invoice_number  varchar(64)
  format          varchar(32)            -- pdf | xrechnung | zugferd
  country         varchar(2)             -- ISO 3166-1 alpha-2
  template_id     varchar(36) NULL       -- UUID of custom PDF template, or NULL for default
  api_hash        char(64)               -- sha256 of API response (idempotency)
  filename        varchar(255)           -- as returned by API
  file_path       varchar(512)           -- relative to pub/media/invoice-api-xhub/
  generated_at    timestamp

```

GDPR
----

[](#gdpr)

The module subscribes to:

- `customer_delete_after` — purges all invoice meta + files for that customer's orders
- `sales_order_delete_after` — purges meta + file for that one order

Hard-delete of orders is uncommon (tax retention rules — UStG: 10 years), but the hooks are there for the rare case.

Business model
--------------

[](#business-model)

Free open-source connector (OSL-3.0). The paid product is the **invoice-api.xhub.io** service — your API key represents your service subscription. See `docs/BUSINESS-MODEL.md` for details.

License
-------

[](#license)

OSL-3.0 (Open Software License 3.0) — the Adobe Commerce Marketplace standard license. See `LICENSE.md` for the full text.

Support
-------

[](#support)

- GitHub Issues:
- Service support:

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

74d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20843387?v=4)[PatrickJ](/maintainers/pa201608)[@pa201608](https://github.com/pa201608)

---

Top Contributors

[![pa201608](https://avatars.githubusercontent.com/u/20843387?v=4)](https://github.com/pa201608 "pa201608 (2 commits)")

---

Tags

invoiceinvoice-generatormagento2pdfx-rechnungzugferdmagentoZUGFeRDxrechnungb2beinvoiceE-Invoicecompliancemagento2Europegermanyadobe commercefacturxb2ginvoice-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xhubio-magento2-invoice-api-xhub/health.svg)

```
[![Health](https://phpackages.com/badges/xhubio-magento2-invoice-api-xhub/health.svg)](https://phpackages.com/packages/xhubio-magento2-invoice-api-xhub)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68357.9k](/packages/run-as-root-magento2-prometheus-exporter)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

1310.9k2](/packages/opengento-module-category-import-export)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1011.8k26](/packages/loki-magento2-components)[zwernemann/module-withdrawal

Magento 2 EU Withdrawal Button Module - Adds a withdrawal/revocation button for orders in compliance with EU Directive (EU) 2023/2673

256.0k2](/packages/zwernemann-module-withdrawal)[joseph-leedy/module-custom-fees

Adds configurable custom fees to orders

361.2k](/packages/joseph-leedy-module-custom-fees)

PHPackages © 2026

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