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.
Console¶
Update all frontend users that are already linked to a bexio contact¶
path/to/bin/typo3 bexio:updateusers
Process invoice payments by emitting an event¶
path/to/bin/typo3 bexio:processpayments
API¶
Get a client from the ApiService¶
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();
Get all bexio contacts¶
// @link https://github.com/onlime/bexio-api-client/tree/main/src/Bexio/Resource
use Bexio\Resource\Contact
$bexioContact = new Contact($client);
$contacts = $bexioContact->getContacts();
Create an invoice¶
// 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