PHPackages                             roncodes/woocommerce-rest-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. roncodes/woocommerce-rest-api-client

ActiveLibrary[API Development](/categories/api)

roncodes/woocommerce-rest-api-client
====================================

A client library for the WooCommerce REST API

2.0.1(10y ago)08GPL v3PHPPHP &gt;= 5.2.0

Since Jul 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/roncodes/woocommerce-rest-api-client)[ Packagist](https://packagist.org/packages/roncodes/woocommerce-rest-api-client)[ RSS](/packages/roncodes-woocommerce-rest-api-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (3)Used By (0)

WooCommerce REST API PHP Client Library
=======================================

[](#woocommerce-rest-api-php-client-library)

About
-----

[](#about)

A PHP wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library.

Feedback and bug reports are appreciated.

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

[](#requirements)

PHP 5.2.x cURL WooCommerce 2.2 at least on the store

Getting started
---------------

[](#getting-started)

Generate API credentials (Consumer Key &amp; Consumer Secret) under WP Admin &gt; Your Profile.

Setup the library
-----------------

[](#setup-the-library)

```
require_once( 'lib/woocommerce-api.php' );

$options = array(
	'ssl_verify'      => false,
);

try {

	$client = new WC_API_Client( 'http://your-store-url.com', $consumer_key, $consumer_secret, $options );

} catch ( WC_API_Client_Exception $e ) {

	echo $e->getMessage() . PHP_EOL;
	echo $e->getCode() . PHP_EOL;

	if ( $e instanceof WC_API_Client_HTTP_Exception ) {

		print_r( $e->get_request() );
		print_r( $e->get_response() );
	}
}
```

### Options

[](#options)

- `debug` (default `false`) - set to `true` to add request/response information to the returned data. This is particularly useful for troubleshooting errors.
- `return_as_array` (default `false`) - all methods return data as a `stdClass` by default, but you can set this option to `true` to return data as an associative array instead.
- `validate_url` (default `false`) - set this to `true` to verify that the URL provided has a valid, parseable WC API index, and optionally force SSL when supported.
- `timeout` (default `30`) - set this to control the HTTP timeout for requests.
- `ssl_verify` (default `true`) - set this to `false` if you don't want to perform SSL peer verification for every request.

### Error handling

[](#error-handling)

Exceptions are thrown when errors are encountered, most will be instances of `WC_API_Client_HTTP_Exception` which has two additional methods, `get_request()` and `get_response()` -- these return the request and response objects to help with debugging.

Methods
-------

[](#methods)

### Index

[](#index)

- `$client->index->get()` - get the API index

### Orders

[](#orders)

- `$client->orders->get()` - get a list of orders
- `$client->orders->get( null, array( 'status' => 'completed' ) )` - get a list of completed orders
- `$client->orders->get( $order_id )` - get a single order

Credit
------

[](#credit)

Copyright (c) 2013-2014 - [Gerhard Potgieter](http://gerhardpotgieter.com/), [Max Rice](http://maxrice.com) and other contributors

License
-------

[](#license)

Released under the [GPL3 license](http://www.gnu.org/licenses/gpl-3.0.html)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.7% 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

4004d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1021833?v=4)[Ronald R](/maintainers/ronaldr)[@RonaldR](https://github.com/RonaldR)

---

Top Contributors

[![maxrice](https://avatars.githubusercontent.com/u/1579862?v=4)](https://github.com/maxrice "maxrice (37 commits)")[![kloon](https://avatars.githubusercontent.com/u/271630?v=4)](https://github.com/kloon "kloon (10 commits)")[![judgej](https://avatars.githubusercontent.com/u/395934?v=4)](https://github.com/judgej "judgej (7 commits)")[![tillz](https://avatars.githubusercontent.com/u/1763875?v=4)](https://github.com/tillz "tillz (3 commits)")[![claudiosanches](https://avatars.githubusercontent.com/u/1264099?v=4)](https://github.com/claudiosanches "claudiosanches (2 commits)")[![GaryPEGEOT-WIC](https://avatars.githubusercontent.com/u/9263975?v=4)](https://github.com/GaryPEGEOT-WIC "GaryPEGEOT-WIC (2 commits)")[![roncodes](https://avatars.githubusercontent.com/u/816371?v=4)](https://github.com/roncodes "roncodes (2 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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