PHP code example of marfakt / invoice-client

1. Go to this page and download the library: Download marfakt/invoice-client 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/ */

    

marfakt / invoice-client example snippets


php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar 

$client = new \Marfakt\InvoiceClient('api_token');
$response = $client->addInvoice(array(
    'MiejsceWystawienia' => 'Olsztyn',
    'Odbiorca' => array(
        'Nazwa' => 'Jan Kowalski',
        'Ulica' => '',
        'NumerDomu' => '',
        'NumerLokalu' => '',
        'KodPocztowy' => '',
        'Miejscowosc' => '',
        'Wojewodztwo' => '',
        'Kraj' => '',
        'NIP' => '',
        'REGON' => '',
        'PESEL' => '',
        'VIES' => '',
        'VATUE' => '',
        'NumerRachunkuBankowego' => '',
        'Telefon1' => '',
        'Telefon2' => '',
        'Fax' => '',
        'Email' => '',
    ),
    'PozycjaDokumentu' => array(
        array(
            'Nazwa' => 'Test product',
            'JednostkaMiary' => 'szt',
            'Ilosc' => 1,
            'CenaNetto' => 23.34,
            'StawkaVAT' => 23,
        )
    )
));