PHPackages                             ferjul17/sellsy-api - 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. ferjul17/sellsy-api

AbandonedArchivedLibrary[API Development](/categories/api)

ferjul17/sellsy-api
===================

PHP library which helps to call Sellsy's API

1.0.1(9y ago)1454.3k↓28.6%5[1 issues](https://github.com/Vaisonet/Sellsy-api/issues)MITPHP

Since Dec 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Vaisonet/Sellsy-api)[ Packagist](https://packagist.org/packages/ferjul17/sellsy-api)[ RSS](/packages/ferjul17-sellsy-api/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (7)Used By (0)

Sellsy API Client Library
=========================

[](#sellsy-api-client-library)

[![Build Status](https://camo.githubusercontent.com/72449410f1ee9c4176891553f391e63d4a0f4083381d55c0ff9d211f414030d6/68747470733a2f2f7472617669732d63692e6f72672f6665726a756c31372f53656c6c73792d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ferjul17/Sellsy-api)[![Coverage Status](https://camo.githubusercontent.com/39915187a86b75570e873f925e3cda8eee7eb1c12a4942f8c7c4b485cde64b5a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6665726a756c31372f53656c6c73792d6170692f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/ferjul17/Sellsy-api?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/c766ac274ca5d5f0eb757a08ecd55fc80e70c2d2e7f5fd4936a1ce25dee4abeb/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31313565396561342d313239662d343535372d613063312d3033613231393136353462642f6d696e692e706e67)](https://insight.sensiolabs.com/projects/115e9ea4-129f-4557-a0c1-03a2191654bd)

PHP library which helps to call Sellsy's API

```
$client = new Client(['userToken'      => 'xxx', 'userSecret'     => 'xxx',
                      'consumerToken'  => 'xxx', 'consumerSecret' => 'xxx',
                     ]);

var_dump($client->getService('Infos')->call('getInfos', []));
$promise = $client->getService('Infos')->callAsync('getInfos', [])->then(function($res) {
    var_dump($res);
});
$promise->wait();
```

How to install
--------------

[](#how-to-install)

First of all you need [Composer](https://getcomposer.org/doc/00-intro.md "Introduction - Composer"):

```
php -r "readfile('https://getcomposer.org/installer');" | php

```

Then add Sellsy API as a dependency of your project:

```
php composer.phar require ferjul17/sellsy-api

```

How to use
----------

[](#how-to-use)

### Setup the library

[](#setup-the-library)

The library provide you a class called `Service` which represent a part of the Sellsy's API. The service allows you to call api associated to this module. For instance, the service `Accountdatas` allows to call all method which start with Accountdatas in Sellsy's API, like Accountdatas.getTaxe or Accountdatas.updateUnit

The Services are created by a factory called `Client`. So you first need to create a `Client` before having a `Service`. To create a client just call its constructor. Its first argument is an array which contains the configuration. You must provide the credentials to call the API which include the user token and secret, and the consumer token and secret that you can find in Sellsy interface.

```
require 'path/to/vendor/autoload.php';
use SellsyApi\Client;

$client = new Client(['userToken'      => 'xxx', 'userSecret'     => 'xxx',
                      'consumerToken'  => 'xxx', 'consumerSecret' => 'xxx',
                     ]);
```

### Call APIs

[](#call-apis)

Once you have you client, you can retreive a `Service` by calling the method `getService($serviceName)`:

```
$service = $client->getService('Accountdatas');
```

Finally, you can call an API with the method `call($methodName, $params)`:

```
$response = $service->call('createUnit', ['unit' => ['value' => 'Kg']);
```

There's another method `callAsync($methodName, $params)` which send an asynchronous request and return a `Promise`:

```
$promise = $service->callAsync('createUnit', ['unit' => ['value' => 'Kg']);
$response = $promise->wait();
```

You can find more information about `Promise` [here](https://github.com/guzzle/promises "Github of Guzzle Promises").

### Handle errors

[](#handle-errors)

In order to handle errors, you should use retryable version of the previous methodes: `retryableCall($callable)` and `retryableCallAsync($callable)`. In case of an error which is handle by the library, this one will try to send again the requests by calling `$callable`.

`$callable` must be a function which return the parameters to give to the `call()` and `callAsync()` methods.

`$callable` takes 3 arguments:

- The instance of the `ServiceInterface` used to send the call
- The retry number. The first time this value is 0.
- The error received

```
var_dump($client->getService('Infos')->retryableCall(function (ServiceInterface $service, $retry, $e) {
    if ($retry > 3) {
        throw $e;
    }
    return ['getInfos', []];
}));
$promise = $client->getService('Infos')->retryableCallAsync(function (ServiceInterface $service, $retry, $e) {
    if ($retry > 3) {
        throw $e;
    }
    return ['getInfos', []];
})->then(function ($res) {
    var_dump($res);
});
$promise->wait();
```

How to run tests
----------------

[](#how-to-run-tests)

If you want to test this library, you can run the test suite clone this repository:

```
 git clone https://github.com/ferjul17/Sellsy-api.git

```

then install dependencies:

```
composer update

```

than run the tests:

```
vendor/phpunit/phpunit/phpunit

```

License
-------

[](#license)

Sellsy API is an open-source project released under the MIT license. See the `LICENSE` file for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~51 days

Recently: every ~61 days

Total

6

Last Release

3586d ago

Major Versions

0.9.x-dev → 1.0.02016-01-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2161b58be0b2a553775226c000e87029cd174e0af1afefbc66610a3cfe5c201?d=identicon)[ferjul17](/maintainers/ferjul17)

![](https://www.gravatar.com/avatar/1d3c4ec93c7bbf72bf8aa7a3c4fef70895d48bf188b3ca007f92257cc7cd802b?d=identicon)[Vaisonet](/maintainers/Vaisonet)

---

Top Contributors

[![ferjul17](https://avatars.githubusercontent.com/u/1574473?v=4)](https://github.com/ferjul17 "ferjul17 (48 commits)")[![Max84](https://avatars.githubusercontent.com/u/6622400?v=4)](https://github.com/Max84 "Max84 (4 commits)")

---

Tags

apilibrarysellsy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ferjul17-sellsy-api/health.svg)

```
[![Health](https://phpackages.com/badges/ferjul17-sellsy-api/health.svg)](https://phpackages.com/packages/ferjul17-sellsy-api)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k409.0k6](/packages/theodo-group-llphant)[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

737290.3k8](/packages/nutgram-nutgram)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[keboola/storage-api-client

Keboola Storage API PHP Client

10405.9k40](/packages/keboola-storage-api-client)

PHPackages © 2026

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