This package make a connection to the sevdesk api and let you interact with it.
You can install the package via composer:
composer require exlo89/laravel-sevdesk-api
Set your api token with
SEVDESK_API_TOKEN=xxxxxxxx
Optionally you can publish the config file with:
php artisan vendor:publish --provider="Exlo89\LaravelSevdeskApi\SevdeskApiServiceProvider" --tag="config"
This is the contents of the published config file:
return [
/*
* Api token you from sevdesk.
*/
'api_token' => env('SEVDESK_API_TOKEN', ''),
];
First Instantiate a sevdesk instance.
$sevdeskApi = SevdeskApi::make();
Create sevdesk contacts. There are 4 different default contact types in sevdesk.
- supplier
- customer
- partner
- prospect customer
The optional $parameters
is for additional information like description, vatNumber or bankNumber.
$sevdeskApi->contact()->createSupplier('Supplier Organisation', $parameters);
$sevdeskApi->contact()->createCustomer('Customer Organisation', $parameters);
$sevdeskApi->contact()->createPartner('Partner Organisation', $parameters);
$sevdeskApi->contact()->createProspectCustomer('Prospect Customer Organisation', $parameters);
For accounting contact you have to create a contact first. You create a accounting contact using the created contact id.
$sevdeskApi->contact()->createAccountingContact($contactId);
For custom contact types use your custom category id.
$sevdeskApi->contact()->createCustom('Custom Organisation', $categoryId, $parameters);
Check Create Contact for more information.
To get all contacts.
$sevdeskApi->contact()->all();
$sevdeskApi->contact()->allSupplier();
$sevdeskApi->contact()->allCustomer();
$sevdeskApi->contact()->allPartner();
$sevdeskApi->contact()->allProspectCustomer();
To get all contacts from a custom type.
$sevdeskApi->contact()->allCustom($categoryId);
To get a single contact.
$sevdeskApi->contact()->get($contactId);
To update a single contact. $contactId
is required.
$sevdeskApi->contact()->update($contactId, $parameters);
To delete a single contact. $contactId
is required.
$sevdeskApi->contact()->delete($contactId);
$sevdeskApi->contactAddress()->create($contactId, $parameters);
Create phone number.
$sevdeskApi->communicationWay()->createPhone($contactId, $phoneNumber);
Create email.
$sevdeskApi->communicationWay()->createEmail($contactId, $email);
Create website.
$sevdeskApi->communicationWay()->createWebsite($contactId, $website);
Retrieve all communication ways.
$sevdeskApi->communicationWay()->all();
Retrieve communication ways of a specific contact.
$sevdeskApi->communicationWay()->get($contactId);
To delete a single communication way.
$sevdeskApi->communicationWay()->delete($communicationWayId);
To get all invoices.
$sevdeskApi->invoice()->all();
To get all invoices filtered by status draft
, open
or payed
.
$sevdeskApi->invoice()->allDraft();
$sevdeskApi->invoice()->allOpen();
$sevdeskApi->invoice()->allPayed();
To get all invoices filtered by a giving $contactId
.
$sevdeskApi->invoice()->allByContact($contactId);
To get all invoices filtered by giving $timestamp
.
$sevdeskApi->invoice()->allAfter($timestamp);
$sevdeskApi->invoice()->allBefore($timestamp);
To download pdf file of the giving $invoiceId
.
$sevdeskApi->invoice()->download($invoiceId);
To send invoice to giving $email
. Use $subject
and $text
to edit the mail. $text
can contain html.
$sevdeskApi->invoice()->sendPerMail($invoiceId, $email, $subject, $text);
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email hello@martin-appelmann.de instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.