PHPackages                             tubconcept/dolibarr-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tubconcept/dolibarr-api-client

ActiveLibrary[API Development](/categories/api)

tubconcept/dolibarr-api-client
==============================

PHP client for Dolibarr REST API

0.2.7(5mo ago)0105MITPHPPHP &gt;=7.4

Since Nov 19Pushed 5mo agoCompare

[ Source](https://github.com/Cotex-System/DolibarrApiRest)[ Packagist](https://packagist.org/packages/tubconcept/dolibarr-api-client)[ RSS](/packages/tubconcept-dolibarr-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

Dolibarr API Client (SDK)
=========================

[](#dolibarr-api-client-sdk)

Lightweight PHP client to interact with Dolibarr's REST API.

Repository: `tubconcept/dolibarr-api-client`

Description: This package provides a simple client to call Dolibarr REST endpoints (third parties, invoices, orders, products, shipments, tickets, etc.). It uses `Guzzle` for HTTP requests and supports authentication with either a permanent API key (DOLAPIKEY) or login/password (temporary token).

Prerequisites

- PHP: `>=7.4`
- Composer to install dependencies

Installation

Install the package via Composer:

```
composer require tubconcept/dolibarr-api-client
```

Quick start

Basic usage examples.

Important note: Resource classes (third parties, invoices, orders, etc.) must be initialized with the same `DolibarrApiClient` instance so they share configuration and the authentication token. Two ways to use resources:

- Instantiate a resource explicitly by passing the client (recommended for clarity).
- Use the public properties already initialized on the client object (for convenience), e.g. `$api->thirdparties`.
- Authenticate with login/password (generate a temporary token):

```
use Tubconcept\DolibarrApiClient\DolibarrApiClient;
use Tubconcept\DolibarrApiClient\Resources\ThirdParties;

$api = new DolibarrApiClient(
    'https://dolibarr.example.com/api/index.php/',
    'your_login',
    'your_password'
);

// Explicitly initialize the ThirdParties resource with the client
$thirdParties = new ThirdParties($api);

$list = $thirdParties->getAll(['limit' => 10]);
print_r($list);
```

- Authenticate with a permanent token (recommended for automation):

```
use Tubconcept\DolibarrApiClient\DolibarrApiClient;
use Tubconcept\DolibarrApiClient\Resources\Invoices;

$api = new DolibarrApiClient(
    'https://dolibarr.example.com/api/index.php/',
    null,
    null,
    'YOUR_PERMANENT_DOLAPIKEY'
);

// Explicitly initialize the Invoices resource
$invoices = new Invoices($api);

$invoice = $invoices->getById(123);
print_r($invoice);
```

Resource examples and methods

- Third Parties (`ThirdParties`)

    - `getAll(array $params)` : retrieve a list of third parties
    - `getById(int $id)` : retrieve a single third party by ID
    - `create(array $data)` : create a third party
    - `update(int $id, array $data)` : update a third party
    - `delete(int $id)` : delete a third party
- Invoices (`Invoices`)

    - `getById(int $id)` — get an invoice
    - `getAll(array $params)` — list invoices
    - `create(array $data)` — create an invoice

(Resource classes are located in `src/Resources/` and methods are documented in the class docblocks.)

Example: create a third party

```
$data = [
    'name' => 'My Company',
    'client' => '1',
    'address' => '9 Example Street',
    'zip' => '75000',
    'town' => 'Paris',
    'email' => 'contact@example.com',
    'statut' => '1'
];

$thirdParties = new \Tubconcept\DolibarrApiClient\Resources\ThirdParties($api);
$response = $thirdParties->create($data);
print_r($response);
```

Error handling

- Methods use Guzzle and may throw exceptions for network or HTTP errors. Authentication issues will raise exceptions from `login()`.
- Wrap API calls in `try/catch` blocks to handle errors gracefully.

```
try {
    $list = $thirdParties->getAll(['limit' => 10]);
} catch (\Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Provided examples

- The `examples/` folder contains example scripts: `createClient.php`, `InvoiceExample.php`, `OrderExample.php`, `ShipmentExample.php`, `ThirdpartiesExample.php`.

Contributing

- Open an issue to discuss changes or report bugs.
- Send pull requests with clear descriptions and tests when possible.

License

- This project is licensed under the MIT License (see the `LICENSE` file).

Notes &amp; recommendations

- Prefer a permanent `DOLAPIKEY` for automated environments.
- Respect Dolibarr API pagination and limits (use `limit` and `page`).
- Check the Dolibarr server documentation for expected fields on endpoints (Dolibarr versions and endpoints can vary).

If you want, I can:

- Add detailed examples for each resource (`Invoices`, `Orders`, `Products`).
- Add a tests / CI section (GitHub Actions).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance72

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

10

Last Release

158d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/301de6bf0b2943094e9078d0325e695506f7bf5082d7ad3c5218d186114b588b?d=identicon)[claudeBoulayTub](/maintainers/claudeBoulayTub)

---

Top Contributors

[![claudeBoulayTub](https://avatars.githubusercontent.com/u/172474278?v=4)](https://github.com/claudeBoulayTub "claudeBoulayTub (49 commits)")

### Embed Badge

![Health badge](/badges/tubconcept-dolibarr-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/tubconcept-dolibarr-api-client/health.svg)](https://phpackages.com/packages/tubconcept-dolibarr-api-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
