Skip to content

monetivo/shoper-json-api-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shoper JSON API Client

Requirements and dependencies

You need PHP 5.5 and later. Additionally, make sure that the following PHP extensions are installed on your server:

Composer

You can install the client via Composer by running the command:

composer require monetivo/shoper-json-api-php

Then use Composer's autoload mechanism:

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then include the autoload.php file.

require_once('/path/to/shoper-json-api-php/autoload.php');

Getting Started

Basic usage looks like:

<?php

try {
    // Shoper shop url
    $shopUrl = 'https://shop.url/';

    // webapi user login
    $login = 'webapi';

    // webapi user password
    $password = 's33m$d!FFicult';

    // init client
    $client = new \Monetivo\ShoperJsonApi($shopUrl);

    // try login, throws exception on fail
    $client->login($login, $password);

    //example - get order list
    $orderList = $client->orderList(true, false, null);

    $client->logout();
}
catch (\Monetivo\Exceptions\MonetivoException $e)
{
    // Shoper error message
    $e->getMessage();
    // Shoper error code
    $e->getCode();
}

Documentation

See https://www.shoper.pl/api for information about acquiring webapi credentials and documentation of available methods.

Issues

If you find any issues, please do not hesitate to file them via GitHub.

Packages

No packages published

Languages