2017 © Pedro Peláez
 

library sop-api-client

Solute SOP API Client PHP

image

solutesop/sop-api-client

Solute SOP API Client PHP

  • Tuesday, April 10, 2018
  • by askold
  • Repository
  • 0 Watchers
  • 0 Stars
  • 573 Installations
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 10 % Grown

The README.md

Solute SOP Api Client PHP

Installation packagist.org

composer require solutesop/sop-api-client

Usage of PHP Client Lib

instanciate the Client, (*1)

$client = new \SoluteSop\Api\Client();

configuring the client (access token needed), (*2)

$client->setAccessToken('YOUT_ACCESS_TOKEN');

Instanciate a Request Object and configure it, (*3)

$request = new \SoluteSop\Api\Request\Order();
$request->setOrderId(1);

Call API, (*4)

$response = $client->getOrder($request);

Work with the response object, (*5)

Request Examples

Each Response Object has method getRawData() this is the raw json response of SOP API, (*6)

basic usage

create a request Object for what you want Order, Orders, OrderLine, (*7)

Call Client method getOrder($request), getOrders($request), updateOrderLine($request) and get the Reponse, (*8)

Order Request example

single Order, (*9)

$request = new \SoluteSop\Api\Request\Order();
$request->setOrderId(1);
/** @var \SoluteSop\Api\Response\Order $order */
$order = $client->getOrder($request);

Orders Request example many orders filtered or not, (*10)

$request = new \SoluteSop\Api\Request\Orders();
$request->setConfirmationState(\SoluteSop\Api\Request\Orders::STATE_NONE);
$request->setDateFrom(new DateTime('2017-01-01'));
/** @var \SoluteSop\Api\Response\Orders $orderCollection */
$orderCollection = $client->getOrders($request);
foreach ($orderCollection->getAll() as $order) {
    // do something
}

OrderLine Update an orderLine example, (*11)

$request = new \SoluteSop\Api\Request\OrderLine();
$request->setQuantityConfirmed(1)->setLineReference('001-1-1-1');
$response = $client->updateOrderLine($request);
if ($response->getError()) {
    echo $response->getError();
}

The Versions

10/04 2018

dev-master

9999999-dev http://sop.solute.de/api/swagger

Solute SOP API Client PHP

  Sources   Download

by Askold Beyer

02/02 2018

0.0.3

0.0.3.0 http://sop.solute.de/api/swagger

Solute SOP API Client PHP

  Sources   Download

by Askold Beyer

04/04 2017

0.0.2

0.0.2.0 http://sop.solute.de/api/swagger

Solute SOP API Client PHP

  Sources   Download

by Askold Beyer

04/04 2017

0.0.1

0.0.1.0 http://sop.solute.de/api/swagger

Solute SOP API Client PHP

  Sources   Download

by Askold Beyer