2017 © Pedro Peláez
 

library becosoft-fashionpro-nl-php-api

PHP Wrapper for the Becosoft Fashionpro NL API

image

stefandoorn/becosoft-fashionpro-nl-php-api

PHP Wrapper for the Becosoft Fashionpro NL API

  • Sunday, August 13, 2017
  • by stefandoorn
  • Repository
  • 1 Watchers
  • 1 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

Becosoft Fashionpro NL PHP API Wrapper

Build StatusScrutinizer Code QualityCode CoverageLatest Stable VersionLicense, (*1)

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)

Requirements

  • PHP >= 5.5

Installation

composer require stefandoorn/becosoft-fashionpro-nl-php-api

Usage

Create wrapper instance

/**
 * 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 items

  • Use 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.
  • Use 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.

Examples

Load Articles

$gateway = GatewayFactory::get('apiKey', $debug = true);
$api = new Api($gateway);
$entity = new Artikel($this->api);

$allArticles = $entity->getAll();

Load Articles with a filter

$gateway = GatewayFactory::get('apiKey', $debug = true);
$api = new Api($gateway);

$allArticles = $entity->getAll([
    'brand' => $brand,
    'internetPublished' => 'true',
]);

POST items

  • Use post on an entity to push a single item to Becosoft

Examples

POST Weborder

$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)

The Versions

13/08 2017

dev-master

9999999-dev

PHP Wrapper for the Becosoft Fashionpro NL API

  Sources   Download

MIT

The Requires

 

The Development Requires