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

ActiveLibrary[API Development](/categories/api)

magentix/magento-php-api-client
===============================

Simple PHP Magento API Client

1.1.5(2mo ago)1207↓25%1PHPPHP &gt;=8

Since Feb 6Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/magentix/magento-php-api-client)[ Packagist](https://packagist.org/packages/magentix/magento-php-api-client)[ RSS](/packages/magentix-magento-php-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

Simple PHP Magento API Client
=============================

[](#simple-php-magento-api-client)

One class without dependency

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

[](#installation)

```
composer require magentix/magento-php-api-client
```

Authorisation
-------------

[](#authorisation)

Create a new authorisation in Magento Admin:

*System &gt; Extension &gt; Integration*

Usage
-----

[](#usage)

```
$consumerKey = 'll6io7s7pzyvzaulktzplenwsfn8udgx';
$consumerSecret = 'r0xw7zpd5i5n2io4ez3lw59pxfjlhsvw';
$accessToken = '0bfsszueo0zo6lzo7u4cckh56rzyhokq';
$accessTokenSecret = 'ntird82zskvmc4boo40q8wbsugt948vt';

$client = new \Magentix\MagentoApiClient\MagentoApiClient(
    $consumerKey,
    $consumerSecret,
    $accessToken,
    $accessTokenSecret
);
```

Cache
-----

[](#cache)

A cache is available for GET requests.

```
$cache = new \Magentix\MagentoApiClient\MagentoApiCache(
    3600, // Default lifetime in second
    __DIR__ . DIRECTORY_SEPARATOR . 'api_cache' // The cache file directory path
);

$client = new \Magentix\MagentoApiClient\MagentoApiClient(
    $consumerKey,
    $consumerSecret,
    $accessToken,
    $accessTokenSecret,
    $cache
);
```

The cache lifetime and name can be specific depending on the requests.

```
$url = 'XXX';
$client->getCache()->setLifetime(60); // The next request will be cached for 60s
$client->getCache()->setCacheName('product'); // The next request will be cached in product.cache file
$client->get($url);

$url = 'YYY';
$client->getCache()->setLifetime(300); // The next request will be cached for 300s
$client->getCache()->setCacheName('category'); // The next request will be cached in category.cache file
$client->get($url);
```

### GET

[](#get)

```
$url = 'https://www.example.com/index.php/rest/all/V1/products/SKU0001';

$client->get($url);
```

```
$url = 'https://www.example.com/index.php/rest/all/V1/products';
$params = [
    'searchCriteria' => [
        'filter_groups' => [
            [
                'filters' => [
                    [
                        'field' => 'status',
                        'value' => '1',
                        'condition_type' => 'eq',
                    ]
                ]
            ]
        ]
    ],
    'fields' => 'items[id,name,custom_attributes]',
];

$client->get($url, $params);
```

### DELETE

[](#delete)

```
$url = 'https://www.example.com/index.php/rest/all/V1/products/SKU0001';

$client->delete($url);
```

### PUT

[](#put)

```
$url = 'https://www.example.com/index.php/rest/all/V1/products/SKU0001';
$data = [
    'product' => [
        'name' => 'My Product',
    ]
];

$client->put($url, $data);
```

### POST

[](#post)

```
$url = 'https://www.example.com/index.php/rest/all/V1/products';
$data = [
    'product' => [
        'sku' => 'SKU0001',
        'name' => 'My Product',
        'price' => '10.00',
        'attribute_set_id' => 4,
        'status' => 1,
        'visibility' => 4,
        'type_id' => 'simple',
        'weight' => 0.1,
        'extension_attributes' => [
            'website_ids' => [1],
            'stock_item' => [
                'qty' => 100,
                'is_in_stock' => true,
            ]
        ],
        'custom_attributes' => [
            [
                'attribute_code' => 'url_key',
                'value' => 'my-product',
            ],
            [
                'attribute_code' => 'category_ids',
                'value' => [4],
            ]
        ]
    ]
];

$client->post($url, $data);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community9

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

Every ~56 days

Recently: every ~96 days

Total

8

Last Release

73d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/884247993aa6a48e2c3a2071a98e0bc2c92e3519ecc8d5b22a9b07e5183a5a0f?d=identicon)[magentix](/maintainers/magentix)

---

Top Contributors

[![magentix](https://avatars.githubusercontent.com/u/346889?v=4)](https://github.com/magentix "magentix (20 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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