PHPackages                             woothemes/woocommerce-api - 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. woothemes/woocommerce-api

Abandoned → [automattic/woocommerce](/?search=automattic%2Fwoocommerce)Library[API Development](/categories/api)

woothemes/woocommerce-api
=========================

A client library for the WooCommerce REST API

2.0.1(10y ago)35463.8k169[105 issues](https://github.com/kloon/WooCommerce-REST-API-Client-Library/issues)[5 PRs](https://github.com/kloon/WooCommerce-REST-API-Client-Library/pulls)1GPL v3PHPPHP &gt;= 5.2.0

Since Jul 13Pushed 9y ago35 watchersCompare

[ Source](https://github.com/kloon/WooCommerce-REST-API-Client-Library)[ Packagist](https://packagist.org/packages/woothemes/woocommerce-api)[ RSS](/packages/woothemes-woocommerce-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

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

40

—

FairBetter than 88% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60.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

3962d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac91c7d73bb4501567ab3790755bf001d53dac8d1f4311a2480a5fb62dfb180c?d=identicon)[claudiosanches](/maintainers/claudiosanches)

![](https://www.gravatar.com/avatar/ca7f6e45ef80172e9c973d5cf396aac154a5346c6f060f07489e980486f61786?d=identicon)[maxrice](/maintainers/maxrice)

---

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)")

### Embed Badge

![Health badge](/badges/woothemes-woocommerce-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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