SellSy

Connect your platform to your Sellsy Account.


Thanks to Sellsy API, you are able to connect your platform to your account, push and pull contacts, quote, invoice or any documents available via the Sellsy Api.

The library is Framework-free and can be used with any PHP app. It needs only a PSR-7 transport, like Guzzle. A default implementation is provided with this library.

By implementing TransportInterface, you can use an other transport.

Sellsy Logo

Features


Framework Free

Not dependent to a framework or a tool.

PSR-7

Interoperable with any objects using the PSR-7 recommendation.

Easily integrable

Implement only interfaces on your classes.

GitHub


Fork the project on GitHub

It is open source! Hosted, developed, and maintained on GitHub.


View GitHub Project

Patreon


Support this project on Patreon

This project is free and will remain free, but its development is not. If you like it and help us maintain it and evolve it, don't hesitate to support us on Patreon.


Support it

Example



<?php

declare(strict_types=1);

namespace
Acme;

use
GuzzleHttp\Client;
use
Http\Discovery\HttpAsyncClientDiscovery;
use
Http\Discovery\Psr17FactoryDiscovery;
use
Teknoo\Sellsy\Client\ResultInterface;
use
Teknoo\Sellsy\Guzzle6\Transport\Guzzle6;
use
Teknoo\Sellsy\HttpPlug\Transport\HttpPlug;
use
Teknoo\Sellsy\Sellsy;

include
'vendor/autoload.php';

//Example with Guzzle6 Create the HTTP client
//$guzzleClient = new Client();
//$transportBridge = new Guzzle6($guzzleClient);

//Create the transport bridge
$transportBridge = new HttpPlug(
HttpAsyncClientDiscovery::find(),
Psr17FactoryDiscovery::findUriFactory(),
Psr17FactoryDiscovery::findRequestFactory(),
Psr17FactoryDiscovery::findStreamFactory(),
);

//Create the front object
$sellsy = new Sellsy(
'https://apifeed.sellsy.com/0/',
'1e5cc50d37e386dcd14858472261d34da0c597ee',
'd9319bec93565830a2af0ae6d04eec5999bb4a65',
'81fbc7a8b3a35f8de9f2d5d324ec8bb47ac7a574',
'd313d3806faf9962b15fa3ae2878e64d7e88093a'
);

$sellsy->setTransport($transportBridge);

//Example of requests, follow the API documentation of Sellsy API.
//Show your ConsumerDatas id, like 9001
print $sellsy->Infos()
->
getInfos()
->
getResponse()['consumerdatas']['id'];

//Show again your ConsumerDatas id, like 9001
print $sellsy->Infos()
->
getInfos()
->
consumerdatas
->id;

//Show again your ConsumerDatas id, like 9001
$sellsy->Infos()
->
async()
->
getInfos()
->
then(
static function (
ResultInterface $result): void {
print
$result->consumerdatas->id . PHP_EOL;
}
)->
wait();

//Show your email, like contact@teknoo.software
print $sellsy->AccountPrefs()
->
getCorpInfos()
->
getResponse()['email'];

//Show your email, like contact@teknoo.software
print $sellsy->AccountPrefs()
->
getCorpInfos()
->
email;

//Show your email, like contact@teknoo.software
$sellsy->AccountPrefs()
->
async()
->
getCorpInfos()
->
then(
static function (
ResultInterface $result): void {
print
$result->email . PHP_EOL;
}
)->
wait();

//Thrown an exception : Teknoo\Sellsy\Client\Exception\ParameterMissingException: id is missing
$sellsy->AccountDatas()
->
deleteTaxe();