PHP code example of dantepiazza / dolibarr-sdk

1. Go to this page and download the library: Download dantepiazza/dolibarr-sdk 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/ */

    

dantepiazza / dolibarr-sdk example snippets


$dolibarr = new Dolibarr([
	'url' => 'YOUR_DOLIBAR_API_URL',
	'token' => 'YOUR_DOLIBAR_API_TOKEN',
]);

$invoice = $dolibarr -> Invoices -> Get(1);

if($invoice -> status){
    print_r($invoice -> data);
}

$call = $dolibarr -> endpoint_class_name -> method_name(array $options);

class Response{
	var bool $status = false;
	var mixed $data = [];
	var int $code = 0;
}