dev-master
9999999-devPHP Wrapper for the Becosoft Fashionpro NL API
MIT
The Requires
The Development Requires
by Stefan Doorn
PHP Wrapper for the Becosoft Fashionpro NL API
This package provides a simple PHP Wrapper around the Becosoft Fashionpro API: http://api.fashionpro.becosoft.net/swagger/ui/index)., (*2)
Please note: * The endpoints are in Dutch. An English API is not yet available. * The entities provided in this package written as used in the API, all other code is English based., (*3)
composer require stefandoorn/becosoft-fashionpro-nl-php-api
/** * Api constructor. * @param GatewayInterface $gateway */ public function __construct(GatewayInterface $gateway)
Quick start:, (*4)
$gateway = GatewayFactory::get('apiKey', $debug = true); $api = new Api($gateway);
The API allows you to insert your own Gateway
. The default Gateway
(from the factory) uses a Guzzle
instance for the API communication and a NullLogger
instance for logging (no logging). Supply your own logger to make sure logging is possible. If needed, also supply your own gateway implementation., (*5)
get
on an entity to push a single GET request using the optional filters you specify. Refer to the API documentation which filters you can use per entity.getAll
on an entity to get all items that adhere to your filter. The wrapper takes care of sending enough requests to fetch all items (using the take/skip
parameters) in batches of 50 items.$gateway = GatewayFactory::get('apiKey', $debug = true); $api = new Api($gateway); $entity = new Artikel($this->api); $allArticles = $entity->getAll();
$gateway = GatewayFactory::get('apiKey', $debug = true); $api = new Api($gateway); $allArticles = $entity->getAll([ 'brand' => $brand, 'internetPublished' => 'true', ]);
post
on an entity to push a single item to Becosoft$gateway = GatewayFactory::get('apiKey', $debug = true); $api = new Api($gateway); $entity = new BecosoftApi\Entity\Weborder($this->api); $weborder = new BecosoftApi\Model\Weborder; $weborder->WeborderId = 1; ... $result = $entity->post($weborder->toJson();
Currently you have to insert a JSON object yourself, which gives flexibility. The Weborder model is simply a helper model to make sure you insert fields with the correct name., (*6)
PHP Wrapper for the Becosoft Fashionpro NL API
MIT