Download the PHP package bluerock/sellsy-client without Composer

On this page you can find all versions of the php package bluerock/sellsy-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sellsy-client

Sellsy API V2 PHP client

Latest Version on Packagist Total Downloads

Introduction

This package is a PHP client for the Sellsy API. It's a light wrapper around the Guzzle HTTP client. It's designed to be as simple as possible to use, while being robust.

The client only supports the V2 of Sellsy API. If you're looking for a V1 client, checkout TeknooSoftware/sellsy-client instead.

To ensure a consistent data exchange between Sellsy and this client, we're making use of DTO classes to define the structure of the shared entities. Thoses classes are defined in the Bluerock\Sellsy\Entities namespace :

This also mean you will get back DTO entities from the Sellsy API when performing GET requests :

If you're unfamiliar with DTOs or need some documentation on it, make sure to have a look at the spatie/data-transfer-object package, used by this client.

Please keep in mind that this package is still in development. If you're missing an contribute or open an issue on this repository.

Installation

Requirements

Installation via composer

Usage

Authenticate

This package supports the following authentication methods :

Before querying Sellsy API, you must provide your credentials using the Config class :

Learn more about Sellsy API v2 credentials on the official documentation.

Connect to multiple Sellsy accounts

You can connect to many Sellsy accounts at the same time. You just need to configure each instance, then switch to one or another with Config::switchInstance() (returns a Config object for that specific account)

Querying the API

The basics

Each API domain is represented by a plurialized class (eg: Contacts, Items, Taxes). Each class contains methods used to perform requests agaisn't the domain's endpoints.

The easiest way to start querying the API is by initializing the corresponding class :

You may also make use of the Client facade that holds all domains to easily instanciate the corresponding class by calling a method :

Requests

This client is using the Laravel CRUD operations keywords to name methods :

HTTP Operation Client Method Related operation
GET index List resources.
GET show Get a single resource.
POST create Create a single resource.
UPDATE update Update a single resource.
DELETE destroy Delete a single resource.
GET search Search resources.

Any additional method described in the domain's documentation would follow the camel case convention. For example, additional Companies methods would look like this :

Operation Client Method
Get a company address. CompaniesApi::showAddress(...)
Update a company address. CompaniesApi::updateAddress(...)
Link a contact at one company. CompaniesApi::linkContact(...)

Responses

When issuing a request, you will get back a Bluerock\Sellsy\Core\Response object holding methods to verify and read the response.

You can inspect the response using any of those methods :

By default, the Request will throw a RequestException if the request returns an error (status code 4xx —> 5xx). You can easily catch this exception and handle it as you wish :

Some notes on response & DTOs

To retrieve the DTO entities from the Response, you may call one of entity() and entities() methods :

If some additionnal entities are embed in the response, they will be automatically parsed into subsequent DTOs.

If you need to read the raw response, it is always possible to use the json() method :

Examples

Index

Listing a resource, is done by using the index() method, which accept query parameters as only argument.

Show

The show method accept the resource id as first parameter and query parameters as second :

This would return a Bluerock\Sellsy\Entities\Contact instance :

Create

The store method, used to create a resource, expect the entity object as first argument and may have $query parameters as second argument :

Update

The update method expect the resource to be updated as first parameter and $query parameters as second argument :

Here, the "id" parameter is extracted from the given Contact entity.

Delete

When deleting a resource, the destroy method should be called. This method only expect the resource id to be deleted :

Developments status

✅ = Fully implemented
🆚 = Partially implemented
🅾️ = Not yet implemented

Category Domain Status
Core Batch 🅾️
Core API Management 🅾️
Core Webhooks 🅾️
Core Listings 🅾️
Core Activities 🅾️
Core Custom Activities 🅾️
Core Files 🅾️
Prospection Companies
Prospection Contacts
Prospection Individuals
Prospection Opportunities 🅾️
Prospection Calendar 🅾️
Prospection Emails 🅾️
Prospection Comments 🅾️
Prospection Tasks 🅾️
Prospection PhoneCalls 🅾️
Prospection CRM Activities 🅾️
Prospection Estimates 🅾️
Catalog Items 🆚️
Catalog Units
Catalog Taxes
Invoicing Accounting 🅾️
Invoicing Rate Categories
Invoicing Purchase (OCR) 🅾️
Invoicing Payments 🅾️
Invoicing Invoices 🆚️
Invoicing Credit Notes 🅾️
Account Currencies 🅾️
Account Custom Fields 🅾️
Account Countries 🅾️
Account Smart Tags 🅾️
Account Documents 🅾️
Account Staffs 🅾️
Account Subscription 🅾️
Account Quotas 🅾️
Account Conformities 🅾️
Account Notifications 🅾️
Account Fiscal Year 🅾️

Contribute

Feel free to contribute to the package !
If you find any security issue, please contact me at [email protected] instead of creating a public github issue.

First contribution guide

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of sellsy-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|>=8.0
illuminate/support Version >=8.0
illuminate/http Version >=8.0
illuminate/contracts Version >=8.0
guzzlehttp/guzzle Version ^7.0
spatie/data-transfer-object Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bluerock/sellsy-client contains the following files

Loading the files please wait ....