PHPackages                             oihana/php-magento - 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. oihana/php-magento

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

oihana/php-magento
==================

Composable PHP client for the Magento 2 REST API. Bundles an OAuth1-signed HTTP client (Guzzle), typed Magento entity schemas (Product, ProductImage, MediaGalleryEntry, ...), composable client traits, and a fluent SearchCriteria builder.

0.1.0(1mo ago)08MPL-2.0PHPPHP &gt;=8.4CI passing

Since May 31Pushed 1mo agoCompare

[ Source](https://github.com/BcommeBois/oihana-php-magento)[ Packagist](https://packagist.org/packages/oihana/php-magento)[ Docs](https://github.com/BcommeBois/oihana-php-magento)[ RSS](/packages/oihana-php-magento/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (13)Versions (2)Used By (0)

Oihana PHP Magento
==================

[](#oihana-php-magento)

[![Oihana PHP Magento](https://raw.githubusercontent.com/BcommeBois/oihana-php-magento/main/assets/images/oihana-php-magento-logo-inline-512x160.png)](https://raw.githubusercontent.com/BcommeBois/oihana-php-magento/main/assets/images/oihana-php-magento-logo-inline-512x160.png)

Composable PHP client for the [Magento 2](https://business.adobe.com/products/magento/magento-commerce.html) REST API. Part of the **Oihana PHP** ecosystem, this package bundles an OAuth1-signed HTTP client (Guzzle), typed Magento entity schemas, composable client traits, and a fluent `SearchCriteria` builder — the building blocks to query the Magento 2 REST API from PHP.

[![Latest Version](https://camo.githubusercontent.com/84a8628b319167f26a73f5d0af2897b70064f15ec0212542ad6c6d6d93577e30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6968616e612f7068702d6d6167656e746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oihana/php-magento)[![Total Downloads](https://camo.githubusercontent.com/2516d4e7810979f0c1ac2a794a1c28e3183ac3a522151de131c55ef3f6d15130/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6968616e612f7068702d6d6167656e746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oihana/php-magento)[![License](https://camo.githubusercontent.com/c836e49814fded8f883011314e4cd7d2fede9f69af4d720b24bb6aa290b79b92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f6968616e612f7068702d6d6167656e746f2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

📚 Documentation
---------------

[](#-documentation)

Full API reference (generated with phpDocumentor): `https://bcommebois.github.io/oihana-php-magento`

User guides (FR + EN) live under [`wiki/`](wiki/).

📦 Installation
--------------

[](#-installation)

Requires [PHP 8.4+](https://php.net/releases/) and a Magento 2 instance with REST API access. Install via [Composer](https://getcomposer.org/):

```
composer require oihana/php-magento
```

✨ What you can do
-----------------

[](#-what-you-can-do)

- **Talk to Magento 2 over REST** through a ready-to-use HTTP client built on Guzzle — OAuth1 signed requests (consumer key + secret + access token + secret) with automatic nonce + timestamp generation, HMAC-SHA1 / HMAC-SHA256 signatures, and proper RFC 5849 query/body parameter handling.
- **Build search criteria fluently** — the `SearchCriteria` helper turns `(field, value, condition, group, sortOrder, pageSize, currentPage)` tuples into the verbose `searchCriteria[filter_groups][...]` query parameters Magento expects.
- **Hydrate typed entities** — `Product`, `ProductImage`, `MediaGalleryEntry`, `ProductVideo`, `ProductMediaGalleryEntriesContent` and friends, with field-aware `HydrateWith` attributes for nested objects.
- **Access product media gallery** — composable `MagentoProductsTrait` exposes products and media-gallery operations on top of the client; the `MediaType` and `ProductImageThumbnail` enums make image-role logic explicit.

### Under the hood

[](#under-the-hood)

- A consistent set of value objects and enums — `Magento`, `MagentoOption`, `MagentoParam`, `SearchCriteriaParam`, `ConditionType` — no magic strings.
- Pure-PHP transport based on [GuzzleHttp](https://github.com/guzzle/guzzle) v7. OAuth1 signing is implemented from scratch in `OAuthSigner` — no third-party OAuth library required.
- Hydration delegated to [`oihana/php-reflect`](https://github.com/BcommeBois/oihana-php-reflect) — Magento response payloads map directly to typed objects via the `HydrateWith` attribute.
- Schema constants split into trait-composed `ProductTrait`, `ThingTrait`, `MediaGalleryInterfaceTrait`, `MediaGalleryEntryTrait` — composable in your own DTOs.

✅ Running tests
---------------

[](#-running-tests)

Run all tests:

```
composer test
```

Run a specific test file:

```
composer test ./tests/oihana/magento/http/OAuthSignerTest.php
```

The unit tests cover the OAuth1 signer, the search criteria builder, and the field utility helpers — they run without a live Magento instance.

🛠️ Generate the documentation
-----------------------------

[](#️-generate-the-documentation)

We use [phpDocumentor](https://phpdoc.org/) to generate documentation into the `./docs` folder.

```
composer doc
```

🧾 License
---------

[](#-license)

Licensed under the [Mozilla Public License 2.0 (MPL‑2.0)](https://www.mozilla.org/en-US/MPL/2.0/).

👤 About the author
------------------

[](#-about-the-author)

- Author: Marc ALCARAZ (aka eKameleon)
- Email: `marc@ooop.fr`
- Website: `https://www.ooop.fr`

🔗 Related packages
------------------

[](#-related-packages)

PackageDescription[oihana/php-auth](https://github.com/BcommeBois/oihana-php-auth)Casbin RBAC + JWT/OIDC authorization toolkit.[oihana/php-core](https://github.com/BcommeBois/oihana-php-core)Core helpers and utilities shared across the ecosystem.[oihana/php-enums](https://github.com/BcommeBois/oihana-php-enums)Typed constants and enums — no more magic strings.[oihana/php-exceptions](https://github.com/BcommeBois/oihana-php-exceptions)Framework exceptions with consistent semantics.[oihana/php-files](https://github.com/BcommeBois/oihana-php-files)File system helpers (paths, readers, writers).[oihana/php-http](https://github.com/BcommeBois/oihana-php-http)HTTP helpers — client IP, cookies, route patterns.[oihana/php-openedge](https://github.com/BcommeBois/oihana-php-openedge)Progress OpenEdge SQL toolkit (ODBC, query builder, models).[oihana/php-reflect](https://github.com/BcommeBois/oihana-php-reflect)Reflection and object hydration utilities.[oihana/php-system](https://github.com/BcommeBois/oihana-php-system)Framework helpers — controllers, models, request handling.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance92

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

54d ago

### Community

Maintainers

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

---

Top Contributors

[![ekameleon](https://avatars.githubusercontent.com/u/749032?v=4)](https://github.com/ekameleon "ekameleon (16 commits)")

---

Tags

phpclientGuzzlemagentooauth1ecommerceREST APImedia gallerymagento2search-criteria

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oihana-php-magento/health.svg)

```
[![Health](https://phpackages.com/badges/oihana-php-magento/health.svg)](https://phpackages.com/packages/oihana-php-magento)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[hyperf/guzzle

Swoole coroutine handler for guzzle

102.8M341](/packages/hyperf-guzzle)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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