PSW GROUP API
Our API empowers customers to build amazing new apps or websites using PSW GROUP shop data and services. This SDK provides all the code necessary for the integration of our API into your projects.
If composer is not yet on your system, follow the instructions on getcomposer.org to do so.
To add the psw-group/api-v1 dependency to your project, simply run the following command from the root of your project:
$ composer require psw-group/api-v1
You will need a recent version of PHP, at least PHP 7.2.
This package requires PSR-17 compatible request/URI factories and a PSR-18 compatible HTTP client. If no factories are supplied, it uses PHP-HTTP discovery to find installed implementations.
For example if you want to use Guzzle as HTTP client execute:
$ composer require http-interop/http-factory-guzzle php-http/guzzle6-adapter
Create a client for the environment (test or production) you want to use. Inject it into a repository. Repositories then allow you to load single resources or collections of resources and provide methods to execute operations on those resources.
<?php use PswGroup\Api\TestClient; use PswGroup\Api\Repository\ProductRepository; include 'vendor/autoload.php'; // Create a client for the test environment $client = new TestClient( '[yourClientId]', '[yourClientSecret]' ); // Load all available products $productRepository = new ProductRepository($client); $products = $productRepository->loadAll();
There are a number of files in the examples folder, which show you how to get started quickly.
For more detailed information you can check the docs folder.
The MIT License (MIT). Please see License File for more information.