PHPackages                             imper86/php-immi-api - 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. imper86/php-immi-api

ActiveLibrary

imper86/php-immi-api
====================

PHP SDK for immi.shop API

v2.0.0(3y ago)0761MITPHPPHP ^7.4 || ^8.0

Since Feb 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/imper86/php-immi-api)[ Packagist](https://packagist.org/packages/imper86/php-immi-api)[ RSS](/packages/imper86-php-immi-api/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (14)Used By (0)

Immi.shop API PHP SDK
=====================

[](#immishop-api-php-sdk)

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

[](#installation)

Just use composer:

```
composer require imper86/php-immi-api
```

### HTTPlug note

[](#httplug-note)

This lib uses [HTTPlug](https://github.com/php-http/httplug)so it doesn't depend on any http client. In order to use this lib you must have some [PSR-18 http client](https://www.php-fig.org/psr/psr-18)and [PSR-17 http factories](https://www.php-fig.org/psr/psr-17). If you don't know which one you shoud install you can require these:

```
composer require php-http/guzzle6-adapter http-interop/http-factory-guzzle
```

Usage
-----

[](#usage)

Library has a bunch of mechanisms that allows you to forget about tokens, expirations etc. But in order to start using it you must authorize user using Oauth flow.

### Client credentials flow example

[](#client-credentials-flow-example)

```
use Http\Client\Common\Plugin\ErrorPlugin;
use Imper86\ImmiApi\Immi;
use Imper86\ImmiApi\Model\Credentials;
use Imper86\ImmiApi\Oauth\FileTokenRepository;
use Imper86\ImmiApi\Plugin\AuthPlugin;

$sandbox = true; //if set to false you will connect to production environment
$credentials = new Credentials(
    'your_client_id',
    'your_client_secret',
    null,
    $sandbox
);
$client = new Immi($credentials);

/*
 * You can invent your own TokenRepository, just implement
 * our TokenRepositoryInterface.
 * You can use your DB, Redis, or anything you want.
 * For this example we use included FileTokenRepository
 */
$tokenRepository = new FileTokenRepository(__DIR__ . '/var/immi_token.json');

if (!$tokenRepository->load()) {
    $tokenRepository->save($client->oauth()->fetchTokenWithClientCredentials());
}

//this plugin will take care of refreshing expired access tokens and will store new ones with $tokenRepository
$client->addPlugin(new AuthPlugin($tokenRepository, $client->oauth()));
//optional, this plugin will throw exceptions on every negative http status code
$client->addPlugin(new ErrorPlugin());

$response = $client->users()->me()->get();

dump(json_decode($response->getBody()->__toString(), true));
```

### Auth code flow

[](#auth-code-flow)

If you want to use it, please contact me to get detailed info.

### Resources

[](#resources)

You can use client instantiated in auth part.

From now you can use these methods on $client:

```
use Imper86\ImmiApi\Immi;
$client->api()->(...)
$client->attributes()->(...)
$client->carts()->(...)
$client->commands()->(...)
$client->contactRequests()->(...)
$client->countries()->(...)
$client->orders()->(...)
$client->products()->(...)
$client->users()->(...)
```

If you use IDE with typehinting such as PHPStorm, you'll easily figure it out. If not, please [take a look in Resource directory](src/Resource)

**Be aware than not all resources will be accessible for you. Many of them requires admin role, because the API is shared between admin users and client users.**

Contributing
------------

[](#contributing)

Any help will be very appreciated.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~87 days

Recently: every ~212 days

Total

13

Last Release

1230d ago

Major Versions

v1.2.0 → v2.0.02023-01-04

PHP version history (2 changes)v1.0.0PHP ^7.1

v2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/aedc51c5ea25d6520027720f9a5599e171e95a47102b66ffd929427f95317561?d=identicon)[imper86](/maintainers/imper86)

---

Top Contributors

[![imper86](https://avatars.githubusercontent.com/u/16724155?v=4)](https://github.com/imper86 "imper86 (14 commits)")

### Embed Badge

![Health badge](/badges/imper86-php-immi-api/health.svg)

```
[![Health](https://phpackages.com/badges/imper86-php-immi-api/health.svg)](https://phpackages.com/packages/imper86-php-immi-api)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[symfony/form

Allows to easily create, process and reuse HTML forms

2.8k152.1M2.8k](/packages/symfony-form)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)

PHPackages © 2026

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