Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

ilazaridis/skroutz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.