PHPackages                             unopim/api-php-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. unopim/api-php-client

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

unopim/api-php-client
=====================

Official PHP API client for the UnoPim PIM — authenticate, paginate, and manage products, categories, attributes, families, channels, locales, and assets. Framework-agnostic, PSR-18 compatible.

1.0.0(1mo ago)012[1 PRs](https://github.com/unopim/api-php-client/pulls)MITPHPPHP &gt;=8.1CI passing

Since Apr 29Pushed 1mo agoCompare

[ Source](https://github.com/unopim/api-php-client)[ Packagist](https://packagist.org/packages/unopim/api-php-client)[ Docs](https://github.com/unopim/api-php-client)[ Fund](https://unopim.com)[ GitHub Sponsors](https://github.com/unopim)[ RSS](/packages/unopim-api-php-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

UnoPim PHP API Client
=====================

[](#unopim-php-api-client)

[![Tests](https://github.com/unopim/api-php-client/actions/workflows/tests.yml/badge.svg)](https://github.com/unopim/api-php-client/actions/workflows/tests.yml)[![License: MIT](https://camo.githubusercontent.com/f29ee806342b2b30db13001099607e85e765b255a8cf12df6d4d02564173d9e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f756e6f70696d2f6170692d7068702d636c69656e742e737667)](LICENSE)

Official PHP client for the [UnoPim](https://unopim.com) PIM REST API.

Works in **any PHP project** — Laravel, Symfony, WordPress, Magento, Drupal, plain PHP.

---

Install
-------

[](#install)

```
composer require unopim/api-php-client
```

That's it. The bundled cURL client works out of the box — no extra HTTP package needed. Want Guzzle or Symfony HttpClient instead? See [HTTP clients](#using-other-http-clients).

Connect
-------

[](#connect)

```
use Unopim\ApiClient\UnoPimClient;

$client = UnoPimClient::create(
    baseUrl:      'https://your-unopim.example.com',
    clientId:     'your-client-id',
    clientSecret: 'your-client-secret',
    username:     'admin@example.com',
    password:     'your-admin-password',
);
```

> **Where do credentials come from?**In UnoPim admin: **System → API Clients → Create**. Note the Client ID &amp; Secret. Username / password = any admin user's login.

---

Examples
--------

[](#examples)

### List all products

[](#list-all-products)

```
foreach ($client->products()->iterate() as $product) {
    echo $product['sku'], PHP_EOL;
}
```

### Get one product

[](#get-one-product)

```
$product = $client->products()->get('MY-SKU-001');
```

### Create a product

[](#create-a-product)

```
$client->products()->create([
    'sku'        => 'NEW-SKU',
    'parent'     => null,
    'family'     => 'default',
    'type'       => 'simple',
    'additional' => null,
    'values'     => [
        'common' => [
            'sku'  => 'NEW-SKU',
            'name' => 'My Product',
        ],
        'channel_locale_specific' => [
            'ecommerce' => [
                'en_US' => [
                    'description' => 'Hello world.',
                    'price'       => '{"USD":"49.99"}',
                ],
            ],
        ],
    ],
]);
```

### Update a product

[](#update-a-product)

```
$client->products()->update('NEW-SKU', [
    'sku'    => 'NEW-SKU',
    'family' => 'default',
    'type'   => 'simple',
    'values' => [
        'common' => ['sku' => 'NEW-SKU', 'name' => 'Updated Name'],
    ],
]);
```

### Delete a product

[](#delete-a-product)

```
$client->products()->delete('NEW-SKU');
```

### Categories, attributes, families…

[](#categories-attributes-families)

Same shape — `$client->categories()`, `$client->attributes()`, `$client->attributeFamilies()`, etc.

```
// All categories
$categories = $client->categories()->list();

// Create attribute
$client->attributes()->create([
    'code'        => 'color',
    'type'        => 'select',
    'labels'      => ['en_US' => 'Color'],
    'is_unique'   => false,
    'is_required' => false,
]);

// Add options to it
$client->attributes()->createOptions('color', [
    ['code' => 'red',  'labels' => ['en_US' => 'Red']],
    ['code' => 'blue', 'labels' => ['en_US' => 'Blue']],
]);
```

### Upload a product image

[](#upload-a-product-image)

```
$client->mediaFiles()->uploadProductMedia('/path/to/image.jpg');
```

### Raw call to any endpoint

[](#raw-call-to-any-endpoint)

If a resource isn't wrapped yet:

```
$client->get('/api/v1/rest/some-endpoint');
$client->post('/api/v1/rest/some-endpoint', $payload);
$client->put('/api/v1/rest/some-endpoint/code', $payload);
$client->delete('/api/v1/rest/some-endpoint/code');

// Auto-paginates
$all = $client->fetchAll('/api/v1/rest/products', batchSize: 100);
```

More runnable scripts in [`examples/`](examples/).

---

Available resources
-------------------

[](#available-resources)

AccessorMethods`$client->locales()``list()`, `get($code)``$client->currencies()``list()`, `get($code)``$client->channels()``list()`, `get($code)``$client->categories()``list()`, `get($code)`, `create($data)`, `update($code, $data)``$client->categoryFields()``list()`, `get($code)`, `create($data)`, `update($code, $data)``$client->attributes()``list()`, `get($code)`, `create($data)`, `update($code, $data)`, `listOptions($code)`, `createOptions($code, $data)`, `updateOptions($code, $data)``$client->attributeGroups()``list()`, `get($code)`, `create($data)`, `update($code, $data)``$client->attributeFamilies()``list()`, `get($code)`, `create($data)`, `update($code, $data)``$client->products()``list()`, `iterate()`, `get($sku)`, `create($data)`, `update($sku, $data)`, `delete($sku)``$client->configurableProducts()``list()`, `iterate()`, `get($sku)`, `create($data)`, `update($sku, $data)``$client->mediaFiles()``uploadProductMedia($filePath)`, `uploadCategoryMedia($filePath)`---

Errors
------

[](#errors)

```
use Unopim\ApiClient\Exception\ApiException;
use Unopim\ApiClient\Exception\AuthenticationException;

try {
    $client->products()->get('MISSING-SKU');
} catch (AuthenticationException $e) {
    // 401 — bad credentials
} catch (ApiException $e) {
    $e->getStatusCode();   // int
    $e->getResponseBody(); // string
    $e->getMessage();
}
```

---

Using other HTTP clients
------------------------

[](#using-other-http-clients)

The bundled cURL adapter works for everyone. If you want Guzzle, Symfony HttpClient, or any other PSR-18 client:

### Guzzle

[](#guzzle)

```
composer require guzzlehttp/guzzle guzzlehttp/psr7
```

```
use GuzzleHttp\Client as Guzzle;
use GuzzleHttp\Psr7\HttpFactory;
use Unopim\ApiClient\UnoPimClient;

$g = new Guzzle(['timeout' => 30]);
$f = new HttpFactory();

$client = UnoPimClient::createWithHttpClient(
    'https://your-unopim.example.com', 'cid', 'csec', 'admin@example.com', 'pass',
    $g, $f, $f,
);
```

### Symfony HttpClient

[](#symfony-httpclient)

```
composer require symfony/http-client nyholm/psr7
```

```
use Symfony\Component\HttpClient\Psr18Client;
use Unopim\ApiClient\UnoPimClient;

$s = new Psr18Client();
$client = UnoPimClient::createWithHttpClient(
    'https://your-unopim.example.com', 'cid', 'csec', 'admin@example.com', 'pass',
    $s, $s, $s,
);
```

---

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

[](#requirements)

- PHP **8.1+**
- `ext-curl`, `ext-json`
- UnoPim server **v2.0+**

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

Issues / Contributing
---------------------

[](#issues--contributing)

[Open an issue](https://github.com/unopim/api-php-client/issues) or send a PR. See [CONTRIBUTING.md](CONTRIBUTING.md).

Maintained by [Webkul Software Pvt. Ltd.](https://webkul.com)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance92

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

41d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/282263096?v=4)[navneetbhardwaj](/maintainers/navneetbhardwaj)[@NavneetBhardwaj](https://github.com/NavneetBhardwaj)

---

Top Contributors

[![navneetkumar-pim-webkul](https://avatars.githubusercontent.com/u/26001046?v=4)](https://github.com/navneetkumar-pim-webkul "navneetkumar-pim-webkul (7 commits)")

---

Tags

phppsr-18oauth2REST APIPIMapi clientProduct Information Managementunopim

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/unopim-api-php-client/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B3.7k](/packages/guzzlehttp-psr7)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

185671.3k41](/packages/laudis-neo4j-php-client)[claude-php/claude-php-sdk

A universal, framework-agnostic PHP SDK for the Anthropic Claude API with PSR compliance

14440.4k2](/packages/claude-php-claude-php-sdk)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28146.3k](/packages/phpro-http-tools)

PHPackages © 2026

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