PHPackages                             hexboy/laravel-woocommerce-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. [HTTP &amp; Networking](/categories/http)
4. /
5. hexboy/laravel-woocommerce-api-client

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

hexboy/laravel-woocommerce-api-client
=====================================

Laravel 5 wrapper for the Woocommerce REST API

v2.0.1(7y ago)41173MITPHPPHP ^7.0

Since Apr 22Pushed 7y ago2 watchersCompare

[ Source](https://github.com/hexboy/laravel-woocommerce-api-client)[ Packagist](https://packagist.org/packages/hexboy/laravel-woocommerce-api-client)[ Docs](https://github.com/hexboy/laravel-woocommerce-api-client)[ RSS](/packages/hexboy-laravel-woocommerce-api-client/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Laravel 5 WooCommerce API Client
================================

[](#laravel-5-woocommerce-api-client)

A simple Laravel 5 wrapper for the [official WooCommerce REST API PHP Library](https://github.com/woothemes/wc-api-php) from Automattic.

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

[](#installation)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

For API Version v3, WooCommerce 3.0+, Wordpress 4.4+, php 7.0+, Laravel 5.5+ use the v3.x branch

```
composer require hexboy/laravel-woocommerce-api-client ^2.0
```

### Step 2: Publish configuration

[](#step-2-publish-configuration)

```
php artisan vendor:publish --provider="Hexboy\Woocommerce\WoocommerceServiceProvider"
```

### Step 3: Customize configuration

[](#step-3-customize-configuration)

You can directly edit the configuration in `config/woocommerce.php` or copy these values to your `.env` file.

```
WOOCOMMERCE_STORE_URL=http://example.org
WOOCOMMERCE_VERIFY_SSL=false
WOOCOMMERCE_VERSION=v3
WOOCOMMERCE_WP_API=true
WOOCOMMERCE_AUTH_TYPE=JWT
WOOCOMMERCE_WP_TIMEOUT=15
```

Examples
--------

[](#examples)

### Get the index of all available endpoints

[](#get-the-index-of-all-available-endpoints)

```
use Woocommerce;

return Woocommerce::get('');
```

### View all orders

[](#view-all-orders)

```
use Woocommerce;

return Woocommerce::get('orders');
```

### View all completed orders created after a specific date

[](#view-all-completed-orders-created-after-a-specific-date)

`after` needs to be a ISO-8601 compliant date!≠

```
use Woocommerce;

$data = [
    'status' => 'completed',
    'after' => '2019-01-14T00:00:00'
    ]
];

$result = Woocommerce::get('orders', $data);

foreach($result['orders'] as $order)
{
    // do something with $order
}

// you can also use array access
$orders = Woocommerce::get('orders', $data)['orders'];

foreach($orders as $order)
{
    // do something with $order
}
```

### Update a product

[](#update-a-product)

```
use Woocommerce;

$data = [
    'product' => [
        'title' => 'Updated title'
    ]
];

return Woocommerce::put('products/1', $data);
```

### Pagination

[](#pagination)

So you don't have to mess around with the request and response header and the calculations this wrapper will do all the heavy lifting for you. (WC 2.6.x or later, WP 4.4 or later)

Laravel LengthAwarePaginator
----------------------------

[](#laravel-lengthawarepaginator)

```
use Woocommerce;

$params = [
    'per_page' => 25,
    'page' => 5
];

// or

$params = [];

$products = Woocommerce::get('products', $params, true);
$products->withPath('custom/url');
return $products;
```

raw pagination data
-------------------

[](#raw-pagination-data)

```
use Woocommerce;

// assuming we have 474 orders in pur result
// we will request page 5 with 25 results per page
$params = [
    'per_page' => 25,
    'page' => 5
];

Woocommerce::get('orders', $params);
```

### HTTP Request &amp; Response (Headers)

[](#http-request--response-headers)

```
use Woocommerce;

// first send a request
Woocommerce::get('orders');

// get the request
Woocommerce::getRequest();

// get the response headers
Woocommerce::getResponse();

// get the total number of results
Woocommerce::getResponse()->getHeaders()['X-WP-Total']
```

### More Examples

[](#more-examples)

Refer to [WooCommerce REST API Documentation](https://woocommerce.github.io/woocommerce-rest-api-docs) for more examples and documention.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

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 ~2 days

Total

4

Last Release

2568d ago

Major Versions

v1.1.0 → v2.0.02019-04-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/244382938853e9f63e98ba9c842c83d65764a7f8b7b773ce9ffaa0c92a66cab0?d=identicon)[hexboy](/maintainers/hexboy)

---

Top Contributors

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

---

Tags

api-clienteccomercelaravelresetwoocommercewordpressapilaravelwordpressrestshopecommercecarte-commercewoocommerce

### Embed Badge

![Health badge](/badges/hexboy-laravel-woocommerce-api-client/health.svg)

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

###  Alternatives

[pixelpeter/laravel5-woocommerce-api-client

Laravel 5 wrapper for the Woocommerce REST API

125103.4k](/packages/pixelpeter-laravel5-woocommerce-api-client)[aimeos/aimeos-laravel

Cloud native, API first Laravel eCommerce package with integrated AI for ultra-fast online shops, marketplaces and complex B2B projects

8.6k214.7k3](/packages/aimeos-aimeos-laravel)[amsgames/laravel-shop

Package set to provide shop or e-commerce functionality (such as CART, ORDERS, TRANSACTIONS and ITEMS) to Laravel for customizable builds.

4845.9k](/packages/amsgames-laravel-shop)[lunarphp/stripe

Stripe payment driver for Lunar.

2055.8k4](/packages/lunarphp-stripe)[threesquared/laravel-wp-api

Laravel package for the Wordpress JSON REST API

1310.3k](/packages/threesquared-laravel-wp-api)[getcandy/core

GetCandy Laravel e-commerce core functionality.

156.6k3](/packages/getcandy-core)

PHPackages © 2026

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