Skip to content

psw-group/api-v1

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

PSW GROUP API

Latest Version on Packagist Software License Total Downloads

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.

Installation

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

Requirements

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

Usage

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.

Documentation

For more detailed information you can check the docs folder.

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages