PHPackages                             ijagjeet/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. ijagjeet/laravel-woocommerce-api-client

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

ijagjeet/laravel-woocommerce-api-client
=======================================

Laravel wrapper for the Woocommerce REST API

v4.0.0(3y ago)013↓100%[4 PRs](https://github.com/ijagjeet/laravel-woocommerce-api-client/pulls)MITPHPPHP ^7.0|^8.0CI passing

Since Jan 20Pushed 2mo ago1 watchersCompare

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

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

Laravel WooCommerce Rest API Client
===================================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/cd0556a5a6824efcc9178c0e1bffdc49db1e8e68064373e08d9c9ca143f842d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696a61676a6565742f6c61726176656c2d776f6f636f6d6d657263652d6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ijagjeet/laravel-woocommerce-api-client)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Coverage Status](https://camo.githubusercontent.com/7233e7af8401f33e59c0a0e38e3c92a298114033907e6dd7300c32008c6a2b0a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f696a61676a6565742f6c61726176656c2d776f6f636f6d6d657263652d6170692d636c69656e742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ijagjeet/laravel-woocommerce-api-client?branch=master)

A simple Laravel 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 branch9.0+2.x5.5+3.5+v1, v2, v3^4.05.7+2.x4.4+3.5+v1, v2, v3^4.05.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 5.5+, php 7.0+, Laravel 9.0+ use the v3.x branch

```
composer require ijagjeet/laravel-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 ijagjeet/laravel-woocommerce-api-client ^2.0
```

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

```
composer require ijagjeet/laravel-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' => [
    ...
    IJagjeet\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' => IJagjeet\Woocommerce\Facades\Woocommerce::class,
    ...
];
```

### Step 4: Publish configuration

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

```
php artisan vendor:publish --provider="IJagjeet\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=https://example-store.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
```

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

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Peter Haak](https://github.com/pixelpeter)
- [palPalani](https://github.com/palpalani)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 53.9% 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 ~433 days

Recently: every ~605 days

Total

7

Last Release

1113d ago

Major Versions

v1.0.1 → v2.0.02016-07-19

v2.3.0 → v4.0.02023-03-07

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

v4.0.0PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/55f0c124b30a4717bf761794ac43dc75d401037c7109ba76bc85f7f0caed5e9c?d=identicon)[ijagjeet](/maintainers/ijagjeet)

---

Top Contributors

[![pixelpeter](https://avatars.githubusercontent.com/u/6502630?v=4)](https://github.com/pixelpeter "pixelpeter (41 commits)")[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![leeroyrose](https://avatars.githubusercontent.com/u/3706842?v=4)](https://github.com/leeroyrose "leeroyrose (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)")[![ijagjeet](https://avatars.githubusercontent.com/u/46004289?v=4)](https://github.com/ijagjeet "ijagjeet (1 commits)")[![jb000](https://avatars.githubusercontent.com/u/17474154?v=4)](https://github.com/jb000 "jb000 (1 commits)")

---

Tags

apilaravelwordpressrestshopecommercecarte-commercewoocommerceijagjeet

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[pixelpeter/laravel5-woocommerce-api-client

Laravel 5 wrapper for the Woocommerce REST API

125102.8k](/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.6k212.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.

2052.9k4](/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)
