PHPackages                             obstechnologies/laravel5-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. obstechnologies/laravel5-woocommerce-api-client

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

obstechnologies/laravel5-woocommerce-api-client
===============================================

Laravel 5 wrapper for the Woocommerce REST API

v3.0.2(5y ago)036MITPHPPHP ^7.0

Since Jan 20Pushed 5y agoCompare

[ Source](https://github.com/OBSTechnologies/laravel5-woocommerce-api-client)[ Packagist](https://packagist.org/packages/obstechnologies/laravel5-woocommerce-api-client)[ Docs](https://github.com/pixelpeter/laravel5-woocommerce-api-client)[ RSS](/packages/obstechnologies-laravel5-woocommerce-api-client/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (14)Used By (0)

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

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/7d9906df9388de3c6e643c80a5c7972864f1d36fbd26b3bd4b083ac0f6d70590/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706978656c70657465722f6c61726176656c352d776f6f636f6d6d657263652d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pixelpeter/laravel5-woocommerce-api-client)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Travis Build](https://camo.githubusercontent.com/f16e1496e64a3e0ce68f639fdfc12ea11b81d36040e5dff13a6e28c089a485a2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706978656c70657465722f6c61726176656c352d776f6f636f6d6d657263652d6170692d636c69656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/pixelpeter/laravel5-woocommerce-api-client)[![Scrutinizer Quality](https://camo.githubusercontent.com/8eda0f9cf5ceb1f748a00dcf5914eb8ce3610601cd51dec911ebe5830fa2f531/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706978656c70657465722f6c61726176656c352d776f6f636f6d6d657263652d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pixelpeter/laravel5-woocommerce-api-client)[![Scrutinizer Build](https://camo.githubusercontent.com/37143399d2e161ee9c3deadc2ddebe305265602f14a30c9b6d9eba6d2a4c767d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f706978656c70657465722f6c61726176656c352d776f6f636f6d6d657263652d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pixelpeter/laravel5-woocommerce-api-client)[![SensioLabsInsight](https://camo.githubusercontent.com/9a995651c60a54148722a799197df5aace68be47c5065ed11ea7b2c228bd1eba/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f65646662646463362d636362632d343235632d396462382d3732366135626333373165372e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/edfbddc6-ccbc-425c-9db8-726a5bc371e7)[![Total Downloads](https://camo.githubusercontent.com/f48aca117a6ac8895bec490572b59e84a39e43c60c40d3b7e84ba29c1e2ee4f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706978656c70657465722f6c61726176656c352d776f6f636f6d6d657263652d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pixelpeter/laravel5-woocommerce-api-client)[![Coverage Status](https://camo.githubusercontent.com/94435134d409f4c997069aa8e63e307c158d52b9f2f84ea1c6d5c757f13da452/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f706978656c70657465722f6c61726176656c352d776f6f636f6d6d657263652d6170692d636c69656e742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/pixelpeter/laravel5-woocommerce-api-client?branch=master)

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

Version overview
----------------

[](#version-overview)

Laravelwc-api-php usedWordpressWoocommerceWC API versionuse branch5.7+2.x4.4+3.5+v1, v2, v3w.i.p.5.5+1.3.x4.4+3.0 - 3.4.xv1, v2, v3^3.05.4+1.3.x4.4+2.6 - 2.6.14v1, v2^2.05.31.3.x4.1+2.1 - 2.5.5legacy v1, legacy v2, legacy v3^1.0Installation
------------

[](#installation)

### Step 1: Install Through Composer

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

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

```
composer require pixelpeter/laravel5-woocommerce-api-client ^3.0
```

For API Version v1, WooCommerce 2.6+, Wordpress 4.4+, Laravel 5.4+ use the v2.x branch

```
composer require pixelpeter/laravel5-woocommerce-api-client ^2.0
```

For older versions of Woocommerce starting from 2.1+ use the v1.x branch

```
composer require pixelpeter/laravel5-woocommerce-api-client ^1.0
```

### Step 2: Add the Service Provider (not needed with v3.x)

[](#step-2-add-the-service-provider-not-needed-with-v3x)

Add the service provider in `app/config/app.php`

```
'provider' => [
    ...
    Pixelpeter\Woocommerce\WoocommerceServiceProvider::class,
    ...
];
```

### Step 3: Add the Facade (not needed with v3.x)

[](#step-3-add-the-facade-not-needed-with-v3x)

Add the alias in `app/config/app.php`

```
'aliases' => [
    ...
    'Woocommerce' => Pixelpeter\Woocommerce\Facades\Woocommerce::class,
    ...
];
```

### Step 4: Publish configuration

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

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

### Step 5: Customize configuration

[](#step-5-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_CONSUMER_KEY=ck_your-consumer-key
WOOCOMMERCE_CONSUMER_SECRET=cs_your-consumer-secret
WOOCOMMERCE_VERIFY_SSL=false
WOOCOMMERCE_VERSION=v1
WOOCOMMERCE_WP_API=true
WOOCOMMERCE_WP_QUERY_STRING_AUTH=false
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)

#### For legacy API versions

[](#for-legacy-api-versions)

(WC 2.4.x or later, WP 4.1 or later) use this syntax

```
use Woocommerce;

$data = [
    'status' => 'completed',
    'filter' => [
        'created_at_min' => '2016-01-14'
    ]
];

$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
}
```

#### For current API versions

[](#for-current-api-versions)

(WC 2.6.x or later, WP 4.4 or later) use this syntax. `after` needs to be a ISO-8601 compliant date!≠

```
use Woocommerce;

$data = [
    'status' => 'completed',
    'after' => '2016-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)

```
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);

Woocommerce::totalResults(); // 474
Woocommerce::firstPage(); // 1
Woocommerce::lastPage(); // 19
Woocommerce::currentPage(); // 5
Woocommerce::totalPages(); // 19
Woocommerce::previousPage(); // 4
Woocommerce::nextPage(); // 6
Woocommerce::hasPreviousPage(); // true
Woocommerce::hasNextPage(); // true
Woocommerce::hasNotPreviousPage(); // false
Woocommerce::hasNotNextPage(); // false
```

In some cases the web server returns headers only in lower case. This may cause errors when using the pagination functions. If that is your case, call the following method before calling any pagination methods.

```
use Woocommerce;

Woocommerce::useLowerCaseHeaders();
```

### 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.

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 78.8% 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 ~234 days

Recently: every ~375 days

Total

9

Last Release

1892d ago

Major Versions

v1.0.1 → v2.0.02016-07-19

v2.3.0 → v3.0.02017-07-10

PHP version history (2 changes)v1.0PHP &gt;=5.5.9

v3.0.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/871c86b1f89e418834dfde8ae1cba9e8461d9d638b1e8cc68126a900b6702e7f?d=identicon)[gpittas](/maintainers/gpittas)

---

Top Contributors

[![pixelpeter](https://avatars.githubusercontent.com/u/6502630?v=4)](https://github.com/pixelpeter "pixelpeter (41 commits)")[![sattip](https://avatars.githubusercontent.com/u/1500562?v=4)](https://github.com/sattip "sattip (4 commits)")[![stromgren](https://avatars.githubusercontent.com/u/971993?v=4)](https://github.com/stromgren "stromgren (2 commits)")[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (1 commits)")[![leeroyrose](https://avatars.githubusercontent.com/u/3706842?v=4)](https://github.com/leeroyrose "leeroyrose (1 commits)")[![jb000](https://avatars.githubusercontent.com/u/17474154?v=4)](https://github.com/jb000 "jb000 (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![ebisbe](https://avatars.githubusercontent.com/u/6747962?v=4)](https://github.com/ebisbe "ebisbe (1 commits)")

---

Tags

apilaravelwordpressrestshopecommercecarte-commercewoocommerce

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/obstechnologies-laravel5-woocommerce-api-client/health.svg)](https://phpackages.com/packages/obstechnologies-laravel5-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)
