miwaniec/ifirma-api

IFirmaApi is a wrapper for official iFirma API. IFirma is one of the most popular internet accounting systems in Poland.

Maintainers

Package info

github.com/miwaniec/ifirma-api

Homepage

pkg:composer/miwaniec/ifirma-api

Statistics

Installs: 31 142

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 0

v1.3 2026-03-21 17:32 UTC

This package is auto-updated.

Last update: 2026-03-21 17:34:25 UTC


README

The wrapper in PHP for official iFirma API (in Polish). IFirma is one of the most popular internet accounting systems in Poland. API functions and fields are in Polish, names in my code are in English for better understanding. Created at the end of 2017 for internal projects, published in March 2019 here. If you need help, please create an issue in this repository. It is part of most useful API functions. Check examples below (more in example.php).

Installation - https://packagist.org/packages/miwaniec/ifirma-api

composer require miwaniec/ifirma-api

Usage

  1. Get accountancy month (current value in system)
$account = new \IFirmaApi\Account('login', 'key');
$response = $account->getAccountancyMonth();
echo 'Accountancy month: ' . $response->get('MiesiacKsiegowy') . '/' . $response->get('RokKsiegowy');
  1. Add invoice - a simple example for an existing contractor
$invoice = new \IFirmaApi\Invoice('login', 'key');
$invoceDomestic = new \IFirmaApi\Model\InvoiceDomestic('123456789', '2019-01-01', 7);
$invoceDomestic->addItem( new \IFirmaApi\Model\Item('IT support', 100, 3));
$response = $invoice->add( $invoceDomestic );
$invoiceId = $response->get('Identyfikator');
echo 'Invoice ID: ' . $invoiceId;

optionally, you can send invoice to KSeF right after adding (if you have KSeF enabled in your account)

$invoice->sendToKsef($invoiceId);
  1. Download invoice
$invoice = new \IFirmaApi\Invoice('login', 'key');
$invoice->getAsPdf('1/1/2019');