PHPackages                             repat/plentymarkets-rest-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. repat/plentymarkets-rest-client

ActiveApplication[HTTP &amp; Networking](/categories/http)

repat/plentymarkets-rest-client
===============================

REST Client for Plentymarkets

0.1.16(4y ago)1410.7k↓64.6%13MITPHPPHP ^5.6 | ^7.0 | ^8.0 | ^8.1CI failing

Since Apr 2Pushed 4y ago4 watchersCompare

[ Source](https://github.com/repat/plentymarkets-rest-client)[ Packagist](https://packagist.org/packages/repat/plentymarkets-rest-client)[ Docs](https://github.com/repat/plentymarkets-rest-client)[ RSS](/packages/repat-plentymarkets-rest-client/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (17)Used By (0)

plentymarkets-rest-client
=========================

[](#plentymarkets-rest-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/847386aa5e16378e81714978d8b85041d171aa2724f3c286b66b8cb5494c3716/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657061742f706c656e74796d61726b6574732d726573742d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/repat/plentymarkets-rest-client)[![Total Downloads](https://camo.githubusercontent.com/6619c4c2980082f31066ee1cc70c53a5cff01003550a79369cd4be7c0a215c3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72657061742f706c656e74796d61726b6574732d726573742d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/repat/plentymarkets-rest-client)

This is a PHP package for Plentymarkets new REST API. The API is relatively new at time of writing (March 2017), so not everything might work correctly and this package might also be out of date at some point.

I'm not in anyway affiliated with Plentymarkets, nor do I get paid for this by anybody. As it says in the license, this software is 'as-is'. If you want/need more features, open a GitHub ticket or write a pull request. I'll do my best :) That said, I don't work for the company I developed this for anymore, so if you have any interest in becoming a contributor on this repo, let me know.

You can find the Plentymarkets documentation [here](https://developers.plentymarkets.com/):

Overview
--------

[](#overview)

- Functions for the 4 HTTP verbs: GET, POST, PUT, DELETE
- Automatic login and refresh if login is not valid anymore
- Simple one-time configuration with PHP array (will be saved serialized in a file)
- Functions return an associative array by default or raw data (e.g. for files)
- Handle rate limiting (thanks [hepisec](http://github.com/hepisec))

Installation
------------

[](#installation)

Available via composer on [Packagist](https://packagist.org/packages/repat/plentymarkets-rest-client):

`composer require repat/plentymarkets-rest-client`

Usage
-----

[](#usage)

```
use repat\PlentymarketsRestClient\PlentymarketsRestClient;

// path to store the configuration in
$configFilePath = ".plentymarkets-rest-client.config.php";
// $config only has to be set once like this
$config = [
    "username" => "PM_USERNAME",
    "password" => "PM_PASSWORD",
    "url" => "https://www.plentymarkets-system.tld",
];

// Handle (Guzzle) Exceptions yourself - optional 3rd parameter
$handleExceptions = PlentymarketsRestClient::HANDLE_EXCEPTIONS; // true
$handleExceptions = PlentymarketsRestClient::DONT_HANDLE_EXCEPTIONS; // false (default)

// Init
$client = new PlentymarketsRestClient($configFilePath, $config, $handleExceptions);

// After that just use it like so
$client = new PlentymarketsRestClient($configFilePath);
```

It's possible to use the 4 HTTP verbs like this

```
$client->get($path, $parameterArray);
$client->post($path, $parameterArray);
$client->put($path, $parameterArray);
$client->delete($path, $parameterArray);

// $parameterArray has to be a PHP array. It will be transformed into JSON automatically in case
// of POST, PUT and DELETE or into query parameters in case of GET.
// You don't _have_ to specify it, it will then just be empty
$parameterArray = [
    "createdAtFrom" => "2016-10-24T13:33:23+02:00"
];

// $path is the path you find in the Plentymarkets documentation
$path = "rest/orders/";
```

It's also possible to use the function like this. It gives you more freedom, since you can specify the method and the $parameters given are directly given to the [Guzzle object](http://docs.guzzlephp.org/en/latest/quickstart.html).

```
$client->singleCall("GET", $guzzleParameterArray);
```

### Raw Data

[](#raw-data)

Some endpoints, such as `/rest/bi/raw-data/file` don't return JSON but a raw file. However, by default a single call tries to [`json_decode()`](https://www.php.net/manual/en/function.json-decode.php) the response. You can disable it by setting the `$jsonDecodeEnabled` flag to `false`.

```
$client->setJsonDecodeEnabled(PlentymarketsRestClient::JSON_DECODE_DISABLED);
```

### Errors

[](#errors)

- If there was an error with the call (=&gt; guzzle throws an exception) all methods will return false, unless `$handleExceptions` has been set to `true`, in which case the exception will be handed through
- If the specified config file doesn't exist or doesn't include username / password / url, an exception will be thrown

TODO
----

[](#todo)

- Refresh without new login but refresh-token

Dependencies
------------

[](#dependencies)

- [https://packagist.org/packages/nesbot/carbon](nesbot/carbon) for date comparison
- [https://packagist.org/packages/guzzlehttp/guzzle](guzzlehttp/guzzle) for HTTP calls.

License
-------

[](#license)

- see [LICENSE](https://github.com/repat/plentymarkets-rest-client/blob/master/LICENSE) file

Changelog
---------

[](#changelog)

- 0.1.16 Enable / Disable `json_decode()` to allow for querying for raw files (thx dark-cms)
- 0.1.15 Enable returning PDFs (thx ewaldmedia)
- 0.1.14 Add *short period write limit reached* error handling (thx resslinger)
- 0.1.13 Change from [Laravels `str_contains`](https://github.com/laravel/framework/blob/8.x/src/Illuminate/Support/Str.php#L181) to [PHPs `stripos()`](https://www.php.net/manual/de/function.stripos.php) because [it doesn't require `ext-mbstring`](https://github.com/repat/plentymarkets-rest-client/pull/16#issuecomment-880731813) (thx DanMan)
- 0.1.12 Remove `danielstjules/stringy` dependency, copy over [Laravels `str_contains`](https://github.com/laravel/framework/blob/8.x/src/Illuminate/Support/Str.php#L181) instead
- 0.1.11 PHP 8 Support &amp; wait in case of *short period read limit reached* error (thx [fwehrhausen](https://github.com/repat/plentymarkets-rest-client/pull/15))
- 0.1.10 Allow dealing with Exceptions yourself by passing `true` as 3rd parameter
- 0.1.9 Bugfix `isAccessTokenValid()` (thx [hochdruckspezialist](https://github.com/repat/plentymarkets-rest-client/pull/14))
- 0.1.8 Update, so Carbon 2.0 can be used (thx [stefnats](https://github.com/repat/plentymarkets-rest-client/pull/12))
- 0.1.7 Fix constructor according to README (thx [daniel-mannheimer](https://github.com/repat/plentymarkets-rest-client/pull/11))
- 0.1.6 Support for HTTP `PATCH` (thx [hepisec](https://github.com/repat/plentymarkets-rest-client/pull/10))
- 0.1.5 Remove check for `www.` as it breaks subdomains (thx [daniel-mannheimer](https://github.com/repat/plentymarkets-rest-client/pull/9))
- 0.1.4 Automatic rate limiting (thx [hepisec](https://github.com/repat/plentymarkets-rest-client/pull/8))
- 0.1.3 Fix PHP 7.2 dependency
- 0.1.2 Fix Carbon dependency
- 0.1.1 Update Guzzle for PHP 7.2
- 0.1 initial release

Contact
-------

[](#contact)

- Homepage:
- e-mail:
- Twitter: [@repat123](https://twitter.com/repat123 "repat123 on twitter")

[![Flattr this git repo](https://camo.githubusercontent.com/7e3f46a36526479d701ef7f90a0f8c3ac2fbab3087446e2a9fceed75cd1ab802/687474703a2f2f6170692e666c617474722e636f6d2f627574746f6e2f666c617474722d62616467652d6c617267652e706e67)](https://flattr.com/submit/auto?user_id=repat&url=https://github.com/repat/plentymarkets-rest-client&title=plentymarkets-rest-client&language=&tags=github&category=software)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 74.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~91 days

Total

16

Last Release

1494d ago

PHP version history (4 changes)0.1.1PHP &gt;=5.6.0

0.1.8PHP &gt;=5.6.0 | &gt;=7.1.8

0.1.11PHP ^5.6 | ^7.0 | ^8.0

0.1.16PHP ^5.6 | ^7.0 | ^8.0 | ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/405dab243007488e7e7851422e5864a9312aee36058d60f1e6d623232c4d3131?d=identicon)[repat](/maintainers/repat)

---

Top Contributors

[![repat](https://avatars.githubusercontent.com/u/516807?v=4)](https://github.com/repat "repat (41 commits)")[![daniel-mannheimer](https://avatars.githubusercontent.com/u/1114328?v=4)](https://github.com/daniel-mannheimer "daniel-mannheimer (6 commits)")[![hepisec](https://avatars.githubusercontent.com/u/15111012?v=4)](https://github.com/hepisec "hepisec (4 commits)")[![f-wehrhausen](https://avatars.githubusercontent.com/u/87071395?v=4)](https://github.com/f-wehrhausen "f-wehrhausen (1 commits)")[![ewaldmedia](https://avatars.githubusercontent.com/u/11617085?v=4)](https://github.com/ewaldmedia "ewaldmedia (1 commits)")[![resslinger](https://avatars.githubusercontent.com/u/6031484?v=4)](https://github.com/resslinger "resslinger (1 commits)")[![stefnats](https://avatars.githubusercontent.com/u/1174473?v=4)](https://github.com/stefnats "stefnats (1 commits)")

---

Tags

apiclientsdkrestPlentymarketspm

### Embed Badge

![Health badge](/badges/repat-plentymarkets-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/repat-plentymarkets-rest-client/health.svg)](https://phpackages.com/packages/repat-plentymarkets-rest-client)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34216.9k2](/packages/onesignal-onesignal-php-api)[cybercog/youtrack-rest-php

YouTrack REST API PHP Client.

37153.1k3](/packages/cybercog-youtrack-rest-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[cybercog/laravel-youtrack-sdk

Laravel wrapper for PHP YouTrack SDK.

201.0k](/packages/cybercog-laravel-youtrack-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
