PHPackages                             apiera/woo-php-sdk - 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. apiera/woo-php-sdk

AbandonedArchivedLibrary[API Development](/categories/api)

apiera/woo-php-sdk
==================

Woo Rest API PHP SDK composer library

0.1.0(1y ago)01[3 issues](https://github.com/apiera-as/woo-php-sdk/issues)PHPPHP ^8.3

Since Feb 14Pushed 1y agoCompare

[ Source](https://github.com/apiera-as/woo-php-sdk)[ Packagist](https://packagist.org/packages/apiera/woo-php-sdk)[ RSS](/packages/apiera-woo-php-sdk/feed)WikiDiscussions master Synced 1mo ago

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

WooCommerce PHP SDK
===================

[](#woocommerce-php-sdk)

A lightweight PHP SDK for interacting with the WooCommerce REST API.

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

[](#requirements)

- PHP 8.3 or higher
- A WooCommerce site with REST API enabled
- API consumer key and secret from WooCommerce

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

[](#installation)

Install via Composer:

```
composer require apiera/woo-php-sdk
```

Basic Usage
-----------

[](#basic-usage)

```
use Apiera\WooPhpSdk\Client;
use Apiera\WooPhpSdk\Configuration;
use Apiera\WooPhpSdk\Enum\ApiVersion;

// Create configuration
$config = new Configuration(
    baseUrl: 'https://your-store.com',
    consumerKey: 'your_consumer_key',
    consumerSecret: 'your_consumer_secret',
    apiVersion: ApiVersion::V3,
    userAgent: 'My Application/1.0',
    timeout: 30
);

// Initialize client
$client = new Client($config);

try {
    // Get all products
    $products = $client->get('products');

    // Create a product
    $newProduct = $client->post('products', [
        'name' => 'Test Product',
        'type' => 'simple',
        'regular_price' => '21.99'
    ]);

    // Update a product
    $updatedProduct = $client->put('products/123', [
        'name' => 'Updated Product Name'
    ]);

    // Delete a product
    $result = $client->delete('products/123');

} catch (\Apiera\WooPhpSdk\Exception\Http\HttpException $e) {
    $error = $e->getErrorMessage();
    echo sprintf(
        "Error: [%s] %s",
        $error->getCode(),
        $error->getMessage()
    );
}
```

Error Handling
--------------

[](#error-handling)

The SDK throws specialized exceptions for different HTTP error scenarios:

- `BadRequestException` - 400 errors
- `UnauthorizedException` - 401 errors
- `NotFoundException` - 404 errors
- `InternalServerErrorException` - 500 errors
- `RequestException` - Other HTTP errors

All exceptions extend from `HttpException` which provides helpful methods to access request/response details:

```
try {
    $client->get('products/999');
} catch (\Apiera\WooPhpSdk\Exception\Http\HttpException $e) {
    echo $e->getRequestMethod(); // GET
    echo $e->getRequestUri(); // products/999
    echo $e->getResponseStatusCode(); // 404

    $error = $e->getErrorMessage();
    echo $error->getCode(); // not_found
    echo $error->getMessage(); // Product not found
    print_r($error->getData()); // ['status' => 404]
}
```

Development
-----------

[](#development)

Run tests:

```
composer test
```

Run coding standards check:

```
composer cs:check
```

Run static analysis:

```
composer static:analyse
```

Run all checks:

```
composer check
```

License
-------

[](#license)

MIT License - see the [LICENSE](LICENSE.md) file for details.

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

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance43

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

449d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6a0a89ea1e546fb500ca8fe825198814b818c3091e5051d158b8f8bb11492cf?d=identicon)[fredrik-tveraaen-apiera](/maintainers/fredrik-tveraaen-apiera)

---

Top Contributors

[![fredrik-tveraaen-apiera](https://avatars.githubusercontent.com/u/109967326?v=4)](https://github.com/fredrik-tveraaen-apiera "fredrik-tveraaen-apiera (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/apiera-woo-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/apiera-woo-php-sdk/health.svg)](https://phpackages.com/packages/apiera-woo-php-sdk)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M647](/packages/sylius-sylius)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)

PHPackages © 2026

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