PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Initial commit Feb 5, 2017
tests Initial commit Feb 5, 2017
.gitignore Add missing gitignore + travis Feb 5, 2017
.travis.yml Add missing gitignore + travis Feb 5, 2017
LICENSE Initial commit Feb 5, 2017
README.md Minor documentation update Feb 6, 2017
composer.json Initial commit Feb 5, 2017
phpunit.xml Initial commit Feb 5, 2017

README.md

Skroutz

Travis Latest Stable Version Minimum PHP Version

PHP7 Client for skroutz API

Installation

composer require ilazaridis/skroutz

Usage Examples

Once you have an Identifier and a Secret you are ready to generate an access token:

<?php

require_once 'vendor/autoload.php';
use ilazaridis\skroutz\Client as Client;

$client = new Client('identifier', 'secret');

and consume it:

print_r($client->category('40')->fetch());  // get category with id=40

fetch(bool $decode = true, string $apiVersion = '3.1') will return an associative array using latest version of api by default. You can pass a boolean and a string if you want to change these values.

  • List the children categories of a category
$client->category('40')->children()->fetch()
  • Retrieve a single shop location
$client->shop('452')->location('2500')->fetch()
  • Retrieve manufacturer's categories order by name
$client->category('25')->manufacturers()->params(['order_by' => 'name', 'order_dir' => 'asc'])->fetch()

The query string is passd as associative array using the params() method. In case we have multiple values of the same parameter (i.e. filter_ids[]), we are passing them as comma seperated values:

  • Filter SKUs of specific category using multiple filter ids
$client->category('40')->skus()->params(['filter_ids[]' => '355559,6282'])->fetch()

Note

Some of the API methods have not been implemented due to access restriction. Currently, the acquired permission level is public and everything on that level was implemented.