monetivo / shoper-json-api-php
Shoper JSON API PHP client
1.0
2017-04-13 09:12 UTC
Requires
- php: >=5.5
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2024-04-27 23:55:29 UTC
README
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.