ilazaridis / skroutz
A PHP7 library for skroutz.gr API
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2022-11-12 17:01:48 UTC
README
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.