Introduction¶
Usage¶
After completing the setup as outlined in the administration and site configuration manual the console as well as the API can be used to interact with the bexio resources. Following a view samples are shown to demonstrate the usage. The complete functional reference can be found in the user and the API manual.
API¶
use Buepro\Bexio\Service\ApiService;
// Get the ApiService with the GeneralUtility or by dependency injection
$apiService = GeneralUtility::makeInstance(ApiService::class);
// Initialize the service for a site and get the client
$client = $apiService->initialize($site)->getClient();
// Or get the client from an already initialized service
$clientInOtherScope = (GeneralUtility::makeInstance(ApiService::class))->getClient();
// @link https://github.com/onlime/bexio-api-client/tree/main/src/Bexio/Resource
use Bexio\Resource\Contact
$bexioContact = new Contact($client);
$contacts = $bexioContact->getContacts();
// use Buepro\Bexio\Task\Invoice\CreateInvoice;
$invoice = [
'title' => 'Test invoice',
'positions' => [
'text' => 'Some service',
'amount' => 3.2,
'unitPrice' => 90,
],
];
$result = GeneralUtility::makeInstance(CreateInvoice::class)
->initialize($site, $invoice)
->process();
Prerequisites¶
This extension requires a composer based installation.
Credits¶
- This extension has been started by Philipp Müller from lavitto.ch
- It uses the package onlime/bexio-api-client from Philip Iezzi