PHP code example of miwaniec / ifirma-api

1. Go to this page and download the library: Download miwaniec/ifirma-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

miwaniec / ifirma-api example snippets


$account = new \IFirmaApi\Account('login', 'key');
$response = $account->getAccountancyMonth();
echo 'Accountancy month: ' . $response->get('MiesiacKsiegowy') . '/' . $response->get('RokKsiegowy');

$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 );
echo 'Invoice ID: '. $response->get('Identyfikator');

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