2017 © Pedro Peláez
 

library woocommerce-api

A client library for the WooCommerce REST API

image

wic/woocommerce-api

A client library for the WooCommerce REST API

  • Tuesday, May 24, 2016
  • by GaryPEGEOT-WIC
  • Repository
  • 2 Watchers
  • 0 Stars
  • 571 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 166 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

WooCommerce REST API PHP Client Library

About

A PHP wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library., (*1)

Feedback and bug reports are appreciated, and fixed ASAP., (*2)

Installation

Via Composer

``` bash $ composer require wic/woocommerce-api, (*3)


## Requirements PHP 5.4.x cURL WooCommerce 2.2 at least on the store ## Getting started Generate API credentials (Consumer Key & Consumer Secret) under WP Admin > Your Profile. ## Setup the library ```php use WIC/Client; $options = array( 'ssl_verify' => false, ); try { $client = new Client( 'http://your-store-url.com', $consumer_key, $consumer_secret, $options ); } catch ( ClientException $e ) { echo $e->getMessage() . PHP_EOL; echo $e->getCode() . PHP_EOL; if ( $e instanceof ClientHTTPException ) { print_r( $e->get_request() ); print_r( $e->get_response() ); } }

Options

  • debug (default false) - set to true to add request/response information to the returned data. This is particularly useful for troubleshooting errors., (*4)

  • 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., (*5)

  • 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., (*6)

  • timeout (default 30) - set this to control the HTTP timeout for requests., (*7)

  • ssl_verify (default true) - set this to false if you don't want to perform SSL peer verification for every request., (*8)

Error handling

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

Methods

Index

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

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

Copyright (c) 2013-2015 - Web In Color, Gerhard Potgieter, Max Rice and other contributors, (*10)

License

Released under the GPL3 license, (*11)

The Versions

24/05 2016

dev-master

9999999-dev

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

The Requires

  • ext-curl *
  • php >= 5.4.0
  • ext-json *

 

by Web In Color

23/10 2015

v0.3.1

0.3.1.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

The Requires

  • php >= 5.4.0
  • ext-curl *
  • ext-json *

 

by Web In Color

23/10 2015

v0.3.0

0.3.0.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

The Requires

  • php >= 5.4.0
  • ext-curl *
  • ext-json *

 

by Web In Color

04/06 2015

v0.2.2

0.2.2.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

The Requires

  • php >= 5.3.0
  • ext-curl *

 

by Web In Color

02/06 2015

dev-patch-1

dev-patch-1

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

02/06 2015

v0.2.1

0.2.1.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

The Requires

  • php >= 5.3.0
  • ext-curl *

 

by Web In Color

01/06 2015

v0.2.0

0.2.0.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

The Requires

  • php >= 5.3.0
  • ext-curl *

 

by Web In Color

30/05 2015

v0.1.2

0.1.2.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

29/05 2015

v0.1.1

0.1.1.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3

18/05 2015

v0.1.0

0.1.0.0

A client library for the WooCommerce REST API

  Sources   Download

GPL v3