PHPackages                             mallgroup/mpapi-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. [API Development](/categories/api)
4. /
5. mallgroup/mpapi-client

ActiveLibrary[API Development](/categories/api)

mallgroup/mpapi-client
======================

PHP Client for Mall marketplace API

v5.2.0(8mo ago)9125.3k↓34.8%17[4 PRs](https://github.com/mallgroup/mpapi-client-php/pulls)Apache-2.0PHP

Since Aug 9Pushed 8mo ago4 watchersCompare

[ Source](https://github.com/mallgroup/mpapi-client-php)[ Packagist](https://packagist.org/packages/mallgroup/mpapi-client)[ RSS](/packages/mallgroup-mpapi-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (114)Used By (0)

[![License](https://camo.githubusercontent.com/1cc346d4c0a20c0a5a05c433cb2640e98d1d1f4086cce73fb85b13f4fac7e77f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368655f322d626c7565)](https://camo.githubusercontent.com/1cc346d4c0a20c0a5a05c433cb2640e98d1d1f4086cce73fb85b13f4fac7e77f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368655f322d626c7565)[![PHPStan](https://camo.githubusercontent.com/0c08c2b9fb4be6c11840eb935ab70c25a8c879d11fca7cd25019a7883b873758/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532304d61782d627269676874677265656e2e7376673f7374796c653d666c6174266c6f676f3d706870)](https://camo.githubusercontent.com/0c08c2b9fb4be6c11840eb935ab70c25a8c879d11fca7cd25019a7883b873758/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532304d61782d627269676874677265656e2e7376673f7374796c653d666c6174266c6f676f3d706870)[![Psalm](https://camo.githubusercontent.com/4a36ba59bcd53e80f3d3c18909601c982d0bebe211c15e52d8f98c2deebed369/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5073616c6d2d6c6576656c253230322d627269676874677265656e2e7376673f7374796c653d666c6174266c6f676f3d706870)](https://camo.githubusercontent.com/4a36ba59bcd53e80f3d3c18909601c982d0bebe211c15e52d8f98c2deebed369/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5073616c6d2d6c6576656c253230322d627269676874677265656e2e7376673f7374796c653d666c6174266c6f676f3d706870)

Mall Marketplace API Client
===========================

[](#mall-marketplace-api-client)

Description
-----------

[](#description)

MPAPI client is a tool created to help Internet Mall, a. s. partners easily manage article catalogue, deliveries, orders etc. using Mall Marketplace API.

Requirements
------------

[](#requirements)

- `64bit` version of `PHP 7.4` or `PHP 8`
- Guzzle 7

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

[](#installation)

To install the client using [Composer](https://getcomposer.org/doc/00-intro.md) run following command in your repository

```
composer require mallgroup/mpapi-client
```

Implementation
--------------

[](#implementation)

### Info

[](#info)

Client consists of one main client and multiple, separate, domain clients.

The main client groups all domain clients under one object, for easier implementation, but every domain client can be initialized and used by itself.

Every client provides an interface that SHOULD be used as parameter types in code, instead of client classes themselves (i.e., use `MpApiClientInterface $client`or `BrandsClientInterface $client` instead of `MpApiClient $client` or `BrandsClient $client`).

When initializing the client, you MUST provide

1. an authenticator implementing [AuthMiddlewareInterface](src/Common/Interfaces/AuthMiddlewareInterface.php)
    - currently, only [ClientIdAuthenticator](src/Common/Authenticators/ClientIdAuthenticator.php), which accepts `my-client-id`, is provided
    - in the future, new authenticators will be released (i.e., OAuth)
2. name of the app using the API
    - it is sent with every request to Mall API for easier request identification and debugging of reported issues
    - please provide a simple, yet meaningful name, i.e., `MyAppName CRM` or `MyAppName Order sync` instead of a random string

### Examples

[](#examples)

There are 2 main ways to initialize the client

### 1. Using [MpApiClient](src/MpApiClient.php) with default config

[](#1-using-mpapiclient-with-default-config)

```
