PHP code example of agsystemspl / fakturownia-rest-client
1. Go to this page and download the library: Download agsystemspl/fakturownia-rest-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/ */
agsystemspl / fakturownia-rest-client example snippets
use AGSystems\Fakturownia\REST\Client;
$accessToken = 'JDxxxxxxxxxxxxxx';
// For Fakturownia (Polish version)
$apiUrl = 'https://YOUR_DOMAIN.fakturownia.pl/';
// For InvoiceOcean (English version)
// $apiUrl = 'https://YOUR_DOMAIN.invoiceocean.com/';
$client = new Client($accessToken, $apiUrl);
// Get a list of clients with pagination
$clients = $client->clients->get([
'page' => 1,
'per_page' => 25
]);
// Get a list of invoices
$invoices = $client->invoices->get();
// Get a client by ID
$clientData = $client->clients(123)->get();
// Get an invoice by ID
$invoice = $client->invoices(456)->get();