A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
Go to file
vedanshujain 02aa89614e Applied coding standards 2020-05-11 17:21:56 +05:30
src Applied coding standards 2020-05-11 17:21:56 +05:30
unit-tests Fix unit test 2020-05-11 17:21:56 +05:30
.editorconfig Test version - api copied from core with loader 2019-05-10 17:56:07 +01:00
.gitattributes Update test paths 2019-06-25 16:12:47 +01:00
.gitignore Fix paths 2019-06-25 16:20:26 +01:00
.scrutinizer.yml Rename tests dir 2019-06-24 16:17:02 +01:00
.travis.yml Fixed unit tests and updated sniffs 2019-12-05 22:42:43 -03:00
README.md Version 1.0.6 2020-01-15 20:29:39 -03:00
composer.json Added missing composer scripts 2020-01-28 18:04:51 -03:00
composer.lock Fixed unit tests and updated sniffs 2019-12-05 22:42:43 -03:00
package-lock.json Added pre-commit hook 2020-01-24 17:17:28 -03:00
package.json Added pre-commit hook 2020-01-24 17:17:28 -03:00
phpcs.xml Fix some strings which should not be replaced 2019-06-24 15:47:00 +01:00
phpunit.xml remove v4 for 1.0 release 2019-06-25 16:18:35 +01:00
woocommerce-rest-api.php Version 1.0.7 2020-01-28 18:03:37 -03:00

README.md

WooCommerce REST API

license Latest Stable Version Build Status Scrutinizer Code Quality

This repository is home to the WooCommerce REST API package.

The stable version of this package is bundled with WooCommerce core releases, but it can also be used as a standalone plugin so bleeding-edge API features can be tested or used by other feature plugins.

Using this package as a plugin

After checking out the code to your wp-content/plugins directory, you'll need to run composer install in the plugin directory (wp-content/plugins/woocommerce-rest-api) to install dependencies and to enable the autoloader. Without performing this step, if you activate the plugin it will simply show an admin notice.

API documentation

Versions

Namespace Status Docs
wc/v4 Development Link
wc/v3 Stable Link
wc/v2 Deprecated - October 2020 Link
wc/v1 Deprecated - April 2019 Link

Note: API Versions are kept around for 2 years after being replaced, and may be removed in the next major version after that date passes.

Using this package in other projects

This package is hosted on Packagist and can be included using composer.json:

"require": {
    "woocommerce/woocommerce-rest-api": "1.0"
},

Since multiple versions of this package may be included at the same time, it includes a special package-version autoloader. This dependency is also on Packagist:

  "automattic/jetpack-autoloader": "^1"

And using this autoloader requires the following include in your codebase:

$autoloader = __DIR__ . '/vendor/autoload_packages.php';

If you choose to use your own autoloader, please note you won't be able to determine which version of the package is running since it could use the version in WooCommerce core or your version. The namespaces would conflict. All of our feature plugins and packages use the package autoloader.

Contributing

Please read the WooCommerce contributor guidelines for more information how you can contribute to WooCommerce, and the REST API contribution documentation here.

Within this package, namespaces and endpoint classes are located within the src/RestAPI/ directory. If you need to change the behavior of an endpoint, you can do so in these classes.

Run tests using phpunit in the root of the package. All pull-requests must pass unit tests in order to be accepted.

Translation

For strings located in API endpoints, use woocommerce as your text-domain. These endpoints will be translated in the WooCommerce Core PO/MO files.