Skip to content

php-baselinker is a PHP library for accessing the BaseLinker service.

License

Notifications You must be signed in to change notification settings

Solizion/php-baselinker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

PHP BaseLinker API

php-baselinker is a PHP library for accessing the BaseLinker service.

Currently the library has BETA status

Library not implement each of method from BaseLinker API Documentation yet.

Installation

To install php-baselinker, install Composer and issue the following command:

composer require solizion/php-baselinker

Usage

Create a client object and pass as parameters api url and generated api key. To generate an api key, you must first have an existing baselinker account, and then go to "My account" -> "API" -> type name of application and click "Generate token".

use BaselinkerClient\Client;

$apiUrl = "https://api.baselinker.com/connector.php";
$apiKey = "verySecretApiKey"

$client = new Client($apiUrl, $apiKey);

Example

Get logs kind of "create new order", "change order status" from the journal.

use BaselinkerClient\Client;
use BaselinkerClient\Journal\GetJournalListParameters;

$apiUrl = "https://api.baselinker.com/connector.php";
$apiKey = "verySecretApiKey"

$client = new Client($apiUrl, $apiKey);

$parameters = new GetJournalListParameters(
    1, // last_log_id
    [
        GetJournalListParameters::CREATE_ORDER,
        GetJournalListParameters::REMOVE_ORDER,
    ], // log_types
    null, // order_id
);

$journal = $client->getJournalList($parameters);

Errors

BaseLinker return field "status" with values "SUCCESS" or "ERROR".

When status is "ERROR" then fields error_message and error_code are added to the response.

Developed methods

Name Description
GetJournalList Get list of events

Versioning

Versioning is based on semver.

New version is release by a new tag.

Licence

This library is distributed under the BSD 3 Licence, see LICENSE for more information.

Contributing

Authors of this library are Kamil Ciekalski, Dawid Miklas and Marcisz Szczot

If you want to help with development it - fork me!

About

php-baselinker is a PHP library for accessing the BaseLinker service.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages