PHP code example of lacodix / sevdesk-saloon

1. Go to this page and download the library: Download lacodix/sevdesk-saloon 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/ */

    

lacodix / sevdesk-saloon example snippets

 
use Lacodix\SevdeskSaloon\SevdeskSaloon;

$sevdeskSaloon = new SevdeskSaloon(
    $api_token, // Your API Token - get it in your Sevdesk account
    [
        'sevUserId'   => 12345678,     // the Sevdesk Uer ID - needed to create invoices
        'taxRate'     => 19,
        'taxText'     => 'MwSt 19%',   // only in version 1.0
        'taxType'     => 'default',    // only in version 1.0
        'taxRule'     => 1,            // only in version 2.0
        'currency'    => 'EUR',
        'invoiceType' => 'RE',
    ]
);

    $sevdeskSaloon = new SevdeskSaloon($api_token);
    $sevdeskSaloon->sevUsers->get();
 
[
    [
      "id" => "1234567",
      "objectName" => "SevUser",
      "additionalInformation" => null,
      "create" => ...,
      ...
    ]
]

    $sevdeskSaloon->contact()->get();
    $sevdeskSaloon->contact()->create($contactType, $contactData);
    
    $sevdeskSaloon->invoice()->get();
    $sevdeskSaloon->invoice()->create($sevContactId, $items, $data);
    $sevdeskSaloon->invoice()->sendViaEmail($invoiceId, $data);