PHPackages                             maciejlewandowskii/ifirma-bundle - 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. maciejlewandowskii/ifirma-bundle

ActiveLibrary[API Development](/categories/api)

maciejlewandowskii/ifirma-bundle
================================

iFirma Symfony Bundle for easy invoicing integration.

v1.0.0(1mo ago)14MITPHPPHP &gt;=8.3CI passing

Since Jun 28Pushed 1mo agoCompare

[ Source](https://github.com/maciejlewandowskii/iFirmaBundle)[ Packagist](https://packagist.org/packages/maciejlewandowskii/ifirma-bundle)[ RSS](/packages/maciejlewandowskii-ifirma-bundle/feed)WikiDiscussions main Synced 2w ago

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

iFirma API Bundle
=================

[](#ifirma-api-bundle)

[![Tests](https://github.com/maciejlewandowskii/iFirmaBundle/actions/workflows/tests.yml/badge.svg)](https://github.com/maciejlewandowskii/iFirmaBundle/actions/workflows/tests.yml)[![Static Analysis](https://github.com/maciejlewandowskii/iFirmaBundle/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/maciejlewandowskii/iFirmaBundle/actions/workflows/static-analysis.yml)[![Lint](https://github.com/maciejlewandowskii/iFirmaBundle/actions/workflows/lint.yml/badge.svg)](https://github.com/maciejlewandowskii/iFirmaBundle/actions/workflows/lint.yml)[![Coverage](https://camo.githubusercontent.com/02ce3fc882d9bf691c6a2ad17c3d53d35dbc757a361b1e58869e72bbe18d3f42/68747470733a2f2f636f6465636f762e696f2f67682f6d616369656a6c6577616e646f77736b69692f694669726d6142756e646c652f67726170682f62616467652e737667)](https://codecov.io/gh/maciejlewandowskii/iFirmaBundle)[![Latest Version](https://camo.githubusercontent.com/c8703c13a0c21c28cbd6a21b15dd6cf1414a9e3bd1b3d188fba34267f1463118/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616369656a6c6577616e646f77736b69692f696669726d612d62756e646c65)](https://packagist.org/packages/maciejlewandowskii/ifirma-bundle)[![PHP Version](https://camo.githubusercontent.com/45cb421bee5c3ef706b3773b8b5073bb219cd409728d3053acf1766cb3328155/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d616369656a6c6577616e646f77736b69692f696669726d612d62756e646c65)](https://packagist.org/packages/maciejlewandowskii/ifirma-bundle)[![License](https://camo.githubusercontent.com/90979d4f0d6083329ef57df2f32337b1d07f40774b217994211f9b806a903c28/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d616369656a6c6577616e646f77736b69692f694669726d6142756e646c65)](LICENSE)

Symfony bundle providing a clean integration with the [iFirma API](https://www.ifirma.pl/api) — create and manage invoices, contractors, expenses, payments, employees, and accounting months from your application.

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

[](#requirements)

- PHP 8.3+
- Symfony 7.2+

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

[](#installation)

```
composer require maciejlewandowskii/ifirma-bundle
```

Register the bundle in `config/bundles.php` (auto-registered if Symfony Flex is used):

```
return [
    // ...
    maciejlewandowskii\iFirmaApi\IFirmaApiBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Create `config/packages/ifirma_api.yaml`:

```
ifirma_api:
    credentials:
        username:       '%env(IFIRMA_USERNAME)%'
        invoice_key:    '%env(IFIRMA_INVOICE_KEY)%'
        subscriber_key: '%env(IFIRMA_SUBSCRIBER_KEY)%'
        expense_key:    '%env(IFIRMA_EXPENSE_KEY)%'  # optional
```

Add the corresponding environment variables to your `.env`:

```
IFIRMA_USERNAME=your_username
IFIRMA_INVOICE_KEY=your_invoice_key
IFIRMA_SUBSCRIBER_KEY=your_subscriber_key
IFIRMA_EXPENSE_KEY=your_expense_key
```

Usage
-----

[](#usage)

Inject `iFirmaApi` (or any individual service) wherever you need it:

```
use maciejlewandowskii\iFirmaApi\iFirmaApi;

class YourService
{
    public function __construct(private readonly iFirmaApi $iFirma) {}

    public function createInvoice(): void
    {
        $invoice = new InvoiceRequest(/* ... */);
        $response = $this->iFirma->invoiceService->create($invoice);
    }
}
```

### Available services

[](#available-services)

ServiceDescription`invoiceService`Create, update, send, download invoices`contractorService`Manage contractors`expenseService`Add VAT and other expenses`paymentService`Record payments`orderService`Handle orders`accountingMonthService`Open / close accounting months`vatDictionaryService`Fetch VAT rate dictionaries`employeeService`Manage employees### Entity synchronization

[](#entity-synchronization)

Implement `HasIFirmaIntegration` on your Doctrine entity and use the `SynchronizationManager` to automatically push local entities to iFirma:

```
use maciejlewandowskii\iFirmaApi\Synchronization\HasIFirmaIntegration;

class Invoice implements HasIFirmaIntegration
{
    // implement required methods
}
```

The bundle dispatches `PreSyncEvent` and `PostSyncEvent` so you can hook into the sync lifecycle. A `SyncEntitiesCommand` and an async `SyncEntityMessage` / `SyncEntityMessageHandler` are also included for batch or queue-based synchronization.

### Standalone (without Symfony)

[](#standalone-without-symfony)

```
use maciejlewandowskii\iFirmaApi\iFirmaApiFactory;

$api = iFirmaApiFactory::create(
    username: 'your_username',
    invoiceKeyHex: 'your_invoice_key',
    subscriberKeyHex: 'your_subscriber_key',
);

$api->invoiceService->create(/* ... */);
```

Development
-----------

[](#development)

### Running tests

[](#running-tests)

```
# Unit tests (no credentials needed)
vendor/bin/phpunit --testsuite Unit

# Integration tests (require real iFirma credentials in .env.test.local)
vendor/bin/phpunit --testsuite Integration
```

Copy `.env.test` to `.env.test.local` and fill in your credentials to run integration tests:

```
IFIRMA_USERNAME=your_username
IFIRMA_INVOICE_KEY=your_invoice_key
IFIRMA_SUBSCRIBER_KEY=your_subscriber_key
IFIRMA_EXPENSE_KEY=your_expense_key# optional
```

### Code coverage

[](#code-coverage)

Coverage is enforced at **95% minimum** on every CI run (PHP 8.3 and 8.4). The full report is uploaded to [Codecov](https://codecov.io/gh/maciejlewandowskii/iFirmaBundle) on each push to `main`.

### Code style &amp; static analysis

[](#code-style--static-analysis)

```
# Fix code style
vendor/bin/php-cs-fixer fix

# Apply Rector refactors
vendor/bin/rector process

# Run PHPStan (level 10)
vendor/bin/phpstan analyse
```

All three are enforced in CI via the [Lint](.github/workflows/lint.yml) and [Static Analysis](.github/workflows/static-analysis.yml) workflows. The security job also runs `composer audit` and `composer-require-checker` on every push.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.9% 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

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d4cfcb9907af0c66d5f3d9e252c9c9ee886e33e8a59fdd5ce459f18bd116b38?d=identicon)[maciejlewandowskii](/maintainers/maciejlewandowskii)

---

Top Contributors

[![maciejlewandowskii](https://avatars.githubusercontent.com/u/65708007?v=4)](https://github.com/maciejlewandowskii "maciejlewandowskii (37 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maciejlewandowskii-ifirma-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/maciejlewandowskii-ifirma-bundle/health.svg)](https://phpackages.com/packages/maciejlewandowskii-ifirma-bundle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M667](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M776](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M231](/packages/sulu-sulu)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)[contao/core-bundle

Contao Open Source CMS

1301.7M3.0k](/packages/contao-core-bundle)

PHPackages © 2026

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