diff --git a/fonts/slate-7b7da4fe.ttf b/fonts/slate-7b7da4fe.ttf new file mode 100644 index 00000000..ace9a46a Binary files /dev/null and b/fonts/slate-7b7da4fe.ttf differ diff --git a/fonts/slate-cfc9d06b.eot b/fonts/slate-cfc9d06b.eot new file mode 100644 index 00000000..13c4839a Binary files /dev/null and b/fonts/slate-cfc9d06b.eot differ diff --git a/fonts/slate-e55b8307.svg b/fonts/slate-e55b8307.svg new file mode 100644 index 00000000..5f349823 --- /dev/null +++ b/fonts/slate-e55b8307.svg @@ -0,0 +1,14 @@ + + + +Generated by IcoMoon + + + + + + + + + + diff --git a/fonts/slate.woff b/fonts/slate.woff new file mode 100644 index 00000000..1e72e0ee Binary files /dev/null and b/fonts/slate.woff differ diff --git a/fonts/slate.woff2 b/fonts/slate.woff2 new file mode 100644 index 00000000..7c585a72 Binary files /dev/null and b/fonts/slate.woff2 differ diff --git a/images/favicon-180x180-e5124fb6.png b/images/favicon-180x180-e5124fb6.png new file mode 100644 index 00000000..d47e5cbc Binary files /dev/null and b/images/favicon-180x180-e5124fb6.png differ diff --git a/images/favicon-192x192-7c01c093.png b/images/favicon-192x192-7c01c093.png new file mode 100644 index 00000000..a08f39ab Binary files /dev/null and b/images/favicon-192x192-7c01c093.png differ diff --git a/images/favicon-270x270-73493183.png b/images/favicon-270x270-73493183.png new file mode 100644 index 00000000..f481c58e Binary files /dev/null and b/images/favicon-270x270-73493183.png differ diff --git a/images/favicon-32x32-6b5978bc.png b/images/favicon-32x32-6b5978bc.png new file mode 100644 index 00000000..b13c74b3 Binary files /dev/null and b/images/favicon-32x32-6b5978bc.png differ diff --git a/images/logo-95f5c1ab.png b/images/logo-95f5c1ab.png new file mode 100644 index 00000000..cd22ed0e Binary files /dev/null and b/images/logo-95f5c1ab.png differ diff --git a/images/navbar-cad8cdcb.png b/images/navbar-cad8cdcb.png new file mode 100644 index 00000000..df38e90d Binary files /dev/null and b/images/navbar-cad8cdcb.png differ diff --git a/images/woocommerce-api-key-generated-9004dc03.png b/images/woocommerce-api-key-generated-9004dc03.png new file mode 100644 index 00000000..e42f0af5 Binary files /dev/null and b/images/woocommerce-api-key-generated-9004dc03.png differ diff --git a/images/woocommerce-api-keys-settings-02dfb1f9.png b/images/woocommerce-api-keys-settings-02dfb1f9.png new file mode 100644 index 00000000..d87716dd Binary files /dev/null and b/images/woocommerce-api-keys-settings-02dfb1f9.png differ diff --git a/images/woocommerce-auth-endpoint-example-16e084bf.png b/images/woocommerce-auth-endpoint-example-16e084bf.png new file mode 100644 index 00000000..8a103ede Binary files /dev/null and b/images/woocommerce-auth-endpoint-example-16e084bf.png differ diff --git a/images/woocommerce-auth-endpoint-flow-f04049df.png b/images/woocommerce-auth-endpoint-flow-f04049df.png new file mode 100644 index 00000000..82907e81 Binary files /dev/null and b/images/woocommerce-auth-endpoint-flow-f04049df.png differ diff --git a/images/woocommerce-creating-api-keys-0f78883a.png b/images/woocommerce-creating-api-keys-0f78883a.png new file mode 100644 index 00000000..659e3a6e Binary files /dev/null and b/images/woocommerce-creating-api-keys-0f78883a.png differ diff --git a/index.html b/index.html new file mode 100644 index 00000000..2cb494ff --- /dev/null +++ b/index.html @@ -0,0 +1,41259 @@ + + + + + + + + WooCommerce REST API Documentation - WP REST API v3 + + + + + + + + + + + + + + + + + + + NAV + + + +
+ +
+ cURL + Node.js + PHP + Python + Ruby +
+ + +
+
+
+
+

Introduction

+

WooCommerce (WC) 2.6+ is fully integrated with the WordPress REST API. This allows WC data to be created, read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients.

+ +

The current WP REST API integration version is v3 which takes a first-order position in endpoints.

+ +

The following table shows API versions present in each major version of WooCommerce:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
API VersionWC VersionWP VersionDocumentation
v33.5.x or later4.4 or later-
v23.0.x or later4.4 or laterv2 docs
v12.6.x or later4.4 or laterv1 docs
+ +

Prior to 2.6, WooCommerce had a REST API separate from WordPress which is now known as the legacy API. You can find the documentation for the legacy API separately.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
API VersionWC VersionWP VersionDocumentation
Legacy v32.4.x or later4.1 or laterLegacy v3 docs
Legacy v22.2.x or later4.1 or laterLegacy v2 docs
Legacy v12.1.x or later4.1 or laterLegacy v1 docs
+

Requirements

+

To use the latest version of the REST API you must be using:

+ + + +

If you use ModSecurity and see 501 Method Not Implemented errors, see this issue for details.

+ + +

Request/Response Format

+

The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

+ +

Some general information about responses:

+ + +

JSONP Support

+

The WP REST API supports JSONP by default. JSONP responses use the application/javascript content-type. You can specify the callback using the ?_jsonp parameter for GET requests to have the response wrapped in a JSON function:

+ +
+
+ GET +
/wp-json/wc/v3?_jsonp=callback
+
+
+
curl https://example.com/wp-json/wc/v3/products/tags/34?_jsonp=tagDetails \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags/34?_jsonp=tagDetails")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags/34', ['_jsonp' => 'tagDetails'])); ?>
+
print(wcapi.get("products/tags/34?_jsonp=tagDetails").json())
+
woocommerce.get("products/tags/34", _jsonp: "tagDetails").parsed_response
+
+
+

Response:

+
+
/**/tagDetails({"id":34,"name":"Leather Shoes","slug":"leather-shoes","description":"","count":0,"_links":{"self":[{"href":"https://example.com/wp-json/wc/v3/products/tags/34"}],"collection":[{"href":"https://example.com/wp-json/wc/v3/products/tags"}]}})%
+

Errors

+

Occasionally you might encounter errors when accessing the REST API. There are four possible types:

+ + + + + + + + + + + + + + + + + + + + + + + +
Error CodeError Type
400 Bad RequestInvalid request, e.g. using an unsupported HTTP method
401 UnauthorizedAuthentication or permission error, e.g. incorrect API keys
404 Not FoundRequests to resources that don't exist or are missing
500 Internal Server ErrorServer error
+ +
+

WP REST API error example:

+
+
{
+  "code": "rest_no_route",
+  "message": "No route was found matching the URL and request method",
+  "data": {
+    "status": 404
+  }
+}
+
+
+

WooCommerce REST API error example:

+
+
{
+  "code": "woocommerce_rest_term_invalid",
+  "message": "Resource doesn't exist.",
+  "data": {
+    "status": 404
+  }
+}
+
+

Errors return both an appropriate HTTP status code and response object which contains a code, message and data attribute.

+

Parameters

+

Almost all endpoints accept optional parameters which can be passed as a HTTP query string parameter, e.g. GET /orders?status=completed. All parameters are documented along each endpoint.

+

Pagination

+

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specified with the ?per_page parameter:

+ +

GET /orders?per_page=15

+ +

You can specify further pages with the ?page parameter:

+ +

GET /orders?page=2

+ +

You may also specify the offset from the first resource using the ?offset parameter:

+ +

GET /orders?offset=5

+ +

Page number is 1-based and omitting the ?page parameter will return the first page.

+ +

The total number of resources and pages are always included in the X-WP-Total and X-WP-TotalPages HTTP headers.

+ +

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

+
Link: <https://www.example.com/wp-json/wc/v3/products?page=2>; rel="next",
+<https://www.example.com/wp-json/wc/v3/products?page=3>; rel="last"`
+
+

The possible rel values are:

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
nextShows the URL of the immediate next page of results.
lastShows the URL of the last page of results.
firstShows the URL of the first page of results.
prevShows the URL of the immediate previous page of results.
+

Libraries and Tools

Official libraries

+ +
// Install:
+// npm install --save @woocommerce/woocommerce-rest-api
+
+// Setup:
+const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'http://example.com', // Your store URL
+  consumerKey: 'consumer_key', // Your consumer key
+  consumerSecret: 'consumer_secret', // Your consumer secret
+  version: 'wc/v3' // WooCommerce WP REST API version
+});
+
<?php
+// Install:
+// composer require automattic/woocommerce
+
+// Setup:
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'http://example.com', // Your store URL
+    'consumer_key', // Your consumer key
+    'consumer_secret', // Your consumer secret
+    [
+        'wp_api' => true, // Enable the WP REST API integration
+        'version' => 'wc/v3' // WooCommerce WP REST API version
+    ]
+);
+?>
+
# Install:
+# pip install woocommerce
+
+# Setup:
+from woocommerce import API
+
+wcapi = API(
+    url="http://example.com", # Your store URL
+    consumer_key="consumer_key", # Your consumer key
+    consumer_secret="consumer_secret", # Your consumer secret
+    wp_api=True, # Enable the WP REST API integration
+    version="wc/v3" # WooCommerce WP REST API version
+)
+
# Install:
+# gem install woocommerce_api
+
+# Setup:
+require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com", # Your store URL
+  "consumer_key", # Your consumer key
+  "consumer_secret", # Your consumer secret
+  {
+    wp_api: true, # Enable the WP REST API integration
+    version: "wc/v3" # WooCommerce WP REST API version
+  }
+)
+
+ +

Third party libraries

+ + + +

Tools

+

Some useful tools you can use to access the API include:

+ + +

Learn more

+

Learn more about the REST API checking the official WordPress REST API documentation.

+

Authentication

+

WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any WP REST API authentication plugin or method.

+

REST API keys

+

Pre-generated keys can be used to authenticate use of the REST API endpoints. New keys can be generated either through the WordPress admin interface or they can be auto-generated through an endpoint.

+

Generating API keys in the WordPress admin interface

+

To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > Advanced > REST API.

+ +

Note: Keys/Apps was found at WooCommerce > Settings > API > Key/Apps prior to WooCommerce 3.4.

+ +

WooCommerce REST API keys settings

+ +

Click the "Add Key" button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user's WordPress roles and capabilities.

+ +

Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the "Generate API Key" button and WooCommerce will generate REST API keys for the selected user.

+ +

Creating a new REST API key

+ +

Now that keys have been generated, you should see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.

+ +

Generated REST API key

+ +

If the WordPress user associated with an API key is deleted, the API key will cease to function. API keys are not transferred to other users.

+

Auto generating API keys using our Application Authentication Endpoint

+

This endpoint can be used by any APP to allow users to generate API keys for your APP. This makes integration with WooCommerce API easier because the user only needs to grant access to your APP via a URL. After being redirected back to your APP, the API keys will be sent back in a separate POST request.

+ +

The following image illustrates how this works:

+ +

Authentication Endpoint flow

+ + +

URL parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
app_namestringYour APP name mandatory
scopestringLevel of access. Available: read, write and read_write mandatory
user_idstringUser ID in your APP. For your internal reference, used when the user is redirected back to your APP. NOT THE USER ID IN WOOCOMMERCE mandatory
return_urlstringURL the user will be redirected to after authentication mandatory
callback_urlstringURL that will receive the generated API key. Note: this URL should be over HTTPS mandatory
+

Creating an authentication endpoint URL

+

You must use the /wc-auth/v1/authorize endpoint and pass the above parameters as a query string.

+ +
+

Example of how to build an authentication URL:

+
+
# Bash example
+STORE_URL='http://example.com'
+ENDPOINT='/wc-auth/v1/authorize'
+PARAMS="app_name=My App Name&scope=read_write&user_id=123&return_url=http://app.com/return-page&callback_url=https://app.com/callback-endpoint"
+QUERY_STRING="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$PARAMS")"
+QUERY_STRING=$(echo $QUERY_STRING | sed -e "s/%20/\+/g" -e "s/%3D/\=/g" -e "s/%26/\&/g")
+
+echo "$STORE_URL$ENDPOINT?$QUERY_STRING"
+
const querystring = require('querystring');
+
+const store_url = 'http://example.com';
+const endpoint = '/wc-auth/v1/authorize';
+const params = {
+  app_name: 'My App Name',
+  scope: 'read_write',
+  user_id: 123,
+  return_url: 'http://app.com/return-page',
+  callback_url: 'https://app.com/callback-endpoint'
+};
+const query_string = querystring.stringify(params).replace(/%20/g, '+');
+
+console.log(store_url + endpoint + '?' + query_string);
+
<?php
+$store_url = 'http://example.com';
+$endpoint = '/wc-auth/v1/authorize';
+$params = [
+    'app_name' => 'My App Name',
+    'scope' => 'write',
+    'user_id' => 123,
+    'return_url' => 'http://app.com',
+    'callback_url' => 'https://app.com'
+];
+$query_string = http_build_query( $params );
+
+echo $store_url . $endpoint . '?' . $query_string;
+?>
+
from urllib.parse import urlencode
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+    "app_name": "My App Name",
+    "scope": "read_write",
+    "user_id": 123,
+    "return_url": "http://app.com/return-page",
+    "callback_url": "https://app.com/callback-endpoint"
+}
+query_string = urlencode(params)
+
+print("%s%s?%s" % (store_url, endpoint, query_string))
+
require "uri"
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+  app_name: "My App Name",
+  scope: "read_write",
+  user_id: 123,
+  return_url: "http://app.com/return-page",
+  callback_url: "https://app.com/callback-endpoint"
+}
+query_string = URI.encode_www_form(params)
+
+puts "#{store_url}#{endpoint}?#{query_string}"
+
+
+

Example of JSON posted with the API Keys

+
+
{
+    "key_id": 1,
+    "user_id": 123,
+    "consumer_key": "ck_xxxxxxxxxxxxxxxx",
+    "consumer_secret": "cs_xxxxxxxxxxxxxxxx",
+    "key_permissions": "read_write"
+}
+
+

Example of the screen that the user will see:

+ +

Authentication Endpoint example

+

Notes

+ +

Authentication over HTTPS

+

You may use HTTP Basic Auth by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.

+ +
+

HTTP Basic Auth example

+
+
curl https://www.example.com/wp-json/wc/v3/orders \
+    -u consumer_key:consumer_secret
+
const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'https://example.com',
+  consumerKey: 'consumer_key',
+  consumerSecret: 'consumer_secret',
+  version: 'wc/v3'
+});
+
<?php
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'https://example.com',
+    'consumer_key',
+    'consumer_secret',
+    [
+        'wp_api' => true,
+        'version' => 'wc/v3'
+    ]
+);
+?>
+
from woocommerce import API
+
+wcapi = API(
+    url="https://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    wp_api=True,
+    version="wc/v3"
+)
+
require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    wp_json: true,
+    version: "wc/v3"
+  }
+)
+
+

Occasionally some servers may not parse the Authorization header correctly (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters instead.

+ +
+

Example for servers that not properly parse the Authorization header:

+
+
curl https://www.example.com/wp-json/wc/v3/orders?consumer_key=123&consumer_secret=abc
+
const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'https://example.com',
+  consumerKey: 'consumer_key',
+  consumerSecret: 'consumer_secret',
+  version: 'wc/v3',
+  queryStringAuth: true // Force Basic Authentication as query string true and using under HTTPS
+});
+
<?php
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'https://example.com',
+    'consumer_key',
+    'consumer_secret',
+    [
+        'wp_api' => true,
+        'version' => 'wc/v3',
+        'query_string_auth' => true // Force Basic Authentication as query string true and using under HTTPS
+    ]
+);
+?>
+
from woocommerce import API
+
+wcapi = API(
+    url="https://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    wp_api=True,
+    version="wc/v3",
+    query_string_auth=True // Force Basic Authentication as query string true and using under HTTPS
+)
+
require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    wp_json: true,
+    version: "wc/v3",
+    query_string_auth: true // Force Basic Authentication as query string true and using under HTTPS
+  }
+)
+

Authentication over HTTP

+

You must use OAuth 1.0a "one-legged" authentication to ensure REST API credentials cannot be intercepted by an attacker. Typically you will use any standard OAuth 1.0a library in the language of your choice to handle the authentication, or generate the necessary parameters by following the following instructions.

+

Creating a signature

Collect the request method and URL

+

First you need to determine the HTTP method you will be using for the request, and the URL of the request.

+ +

The HTTP method will be GET in our case.

+ +

The Request URL will be the endpoint you are posting to, e.g. http://www.example.com/wp-json/wc/v3/orders.

+

Collect parameters

+

Collect and normalize your parameters. This includes all oauth_* parameters except for the oauth_signature itself.

+ +

These values need to be encoded into a single string which will be used later on. The process to build the string is very specific:

+ +
    +
  1. Percent encode every key and value that will be signed.
  2. +
  3. Sort the list of parameters alphabetically by encoded key.
  4. +
  5. For each key/value pair: + +
      +
    • Append the encoded key to the output string.
    • +
    • Append the = character to the output string.
    • +
    • Append the encoded value to the output string.
    • +
    • If there are more key/value pairs remaining, append a & character to the output string.
    • +
  6. +
+ +

When percent encoding in PHP for example, you would use rawurlencode().

+ +

When sorting parameters in PHP for example, you would use uksort( $params, 'strcmp' ).

+ +
+

Parameters example:

+
+
oauth_consumer_key=abc123&oauth_signature_method=HMAC-SHA1
+

Create the signature base string

+

The above values collected so far must be joined to make a single string, from which the signature will be generated. This is called the signature base string in the OAuth specification.

+ +

To encode the HTTP method, request URL, and parameter string into a single string:

+ +
    +
  1. Set the output string equal to the uppercase HTTP Method.
  2. +
  3. Append the & character to the output string.
  4. +
  5. Percent encode the URL and append it to the output string.
  6. +
  7. Append the & character to the output string.
  8. +
  9. Percent encode the parameter string and append it to the output string.
  10. +
+ +
+

Example signature base string:

+
+
GET&http%3A%2F%2Fwww.example.com%2Fwp-json%2Fwc%2Fv3%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1
+

Generate the signature

+

Generate the signature using the signature base string and your consumer secret key with a & character with the HMAC-SHA1 hashing algorithm.

+ +

In PHP you can use the hash_hmac function.

+ +

HMAC-SHA1 or HMAC-SHA256 are the only accepted hash algorithms.

+ +

If you are having trouble generating a correct signature, you'll want to review the string you are signing for encoding errors. The authentication source can also be helpful in understanding how to properly generate the signature.

+

OAuth tips

+ +

Index

+

By default, the API provides information about all available endpoints on the site. Authentication is not required to access the API index.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3
+
+
+
curl https://example.com/wp-json/wc/v3
+
WooCommerce.get("")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('')); ?>
+
print(wcapi.get("").json())
+
woocommerce.get("").parsed_response
+
+
+

JSON response example:

+
+
{
+  "namespace": "wc/v3",
+  "routes": {
+    "/wc/v3": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "namespace": {
+              "required": false,
+              "default": "wc/v3"
+            },
+            "context": {
+              "required": false,
+              "default": "view"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3"
+      }
+    },
+    "/wc/v3/coupons": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "code": {
+              "required": false,
+              "description": "Limit result set to resources with a specific code.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "code": {
+              "required": true,
+              "description": "Coupon code.",
+              "type": "string"
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount. Should always be numeric, even if setting a percentage.",
+              "type": "string"
+            },
+            "discount_type": {
+              "required": false,
+              "default": "fixed_cart",
+              "enum": [
+                "percent",
+                "fixed_cart",
+                "fixed_product"
+              ],
+              "description": "Determines the type of discount that will be applied.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description.",
+              "type": "string"
+            },
+            "date_expires": {
+              "required": false,
+              "description": "The date the coupon expires, in the site's timezone.",
+              "type": "string"
+            },
+            "date_expires_gmt": {
+              "required": false,
+              "description": "The date the coupon expires, as GMT.",
+              "type": "string"
+            },
+            "individual_use": {
+              "required": false,
+              "default": false,
+              "description": "If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.",
+              "type": "boolean"
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon can be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon cannot be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used in total.",
+              "type": "integer"
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer.",
+              "type": "integer"
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to.",
+              "type": "integer"
+            },
+            "free_shipping": {
+              "required": false,
+              "default": false,
+              "description": "If true and if the free shipping method requires a coupon, this coupon will enable free shipping.",
+              "type": "boolean"
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon applies to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon does not apply to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "default": false,
+              "description": "If true, this coupon will not be applied to items that have sale prices.",
+              "type": "boolean"
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies.",
+              "type": "string"
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon.",
+              "type": "string"
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon.",
+              "type": "array",
+              "items": {
+                "type": "string"
+              }
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/coupons"
+      }
+    },
+    "/wc/v3/coupons/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "code": {
+              "required": false,
+              "description": "Coupon code.",
+              "type": "string"
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount. Should always be numeric, even if setting a percentage.",
+              "type": "string"
+            },
+            "discount_type": {
+              "required": false,
+              "enum": [
+                "percent",
+                "fixed_cart",
+                "fixed_product"
+              ],
+              "description": "Determines the type of discount that will be applied.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description.",
+              "type": "string"
+            },
+            "date_expires": {
+              "required": false,
+              "description": "The date the coupon expires, in the site's timezone.",
+              "type": "string"
+            },
+            "date_expires_gmt": {
+              "required": false,
+              "description": "The date the coupon expires, as GMT.",
+              "type": "string"
+            },
+            "individual_use": {
+              "required": false,
+              "description": "If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.",
+              "type": "boolean"
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon can be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon cannot be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used in total.",
+              "type": "integer"
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer.",
+              "type": "integer"
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to.",
+              "type": "integer"
+            },
+            "free_shipping": {
+              "required": false,
+              "description": "If true and if the free shipping method requires a coupon, this coupon will enable free shipping.",
+              "type": "boolean"
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon applies to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon does not apply to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "description": "If true, this coupon will not be applied to items that have sale prices.",
+              "type": "boolean"
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies.",
+              "type": "string"
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon.",
+              "type": "string"
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon.",
+              "type": "array",
+              "items": {
+                "type": "string"
+              }
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/coupons/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "code": {
+              "required": false,
+              "description": "Coupon code.",
+              "type": "string"
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount. Should always be numeric, even if setting a percentage.",
+              "type": "string"
+            },
+            "discount_type": {
+              "required": false,
+              "enum": [
+                "percent",
+                "fixed_cart",
+                "fixed_product"
+              ],
+              "description": "Determines the type of discount that will be applied.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description.",
+              "type": "string"
+            },
+            "date_expires": {
+              "required": false,
+              "description": "The date the coupon expires, in the site's timezone.",
+              "type": "string"
+            },
+            "date_expires_gmt": {
+              "required": false,
+              "description": "The date the coupon expires, as GMT.",
+              "type": "string"
+            },
+            "individual_use": {
+              "required": false,
+              "description": "If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.",
+              "type": "boolean"
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon can be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon cannot be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used in total.",
+              "type": "integer"
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer.",
+              "type": "integer"
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to.",
+              "type": "integer"
+            },
+            "free_shipping": {
+              "required": false,
+              "description": "If true and if the free shipping method requires a coupon, this coupon will enable free shipping.",
+              "type": "boolean"
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon applies to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon does not apply to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "description": "If true, this coupon will not be applied to items that have sale prices.",
+              "type": "boolean"
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies.",
+              "type": "string"
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon.",
+              "type": "string"
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon.",
+              "type": "array",
+              "items": {
+                "type": "string"
+              }
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/coupons/batch"
+      }
+    },
+    "/wc/v3/customers/(?P<customer_id>[\\d]+)/downloads": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "customer_id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/customers": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "registered_date"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "email": {
+              "required": false,
+              "description": "Limit result set to resources with a specific email.",
+              "type": "string"
+            },
+            "role": {
+              "required": false,
+              "default": "customer",
+              "enum": [
+                "all",
+                "administrator",
+                "editor",
+                "author",
+                "contributor",
+                "subscriber",
+                "customer",
+                "shop_manager"
+              ],
+              "description": "Limit result set to resources with a specific role.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "email": {
+              "required": true,
+              "description": "New user email address.",
+              "type": "string"
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name.",
+              "type": "string"
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name.",
+              "type": "string"
+            },
+            "username": {
+              "required": false,
+              "description": "New user username.",
+              "type": "string"
+            },
+            "password": {
+              "required": false,
+              "description": "New user password.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "List of billing address data.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "List of shipping address data.",
+              "type": "object"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/customers"
+      }
+    },
+    "/wc/v3/customers/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "email": {
+              "required": false,
+              "description": "The email address for the customer.",
+              "type": "string"
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name.",
+              "type": "string"
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name.",
+              "type": "string"
+            },
+            "username": {
+              "required": false,
+              "description": "Customer login name.",
+              "type": "string"
+            },
+            "password": {
+              "required": false,
+              "description": "Customer password.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "List of billing address data.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "List of shipping address data.",
+              "type": "object"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            },
+            "reassign": {
+              "required": false,
+              "default": 0,
+              "description": "ID to reassign posts to.",
+              "type": "integer"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/customers/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "email": {
+              "required": false,
+              "description": "The email address for the customer.",
+              "type": "string"
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name.",
+              "type": "string"
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name.",
+              "type": "string"
+            },
+            "username": {
+              "required": false,
+              "description": "Customer login name.",
+              "type": "string"
+            },
+            "password": {
+              "required": false,
+              "description": "Customer password.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "List of billing address data.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "List of shipping address data.",
+              "type": "object"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/customers/batch"
+      }
+    },
+    "/wc/v3/orders/(?P<order_id>[\\d]+)/notes": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "customer",
+                "internal"
+              ],
+              "description": "Limit result to customers or internal notes.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "note": {
+              "required": true,
+              "description": "Order note content.",
+              "type": "string"
+            },
+            "customer_note": {
+              "required": false,
+              "default": false,
+              "description": "If true, the note will be shown to customers and they will be notified. If false, the note will be for admin reference only.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/orders/(?P<order_id>[\\d]+)/notes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/orders/(?P<order_id>[\\d]+)/refunds": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "dp": {
+              "required": false,
+              "default": 2,
+              "description": "Number of decimal points to use in each resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "amount": {
+              "required": false,
+              "description": "Refund amount.",
+              "type": "string"
+            },
+            "reason": {
+              "required": false,
+              "description": "Reason for refund.",
+              "type": "string"
+            },
+            "refunded_by": {
+              "required": false,
+              "description": "User ID of user who created the refund.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "api_refund": {
+              "required": false,
+              "default": true,
+              "description": "When true, the payment gateway API is used to generate the refund.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/orders/(?P<order_id>[\\d]+)/refunds/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": true,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/orders": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Limit result set to orders assigned a specific status.",
+              "type": "string"
+            },
+            "customer": {
+              "required": false,
+              "description": "Limit result set to orders assigned a specific customer.",
+              "type": "integer"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to orders assigned a specific product.",
+              "type": "integer"
+            },
+            "dp": {
+              "required": false,
+              "default": 2,
+              "description": "Number of decimal points to use in each resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID.",
+              "type": "integer"
+            },
+            "status": {
+              "required": false,
+              "default": "pending",
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status.",
+              "type": "string"
+            },
+            "currency": {
+              "required": false,
+              "default": "USD",
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "IRT",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format.",
+              "type": "string"
+            },
+            "customer_id": {
+              "required": false,
+              "default": 0,
+              "description": "User ID who owns the order. 0 for guests.",
+              "type": "integer"
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address.",
+              "type": "object"
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID.",
+              "type": "string"
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title.",
+              "type": "string"
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID.",
+              "type": "string"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "method_title": {
+                    "description": "Shipping method name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "method_id": {
+                    "description": "Shipping method ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Fee name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_status": {
+                    "description": "Tax status of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "enum": [
+                      "taxable",
+                      "none"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "code": {
+                    "description": "Coupon code.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount": {
+                    "description": "Discount total.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount_tax": {
+                    "description": "Discount total tax.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "set_paid": {
+              "required": false,
+              "default": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/orders"
+      }
+    },
+    "/wc/v3/orders/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID.",
+              "type": "integer"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status.",
+              "type": "string"
+            },
+            "currency": {
+              "required": false,
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "IRT",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format.",
+              "type": "string"
+            },
+            "customer_id": {
+              "required": false,
+              "description": "User ID who owns the order. 0 for guests.",
+              "type": "integer"
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address.",
+              "type": "object"
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID.",
+              "type": "string"
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title.",
+              "type": "string"
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID.",
+              "type": "string"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "method_title": {
+                    "description": "Shipping method name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "method_id": {
+                    "description": "Shipping method ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Fee name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_status": {
+                    "description": "Tax status of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "enum": [
+                      "taxable",
+                      "none"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "code": {
+                    "description": "Coupon code.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount": {
+                    "description": "Discount total.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount_tax": {
+                    "description": "Discount total tax.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "set_paid": {
+              "required": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items.",
+              "type": "boolean"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/orders/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID.",
+              "type": "integer"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status.",
+              "type": "string"
+            },
+            "currency": {
+              "required": false,
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "IRT",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format.",
+              "type": "string"
+            },
+            "customer_id": {
+              "required": false,
+              "description": "User ID who owns the order. 0 for guests.",
+              "type": "integer"
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address.",
+              "type": "object"
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID.",
+              "type": "string"
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title.",
+              "type": "string"
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID.",
+              "type": "string"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "method_title": {
+                    "description": "Shipping method name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "method_id": {
+                    "description": "Shipping method ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Fee name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_status": {
+                    "description": "Tax status of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "enum": [
+                      "taxable",
+                      "none"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "code": {
+                    "description": "Coupon code.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount": {
+                    "description": "Discount total.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount_tax": {
+                    "description": "Discount total tax.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "set_paid": {
+              "required": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/orders/batch"
+      }
+    },
+    "/wc/v3/products/attributes/(?P<attribute_id>[\\d]+)/terms": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "parent": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific parent.",
+              "type": "integer"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Term name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/attributes/(?P<attribute_id>[\\d]+)/terms/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Term name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/attributes": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "default": "select",
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute.",
+              "type": "string"
+            },
+            "order_by": {
+              "required": false,
+              "default": "menu_order",
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order.",
+              "type": "string"
+            },
+            "has_archives": {
+              "required": false,
+              "default": false,
+              "description": "Enable/Disable attribute archives.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/attributes"
+      }
+    },
+    "/wc/v3/products/attributes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Attribute name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute.",
+              "type": "string"
+            },
+            "order_by": {
+              "required": false,
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order.",
+              "type": "string"
+            },
+            "has_archives": {
+              "required": false,
+              "description": "Enable/Disable attribute archives.",
+              "type": "boolean"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": true,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/attributes/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Attribute name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute.",
+              "type": "string"
+            },
+            "order_by": {
+              "required": false,
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order.",
+              "type": "string"
+            },
+            "has_archives": {
+              "required": false,
+              "description": "Enable/Disable attribute archives.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/attributes/batch"
+      }
+    },
+    "/wc/v3/products/categories": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "parent": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific parent.",
+              "type": "integer"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "description": "The ID for the parent of the resource.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "display": {
+              "required": false,
+              "default": "default",
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Image data.",
+              "type": "object"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/categories"
+      }
+    },
+    "/wc/v3/products/categories/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Category name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "description": "The ID for the parent of the resource.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "display": {
+              "required": false,
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Image data.",
+              "type": "object"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/categories/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Category name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "description": "The ID for the parent of the resource.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "display": {
+              "required": false,
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Image data.",
+              "type": "object"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/categories/batch"
+      }
+    },
+    "/wc/v3/products/(?P<product_id>[\\d]+)/reviews": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "review": {
+              "required": true,
+              "description": "Review content.",
+              "type": "string"
+            },
+            "date_created": {
+              "required": false,
+              "description": "The date the review was created, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_created_gmt": {
+              "required": false,
+              "description": "The date the review was created, as GMT.",
+              "type": "date-time"
+            },
+            "rating": {
+              "required": false,
+              "description": "Review rating (0 to 5).",
+              "type": "integer"
+            },
+            "name": {
+              "required": true,
+              "description": "Name of the reviewer.",
+              "type": "string"
+            },
+            "email": {
+              "required": true,
+              "description": "Email of the reviewer.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/(?P<product_id>[\\d]+)/reviews/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "review": {
+              "required": false,
+              "description": "The content of the review.",
+              "type": "string"
+            },
+            "date_created": {
+              "required": false,
+              "description": "The date the review was created, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_created_gmt": {
+              "required": false,
+              "description": "The date the review was created, as GMT.",
+              "type": "date-time"
+            },
+            "rating": {
+              "required": false,
+              "description": "Review rating (0 to 5).",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Reviewer name.",
+              "type": "string"
+            },
+            "email": {
+              "required": false,
+              "description": "Reviewer email.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/(?P<product_id>[\\d]+)/reviews/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "review": {
+              "required": false,
+              "description": "The content of the review.",
+              "type": "string"
+            },
+            "date_created": {
+              "required": false,
+              "description": "The date the review was created, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_created_gmt": {
+              "required": false,
+              "description": "The date the review was created, as GMT.",
+              "type": "date-time"
+            },
+            "rating": {
+              "required": false,
+              "description": "Review rating (0 to 5).",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Reviewer name.",
+              "type": "string"
+            },
+            "email": {
+              "required": false,
+              "description": "Reviewer email.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/shipping_classes": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+      }
+    },
+    "/wc/v3/products/shipping_classes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Shipping class name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/shipping_classes/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Shipping class name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/shipping_classes/batch"
+      }
+    },
+    "/wc/v3/products/tags": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/tags"
+      }
+    },
+    "/wc/v3/products/tags/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Tag name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/tags/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Tag name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/tags/batch"
+      }
+    },
+    "/wc/v3/products": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug",
+                "price",
+                "popularity",
+                "rating"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to products with a specific slug.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Limit result set to products assigned a specific status.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Limit result set to products assigned a specific type.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Limit result set to products with a specific SKU.",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Limit result set to featured products.",
+              "type": "boolean"
+            },
+            "category": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific category ID.",
+              "type": "string"
+            },
+            "tag": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific tag ID.",
+              "type": "string"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific shipping class ID.",
+              "type": "string"
+            },
+            "attribute": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute.",
+              "type": "string"
+            },
+            "attribute_term": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute term ID (required an assigned attribute).",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Limit result set to products with a specific tax class.",
+              "type": "string"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Limit result set to products in stock or out of stock.",
+              "type": "boolean"
+            },
+            "on_sale": {
+              "required": false,
+              "description": "Limit result set to products on sale.",
+              "type": "boolean"
+            },
+            "min_price": {
+              "required": false,
+              "description": "Limit result set to products based on a minimum price.",
+              "type": "string"
+            },
+            "max_price": {
+              "required": false,
+              "description": "Limit result set to products based on a maximum price.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "default": "simple",
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "publish",
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status).",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "default": false,
+              "description": "Featured product.",
+              "type": "boolean"
+            },
+            "catalog_visibility": {
+              "required": false,
+              "default": "visible",
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Product description.",
+              "type": "string"
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "virtual": {
+              "required": false,
+              "default": false,
+              "description": "If the product is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "default": false,
+              "description": "If the product is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "default": -1,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "default": -1,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products.",
+              "type": "string"
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products.",
+              "type": "string"
+            },
+            "tax_status": {
+              "required": false,
+              "default": "taxable",
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "default": false,
+              "description": "Stock management at product level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "default": true,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "default": "no",
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "sold_individually": {
+              "required": false,
+              "default": false,
+              "description": "Allow one item to be bought in a single order.",
+              "type": "boolean"
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "reviews_allowed": {
+              "required": false,
+              "default": true,
+              "description": "Allow reviews.",
+              "type": "boolean"
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID.",
+              "type": "integer"
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase.",
+              "type": "string"
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Category ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Category name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Category slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Tag ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Tag name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Tag slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "images": {
+              "required": false,
+              "description": "List of images.",
+              "type": "object",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Image ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "date_created": {
+                    "description": "The date the image was created, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_created_gmt": {
+                    "description": "The date the image was created, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified": {
+                    "description": "The date the image was last modified, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified_gmt": {
+                    "description": "The date the image was last modified, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "src": {
+                    "description": "Image URL.",
+                    "type": "string",
+                    "format": "uri",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Image name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "alt": {
+                    "description": "Image alternative text.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Image position. 0 means that the image is featured.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Attribute position.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "visible": {
+                    "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation": {
+                    "description": "Define if the attribute can be used as variation.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "options": {
+                    "description": "List of available term names of the attribute.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products"
+      }
+    },
+    "/wc/v3/products/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Product name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status).",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Featured product.",
+              "type": "boolean"
+            },
+            "catalog_visibility": {
+              "required": false,
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Product description.",
+              "type": "string"
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the product is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the product is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products.",
+              "type": "string"
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products.",
+              "type": "string"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at product level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "sold_individually": {
+              "required": false,
+              "description": "Allow one item to be bought in a single order.",
+              "type": "boolean"
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "reviews_allowed": {
+              "required": false,
+              "description": "Allow reviews.",
+              "type": "boolean"
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID.",
+              "type": "integer"
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase.",
+              "type": "string"
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Category ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Category name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Category slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Tag ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Tag name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Tag slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "images": {
+              "required": false,
+              "description": "List of images.",
+              "type": "object",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Image ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "date_created": {
+                    "description": "The date the image was created, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_created_gmt": {
+                    "description": "The date the image was created, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified": {
+                    "description": "The date the image was last modified, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified_gmt": {
+                    "description": "The date the image was last modified, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "src": {
+                    "description": "Image URL.",
+                    "type": "string",
+                    "format": "uri",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Image name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "alt": {
+                    "description": "Image alternative text.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Image position. 0 means that the image is featured.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Attribute position.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "visible": {
+                    "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation": {
+                    "description": "Define if the attribute can be used as variation.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "options": {
+                    "description": "List of available term names of the attribute.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status).",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Featured product.",
+              "type": "boolean"
+            },
+            "catalog_visibility": {
+              "required": false,
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Product description.",
+              "type": "string"
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the product is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the product is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products.",
+              "type": "string"
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products.",
+              "type": "string"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at product level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "sold_individually": {
+              "required": false,
+              "description": "Allow one item to be bought in a single order.",
+              "type": "boolean"
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "reviews_allowed": {
+              "required": false,
+              "description": "Allow reviews.",
+              "type": "boolean"
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID.",
+              "type": "integer"
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase.",
+              "type": "string"
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Category ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Category name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Category slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Tag ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Tag name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Tag slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "images": {
+              "required": false,
+              "description": "List of images.",
+              "type": "object",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Image ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "date_created": {
+                    "description": "The date the image was created, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_created_gmt": {
+                    "description": "The date the image was created, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified": {
+                    "description": "The date the image was last modified, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified_gmt": {
+                    "description": "The date the image was last modified, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "src": {
+                    "description": "Image URL.",
+                    "type": "string",
+                    "format": "uri",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Image name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "alt": {
+                    "description": "Image alternative text.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Image position. 0 means that the image is featured.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Attribute position.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "visible": {
+                    "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation": {
+                    "description": "Define if the attribute can be used as variation.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "options": {
+                    "description": "List of available term names of the attribute.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/products/batch"
+      }
+    },
+    "/wc/v3/products/(?P<product_id>[\\d]+)/variations": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to products with a specific slug.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Limit result set to products assigned a specific status.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Limit result set to products assigned a specific type.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Limit result set to products with a specific SKU.",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Limit result set to featured products.",
+              "type": "boolean"
+            },
+            "category": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific category ID.",
+              "type": "string"
+            },
+            "tag": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific tag ID.",
+              "type": "string"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific shipping class ID.",
+              "type": "string"
+            },
+            "attribute": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute.",
+              "type": "string"
+            },
+            "attribute_term": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute term ID (required an assigned attribute).",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Limit result set to products with a specific tax class.",
+              "type": "string"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Limit result set to products in stock or out of stock.",
+              "type": "boolean"
+            },
+            "on_sale": {
+              "required": false,
+              "description": "Limit result set to products on sale.",
+              "type": "boolean"
+            },
+            "min_price": {
+              "required": false,
+              "description": "Limit result set to products based on a minimum price.",
+              "type": "string"
+            },
+            "max_price": {
+              "required": false,
+              "description": "Limit result set to products based on a maximum price.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "Variation description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Variation regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Variation sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "visible": {
+              "required": false,
+              "default": true,
+              "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+              "type": "boolean"
+            },
+            "virtual": {
+              "required": false,
+              "default": false,
+              "description": "If the variation is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "default": false,
+              "description": "If the variation is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "default": -1,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "default": -1,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "tax_status": {
+              "required": false,
+              "default": "taxable",
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "default": false,
+              "description": "Stock management at variation level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "default": true,
+              "description": "Controls whether or not the variation is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "default": "no",
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "weight": {
+              "required": false,
+              "description": "Variation weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Variation dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Variation image data.",
+              "type": "object"
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/(?P<product_id>[\\d]+)/variations/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "Variation description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Variation regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Variation sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "visible": {
+              "required": false,
+              "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+              "type": "boolean"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the variation is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the variation is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at variation level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the variation is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "weight": {
+              "required": false,
+              "description": "Variation weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Variation dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Variation image data.",
+              "type": "object"
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/products/(?P<product_id>[\\d]+)/variations/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "Variation description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Variation regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Variation sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "visible": {
+              "required": false,
+              "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+              "type": "boolean"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the variation is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the variation is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at variation level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the variation is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "weight": {
+              "required": false,
+              "description": "Variation weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Variation dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Variation image data.",
+              "type": "object"
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/reports/sales": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "period": {
+              "required": false,
+              "enum": [
+                "week",
+                "month",
+                "last_month",
+                "year"
+              ],
+              "description": "Report period.",
+              "type": "string"
+            },
+            "date_min": {
+              "required": false,
+              "description": "Return sales for a specific start date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            },
+            "date_max": {
+              "required": false,
+              "description": "Return sales for a specific end date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/reports/sales"
+      }
+    },
+    "/wc/v3/reports/top_sellers": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "period": {
+              "required": false,
+              "enum": [
+                "week",
+                "month",
+                "last_month",
+                "year"
+              ],
+              "description": "Report period.",
+              "type": "string"
+            },
+            "date_min": {
+              "required": false,
+              "description": "Return sales for a specific start date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            },
+            "date_max": {
+              "required": false,
+              "description": "Return sales for a specific end date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/reports/top_sellers"
+      }
+    },
+    "/wc/v3/reports": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/reports"
+      }
+    },
+    "/wc/v3/settings": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": []
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/settings"
+      }
+    },
+    "/wc/v3/settings/(?P<group_id>[\\w-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/settings/(?P<group_id>[\\w-]+)/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            },
+            "value": {
+              "required": false,
+              "description": "Setting value.",
+              "type": "mixed"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/settings/(?P<group_id>[\\w-]+)/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "value": {
+              "required": false,
+              "description": "Setting value.",
+              "type": "mixed"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/shipping/zones": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": []
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Shipping zone name.",
+              "type": "string"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping zone order.",
+              "type": "integer"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/shipping/zones"
+      }
+    },
+    "/wc/v3/shipping/zones/(?P<id>[\\d-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Shipping zone name.",
+              "type": "string"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping zone order.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/shipping/zones/(?P<id>[\\d-]+)/locations": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            },
+            "code": {
+              "required": false,
+              "description": "Shipping zone location code.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "postcode",
+                "state",
+                "country",
+                "continent"
+              ],
+              "description": "Shipping zone location type.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/shipping/zones/(?P<zone_id>[\\d-]+)/methods": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping method sort order.",
+              "type": "integer"
+            },
+            "enabled": {
+              "required": false,
+              "description": "Shipping method enabled status.",
+              "type": "boolean"
+            },
+            "settings": {
+              "required": false,
+              "description": "Shipping method settings.",
+              "type": "object"
+            },
+            "method_id": {
+              "required": true,
+              "description": "Shipping method ID."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/shipping/zones/(?P<zone_id>[\\d-]+)/methods/(?P<instance_id>[\\d-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "instance_id": {
+              "required": false,
+              "description": "Unique ID for the instance.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "instance_id": {
+              "required": false,
+              "description": "Unique ID for the instance.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping method sort order.",
+              "type": "integer"
+            },
+            "enabled": {
+              "required": false,
+              "description": "Shipping method enabled status.",
+              "type": "boolean"
+            },
+            "settings": {
+              "required": false,
+              "description": "Shipping method settings.",
+              "type": "object"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "instance_id": {
+              "required": false,
+              "description": "Unique ID for the instance.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/taxes/classes": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Tax class name.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/taxes/classes"
+      }
+    },
+    "/wc/v3/taxes/classes/(?P<slug>\\w[\\w\\s\\-]*)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "slug": {
+              "required": false,
+              "description": "Unique slug for the resource.",
+              "type": "string"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/taxes": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "order",
+              "enum": [
+                "id",
+                "order"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Sort by tax class.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code.",
+              "type": "string"
+            },
+            "state": {
+              "required": false,
+              "description": "State code.",
+              "type": "string"
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode / ZIP.",
+              "type": "string"
+            },
+            "city": {
+              "required": false,
+              "description": "City name.",
+              "type": "string"
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name.",
+              "type": "string"
+            },
+            "priority": {
+              "required": false,
+              "default": 1,
+              "description": "Tax priority.",
+              "type": "integer"
+            },
+            "compound": {
+              "required": false,
+              "default": false,
+              "description": "Whether or not this is a compound rate.",
+              "type": "boolean"
+            },
+            "shipping": {
+              "required": false,
+              "default": true,
+              "description": "Whether or not this tax rate also gets applied to shipping.",
+              "type": "boolean"
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries.",
+              "type": "integer"
+            },
+            "class": {
+              "required": false,
+              "default": "standard",
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/taxes"
+      }
+    },
+    "/wc/v3/taxes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code.",
+              "type": "string"
+            },
+            "state": {
+              "required": false,
+              "description": "State code.",
+              "type": "string"
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode / ZIP.",
+              "type": "string"
+            },
+            "city": {
+              "required": false,
+              "description": "City name.",
+              "type": "string"
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name.",
+              "type": "string"
+            },
+            "priority": {
+              "required": false,
+              "description": "Tax priority.",
+              "type": "integer"
+            },
+            "compound": {
+              "required": false,
+              "description": "Whether or not this is a compound rate.",
+              "type": "boolean"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Whether or not this tax rate also gets applied to shipping.",
+              "type": "boolean"
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries.",
+              "type": "integer"
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/taxes/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code.",
+              "type": "string"
+            },
+            "state": {
+              "required": false,
+              "description": "State code.",
+              "type": "string"
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode / ZIP.",
+              "type": "string"
+            },
+            "city": {
+              "required": false,
+              "description": "City name.",
+              "type": "string"
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name.",
+              "type": "string"
+            },
+            "priority": {
+              "required": false,
+              "description": "Tax priority.",
+              "type": "integer"
+            },
+            "compound": {
+              "required": false,
+              "description": "Whether or not this is a compound rate.",
+              "type": "boolean"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Whether or not this tax rate also gets applied to shipping.",
+              "type": "boolean"
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries.",
+              "type": "integer"
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/taxes/batch"
+      }
+    },
+    "/wc/v3/webhooks/(?P<webhook_id>[\\d]+)/deliveries": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "webhook_id": {
+              "required": false,
+              "description": "Unique identifier for the webhook.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/webhooks/(?P<webhook_id>[\\d]+)/deliveries/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "webhook_id": {
+              "required": false,
+              "description": "Unique identifier for the webhook.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/webhooks": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "all",
+              "enum": [
+                "all",
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Limit result set to webhooks assigned a specific status.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "active",
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status.",
+              "type": "string"
+            },
+            "topic": {
+              "required": true,
+              "description": "Webhook topic.",
+              "type": "string"
+            },
+            "secret": {
+              "required": true,
+              "description": "Webhook secret.",
+              "type": "string"
+            },
+            "delivery_url": {
+              "required": true,
+              "description": "Webhook delivery URL.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/webhooks"
+      }
+    },
+    "/wc/v3/webhooks/(?P<id>[\\d]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status.",
+              "type": "string"
+            },
+            "topic": {
+              "required": false,
+              "description": "Webhook topic.",
+              "type": "string"
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/webhooks/batch": {
+      "namespace": "wc/v3",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status.",
+              "type": "string"
+            },
+            "topic": {
+              "required": false,
+              "description": "Webhook topic.",
+              "type": "string"
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/webhooks/batch"
+      }
+    },
+    "/wc/v3/system_status": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/system_status"
+      }
+    },
+    "/wc/v3/system_status/tools": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/system_status/tools"
+      }
+    },
+    "/wc/v3/system_status/tools/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "A unique identifier for the tool.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tool name.",
+              "type": "string"
+            },
+            "action": {
+              "required": false,
+              "description": "What running the tool will do.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Tool description.",
+              "type": "string"
+            },
+            "success": {
+              "required": false,
+              "description": "Did the tool run successfully?",
+              "type": "boolean"
+            },
+            "message": {
+              "required": false,
+              "description": "Tool return message.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/shipping_methods": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/shipping_methods"
+      }
+    },
+    "/wc/v3/shipping_methods/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v3/payment_gateways": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v3/payment_gateways"
+      }
+    },
+    "/wc/v3/payment_gateways/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v3",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "title": {
+              "required": false,
+              "description": "Payment gateway title on checkout.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Payment gateway description on checkout.",
+              "type": "string"
+            },
+            "order": {
+              "required": false,
+              "description": "Payment gateway sort order.",
+              "type": "integer"
+            },
+            "enabled": {
+              "required": false,
+              "description": "Payment gateway enabled status.",
+              "type": "boolean"
+            },
+            "settings": {
+              "required": false,
+              "description": "Payment gateway settings.",
+              "type": "object"
+            }
+          }
+        }
+      ]
+    }
+  },
+  "_links": {
+    "up": [
+      {
+        "href": "https://example.com/wp-json/"
+      }
+    ]
+  }
+}
+

Coupons

+

The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.

+

Coupon properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the object. read-only
codestringCoupon code. mandatory
amountstringThe amount of discount. Should always be numeric, even if setting a percentage.
date_createddate-timeThe date the coupon was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the coupon was created, as GMT. read-only
date_modifieddate-timeThe date the coupon was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the coupon was last modified, as GMT. read-only
discount_typestringDetermines the type of discount that will be applied. Options: percent, fixed_cart and fixed_product. Default is fixed_cart.
descriptionstringCoupon description.
date_expiresstringThe date the coupon expires, in the site's timezone.
date_expires_gmtstringThe date the coupon expires, as GMT.
usage_countintegerNumber of times the coupon has been used already. read-only
individual_usebooleanIf true, the coupon can only be used individually. Other applied coupons will be removed from the cart. Default is false.
product_idsarrayList of product IDs the coupon can be used on.
excluded_product_idsarrayList of product IDs the coupon cannot be used on.
usage_limitintegerHow many times the coupon can be used in total.
usage_limit_per_userintegerHow many times the coupon can be used per customer.
limit_usage_to_x_itemsintegerMax number of items in the cart the coupon can be applied to.
free_shippingbooleanIf true and if the free shipping method requires a coupon, this coupon will enable free shipping. Default is false.
product_categoriesarrayList of category IDs the coupon applies to.
excluded_product_categoriesarrayList of category IDs the coupon does not apply to.
exclude_sale_itemsbooleanIf true, this coupon will not be applied to items that have sale prices. Default is false.
minimum_amountstringMinimum order amount that needs to be in the cart before coupon applies.
maximum_amountstringMaximum order amount allowed when using the coupon.
email_restrictionsarrayList of email addresses that can use this coupon.
used_byarrayList of user IDs (or guest email addresses) that have used the coupon. read-only
meta_dataarrayMeta data. See Coupon - Meta data properties
+

Coupon - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a coupon

+

This API helps you to create a new coupon.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/coupons
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/coupons \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "code": "10off",
+  "discount_type": "percent",
+  "amount": "10",
+  "individual_use": true,
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00"
+}'
+
const data = {
+  code: "10off",
+  discount_type: "percent",
+  amount: "10",
+  individual_use: true,
+  exclude_sale_items: true,
+  minimum_amount: "100.00"
+};
+
+WooCommerce.post("coupons", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'code' => '10off',
+    'discount_type' => 'percent',
+    'amount' => '10',
+    'individual_use' => true,
+    'exclude_sale_items' => true,
+    'minimum_amount' => '100.00'
+];
+
+print_r($woocommerce->post('coupons', $data));
+?>
+
data = {
+    "code": "10off",
+    "discount_type": "percent",
+    "amount": "10",
+    "individual_use": True,
+    "exclude_sale_items": True,
+    "minimum_amount": "100.00"
+}
+
+print(wcapi.post("coupons", data).json())
+
data = {
+  code: "10off",
+  discount_type: "percent",
+  amount: "10",
+  individual_use: true,
+  exclude_sale_items: true,
+  minimum_amount: "100.00"
+}
+
+woocommerce.post("coupons", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "10.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:23:00",
+  "date_modified_gmt": "2017-03-21T18:23:00",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons"
+      }
+    ]
+  }
+}
+

Retrieve a coupon

+

This API lets you retrieve and view a specific coupon by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/coupons/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/coupons/719 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("coupons/719")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('coupons/719')); ?>
+
print(wcapi.get("coupons/719").json())
+
woocommerce.get("coupons/719").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "10.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:23:00",
+  "date_modified_gmt": "2017-03-21T18:23:00",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons"
+      }
+    ]
+  }
+}
+

List all coupons

+

This API helps you to list all the coupons that have been created.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/coupons
+
+
+
curl https://example.com/wp-json/wc/v3/coupons \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("coupons")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('coupons')); ?>
+
print(wcapi.get("coupons").json())
+
woocommerce.get("coupons").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 720,
+    "code": "free shipping",
+    "amount": "0.00",
+    "date_created": "2017-03-21T15:25:02",
+    "date_created_gmt": "2017-03-21T18:25:02",
+    "date_modified": "2017-03-21T15:25:02",
+    "date_modified_gmt": "2017-03-21T18:25:02",
+    "discount_type": "fixed_cart",
+    "description": "",
+    "date_expires": null,
+    "date_expires_gmt": null,
+    "usage_count": 0,
+    "individual_use": true,
+    "product_ids": [],
+    "excluded_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": null,
+    "free_shipping": true,
+    "product_categories": [],
+    "excluded_product_categories": [],
+    "exclude_sale_items": false,
+    "minimum_amount": "0.00",
+    "maximum_amount": "0.00",
+    "email_restrictions": [],
+    "used_by": [],
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/coupons/720"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/coupons"
+        }
+      ]
+    }
+  },
+  {
+    "id": 719,
+    "code": "10off",
+    "amount": "10.00",
+    "date_created": "2017-03-21T15:23:00",
+    "date_created_gmt": "2017-03-21T18:23:00",
+    "date_modified": "2017-03-21T15:23:00",
+    "date_modified_gmt": "2017-03-21T18:23:00",
+    "discount_type": "percent",
+    "description": "",
+    "date_expires": null,
+    "date_expires_gmt": null,
+    "usage_count": 0,
+    "individual_use": true,
+    "product_ids": [],
+    "excluded_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": null,
+    "free_shipping": false,
+    "product_categories": [],
+    "excluded_product_categories": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "email_restrictions": [],
+    "used_by": [],
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/coupons/719"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/coupons"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
modified_afterstringLimit response to resources modified after a given ISO8601 compliant date.
modified_beforestringLimit response to resources modified after a given ISO8601 compliant date.
dates_are_gmtbooleanWhether to consider GMT post dates when limiting response by published or modified date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
codestringLimit result set to resources with a specific code.
+

Update a coupon

+

This API lets you make changes to a coupon.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/coupons/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/coupons/719 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "amount": "5"
+}'
+
const data = {
+  amount: "5"
+};
+
+WooCommerce.put("coupons/719", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'amount' => '5'
+];
+
+print_r($woocommerce->put('coupons/719', $data)); 
+?>
+
data = {
+    "amount": "5"
+}
+
+print(wcapi.put("coupons/719", data).json())
+
data = {
+  amount: "5"
+}
+
+woocommerce.put("coupons/719", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "5.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:26:16",
+  "date_modified_gmt": "2017-03-21T18:26:16",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons"
+      }
+    ]
+  }
+}
+

Delete a coupon

+

This API helps you delete a coupon.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/coupons/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/coupons/719?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("coupons/719", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('coupons/719', ['force' => true])); ?>
+
print(wcapi.delete("coupons/719", params={"force": True}).json())
+
woocommerce.delete("coupons/719", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "5.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:26:16",
+  "date_modified_gmt": "2017-03-21T18:26:16",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/coupons"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the coupon, Default is false.
+

Batch update coupons

+

This API helps you to batch create, update and delete multiple coupons.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/coupons/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/coupons/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "code": "20off",
+      "discount_type": "percent",
+      "amount": "20",
+      "individual_use": true,
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00"
+    },
+    {
+      "code": "30off",
+      "discount_type": "percent",
+      "amount": "30",
+      "individual_use": true,
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00"
+    }
+  ],
+  "update": [
+    {
+      "id": 719,
+      "minimum_amount": "50.00"
+    }
+  ],
+  "delete": [
+    720
+  ]
+}'
+
const data = {
+  create: [
+    {
+      code: "20off",
+      discount_type: "percent",
+      amount: "20",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    },
+    {
+      code: "30off",
+      discount_type: "percent",
+      amount: "30",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    }
+  ],
+  update: [
+    {
+      id: 719,
+      minimum_amount: "50.00"
+    }
+  ],
+  delete: [
+    720
+  ]
+};
+
+WooCommerce.post("coupons/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'code' => '20off',
+            'discount_type' => 'percent',
+            'amount' => '20',
+            'individual_use' => true,
+            'exclude_sale_items' => true,
+            'minimum_amount' => '100.00'
+        ],
+        [
+            'code' => '30off',
+            'discount_type' => 'percent',
+            'amount' => '30',
+            'individual_use' => true,
+            'exclude_sale_items' => true,
+            'minimum_amount' => '100.00'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 719,
+            'minimum_amount' => '50.00'
+        ]
+    ],
+    'delete' => [
+        720
+    ]
+];
+
+print_r($woocommerce->post('coupons/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "code": "20off",
+            "discount_type": "percent",
+            "amount": "20",
+            "individual_use": True,
+            "exclude_sale_items": True,
+            "minimum_amount": "100.00"
+        },
+        {
+            "code": "30off",
+            "discount_type": "percent",
+            "amount": "30",
+            "individual_use": True,
+            "exclude_sale_items": True,
+            "minimum_amount": "100.00"
+        }
+    ],
+    "update": [
+        {
+            "id": 719,
+            "minimum_amount": "50.00"
+        }
+    ],
+    "delete": [
+        720
+    ]
+}
+
+print(wcapi.post("coupons/batch", data).json())
+
data = {
+  create: [
+    {
+      code: "20off",
+      discount_type: "percent",
+      amount: "20",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    },
+    {
+      code: "30off",
+      discount_type: "percent",
+      amount: "30",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    }
+  ],
+  update: [
+    {
+      id: 719,
+      minimum_amount: "50.00"
+    }
+  ],
+  delete: [
+    720
+  ]
+}
+
+woocommerce.post("coupons/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 721,
+      "code": "20off",
+      "amount": "20.00",
+      "date_created": "2017-03-21T15:27:29",
+      "date_created_gmt": "2017-03-21T18:27:29",
+      "date_modified": "2017-03-21T15:27:29",
+      "date_modified_gmt": "2017-03-21T18:27:29",
+      "discount_type": "percent",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons/721"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons"
+          }
+        ]
+      }
+    },
+    {
+      "id": 722,
+      "code": "30off",
+      "amount": "30.00",
+      "date_created": "2017-03-21T15:27:31",
+      "date_created_gmt": "2017-03-21T18:27:31",
+      "date_modified": "2017-03-21T15:27:31",
+      "date_modified_gmt": "2017-03-21T18:27:31",
+      "discount_type": "percent",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons/722"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 719,
+      "code": "10off",
+      "amount": "5.00",
+      "date_created": "2017-03-21T15:23:00",
+      "date_created_gmt": "2017-03-21T18:23:00",
+      "date_modified": "2017-03-21T15:27:32",
+      "date_modified_gmt": "2017-03-21T18:27:32",
+      "discount_type": "percent",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "50.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons/719"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 720,
+      "code": "free shipping",
+      "amount": "0.00",
+      "date_created": "2017-03-21T15:25:02",
+      "date_created_gmt": "2017-03-21T18:25:02",
+      "date_modified": "2017-03-21T15:25:02",
+      "date_modified_gmt": "2017-03-21T18:25:02",
+      "discount_type": "fixed_cart",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": true,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": false,
+      "minimum_amount": "0.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons/720"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/coupons"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Customers

+

The customer API allows you to create, view, update, and delete individual, or a batch, of customers.

+

Customer properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the customer was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the customer was created, as GMT. read-only
date_modifieddate-timeThe date the customer was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the customer was last modified, as GMT. read-only
emailstringThe email address for the customer. mandatory
first_namestringCustomer first name.
last_namestringCustomer last name.
rolestringCustomer role. read-only
usernamestringCustomer login name.
passwordstringCustomer password. write-only
billingobjectList of billing address data. See Customer - Billing properties
shippingobjectList of shipping address data. See Customer - Shipping properties
is_paying_customerboolIs the customer a paying customer? read-only
avatar_urlstringAvatar URL. read-only
meta_dataarrayMeta data. See Customer - Meta data properties
+

Customer - Billing properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringISO code of the country.
emailstringEmail address.
phonestringPhone number.
+

Customer - Shipping properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringISO code of the country.
+

Customer - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a customer

+

This API helps you to create a new customer.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/customers
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/customers \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  }
+}'
+
const data = {
+  email: "john.doe@example.com",
+  first_name: "John",
+  last_name: "Doe",
+  username: "john.doe",
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  }
+};
+
+WooCommerce.post("customers", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'email' => 'john.doe@example.com',
+    'first_name' => 'John',
+    'last_name' => 'Doe',
+    'username' => 'john.doe',
+    'billing' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'company' => '',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US',
+        'email' => 'john.doe@example.com',
+        'phone' => '(555) 555-5555'
+    ],
+    'shipping' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'company' => '',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US'
+    ]
+];
+
+print_r($woocommerce->post('customers', $data));
+?>
+
data = {
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+    },
+    "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+    }
+}
+
+print(wcapi.post("customers", data).json())
+
data = {
+  email: "john.doe@example.com",
+  first_name: "John",
+  last_name: "Doe",
+  username: "john.doe",
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  }
+}
+
+woocommerce.post("customers", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:09:30",
+  "date_modified_gmt": "2017-03-21T19:09:30",
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers"
+      }
+    ]
+  }
+}
+

Retrieve a customer

+

This API lets you retrieve and view a specific customer by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/customers/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/customers/25 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers/25")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers/25')); ?>
+
print(wcapi.get("customers/25").json())
+
woocommerce.get("customers/25").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:09:30",
+  "date_modified_gmt": "2017-03-21T19:09:30",
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers"
+      }
+    ]
+  }
+}
+

List all customers

+

This API helps you to view all the customers.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/customers
+
+
+
curl https://example.com/wp-json/wc/v3/customers \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers')); ?>
+
print(wcapi.get("customers").json())
+
woocommerce.get("customers").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 26,
+    "date_created": "2017-03-21T16:11:14",
+    "date_created_gmt": "2017-03-21T19:11:14",
+    "date_modified": "2017-03-21T16:11:16",
+    "date_modified_gmt": "2017-03-21T19:11:16",
+    "email": "joao.silva@example.com",
+    "first_name": "João",
+    "last_name": "Silva",
+    "role": "customer",
+    "username": "joao.silva",
+    "billing": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR",
+      "email": "joao.silva@example.com",
+      "phone": "(55) 5555-5555"
+    },
+    "shipping": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR"
+    },
+    "is_paying_customer": false,
+    "avatar_url": "https://secure.gravatar.com/avatar/be7b5febff88a2d947c3289e90cdf017?s=96",
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/customers/26"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/customers"
+        }
+      ]
+    }
+  },
+  {
+    "id": 25,
+    "date_created": "2017-03-21T16:09:28",
+    "date_created_gmt": "2017-03-21T19:09:28",
+    "date_modified": "2017-03-21T16:09:30",
+    "date_modified_gmt": "2017-03-21T19:09:30",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "role": "customer",
+    "username": "john.doe",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "is_paying_customer": false,
+    "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/customers/25"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/customers"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific IDs.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by object attribute. Options: id, include, name and registered_date. Default is name.
emailstringLimit result set to resources with a specific email.
rolestringLimit result set to resources with a specific role. Options: all, administrator, editor, author, contributor, subscriber, customer and shop_manager. Default is customer.
+

Update a customer

+

This API lets you make changes to a customer.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/customers/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/customers/25 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "first_name": "James",
+  "billing": {
+    "first_name": "James"
+  },
+  "shipping": {
+    "first_name": "James"
+  }
+}'
+
const data = {
+  first_name: "James",
+  billing: {
+    first_name: "James"
+  },
+  shipping: {
+    first_name: "James"
+  }
+};
+
+WooCommerce.put("customers/25", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'first_name' => 'James',
+    'billing' => [
+        'first_name' => 'James'
+    ],
+    'shipping' => [
+        'first_name' => 'James'
+    ]
+];
+
+print_r($woocommerce->put('customers/25', $data));
+?>
+
data = {
+    "first_name": "James",
+    "billing": {
+        "first_name": "James"
+    },
+    "shipping": {
+        "first_name": "James"
+    }
+}
+
+print(wcapi.put("customers/25", data).json())
+
data = {
+  first_name: "James",
+  billing: {
+    first_name: "James"
+  },
+  shipping: {
+    first_name: "James"
+  }
+}
+
+woocommerce.put("customers/25", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:12:28",
+  "date_modified_gmt": "2017-03-21T19:12:28",
+  "email": "john.doe@example.com",
+  "first_name": "James",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers"
+      }
+    ]
+  }
+}
+

Delete a customer

+

This API helps you delete a customer.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/customers/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/customers/25?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("customers/25", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('customers/25', ['force' => true])); ?>
+
print(wcapi.delete("customers/25", params={"force": True}).json())
+
woocommerce.delete("customers/25", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:12:28",
+  "date_modified_gmt": "2017-03-21T19:12:28",
+  "email": "john.doe@example.com",
+  "first_name": "James",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/customers"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
reassignintegerUser ID to reassign posts to.
+

Batch update customers

+

This API helps you to batch create, update and delete multiple customers.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/customers/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/customers/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe2",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva2",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 26,
+      "billing": {
+        "phone": "(11) 1111-1111"
+      }
+    }
+  ],
+  "delete": [
+    25
+  ]
+}'
+
const data = {
+  create: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ],
+  update: [
+    {
+      id: 26,
+      billing: {
+        phone: "(11) 1111-1111"
+      }
+    }
+  ],
+  delete: [
+    11
+  ]
+};
+
+WooCommerce.post("customers/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'create' => [
+        [
+            'email' => 'john.doe2@example.com',
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'username' => 'john.doe2',
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'company' => '',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'company' => '',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ]
+        ],
+        [
+            'email' => 'joao.silva2@example.com',
+            'first_name' => 'João',
+            'last_name' => 'Silva',
+            'username' => 'joao.silva2',
+            'billing' => [
+                'first_name' => 'João',
+                'last_name' => 'Silva',
+                'company' => '',
+                'address_1' => 'Av. Brasil, 432',
+                'address_2' => '',
+                'city' => 'Rio de Janeiro',
+                'state' => 'RJ',
+                'postcode' => '12345-000',
+                'country' => 'BR',
+                'email' => 'joao.silva@example.com',
+                'phone' => '(55) 5555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'João',
+                'last_name' => 'Silva',
+                'company' => '',
+                'address_1' => 'Av. Brasil, 432',
+                'address_2' => '',
+                'city' => 'Rio de Janeiro',
+                'state' => 'RJ',
+                'postcode' => '12345-000',
+                'country' => 'BR'
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 26,
+            'billing' => [
+                'phone' => '(11) 1111-1111'
+            ]
+        ]
+    ],
+    'delete' => [
+        25
+    ]
+];
+
+print_r($woocommerce->post('customers/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "email": "john.doe2@example.com",
+            "first_name": "John",
+            "last_name": "Doe",
+            "username": "john.doe2",
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            }
+        },
+        {
+            "email": "joao.silva2@example.com",
+            "first_name": "João",
+            "last_name": "Silva",
+            "username": "joao.silva2",
+            "billing": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR",
+                "email": "joao.silva@example.com",
+                "phone": "(55) 5555-5555"
+            },
+            "shipping": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR"
+            }
+        }
+    ],
+    "update": [
+        {
+            "id": 26,
+            "billing": {
+                "phone": "(11) 1111-1111"
+            }
+        }
+    ],
+    "delete": [
+        25
+    ]
+}
+
+print(wcapi.post("customers/batch", data).json())
+
data = {
+  create: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ],
+  update: [
+    {
+      id: 26,
+      billing: {
+        phone: "(11) 1111-1111"
+      }
+    }
+  ],
+  delete: [
+    25
+  ]
+}
+
+woocommerce.post("customers/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 27,
+      "date_created": "2017-03-21T16:13:58",
+      "date_created_gmt": "2017-03-21T19:13:58",
+      "date_modified": "2017-03-21T16:13:59",
+      "date_modified_gmt": "2017-03-21T19:13:59",
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "role": "customer",
+      "username": "john.doe2",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "is_paying_customer": false,
+      "avatar_url": "https://secure.gravatar.com/avatar/6ad0b094bac53a85bb282ccdb3958279?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers/27"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers"
+          }
+        ]
+      }
+    },
+    {
+      "id": 28,
+      "date_created": "2017-03-21T16:14:00",
+      "date_created_gmt": "2017-03-21T19:14:00",
+      "date_modified": "2017-03-21T16:14:01",
+      "date_modified_gmt": "2017-03-21T19:14:01",
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "role": "customer",
+      "username": "joao.silva2",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "is_paying_customer": false,
+      "avatar_url": "https://secure.gravatar.com/avatar/ea9ad095f2970f27cbff07e7f5e99453?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers/28"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 26,
+      "date_created": "2017-03-21T16:11:14",
+      "date_created_gmt": "2017-03-21T19:11:14",
+      "date_modified": "2017-03-21T16:14:03",
+      "date_modified_gmt": "2017-03-21T19:14:03",
+      "email": "joao.silva@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "role": "customer",
+      "username": "joao.silva",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(11) 1111-1111"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "is_paying_customer": false,
+      "avatar_url": "https://secure.gravatar.com/avatar/be7b5febff88a2d947c3289e90cdf017?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers/26"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 25,
+      "date_created": "2017-03-21T16:09:28",
+      "date_created_gmt": "2017-03-21T19:09:28",
+      "date_modified": "2017-03-21T16:12:28",
+      "date_modified_gmt": "2017-03-21T19:12:28",
+      "email": "john.doe@example.com",
+      "first_name": "James",
+      "last_name": "Doe",
+      "role": "customer",
+      "username": "john.doe",
+      "billing": {
+        "first_name": "James",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "James",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "is_paying_customer": false,
+      "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers/25"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve customer downloads

+

This API lets you retrieve customer downloads permissions.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/customers/<id>/downloads
+
+
+
curl https://example.com/wp-json/wc/v3/customers/26/downloads \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers/26/downloads")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers/26/downloads')); ?>
+
print(wcapi.get("customers/26/downloads").json())
+
woocommerce.get("customers/26/downloads").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "download_id": "91447fd1849316bbc89dfb7e986a6006",
+    "download_url": "https://example.com/?download_file=87&order=wc_order_58d17c18352&email=joao.silva%40example.com&key=91447fd1849316bbc89dfb7e986a6006",
+    "product_id": 87,
+    "product_name": "Woo Album #2",
+    "download_name": "Woo Album #2 &ndash; Song 2",
+    "order_id": 723,
+    "order_key": "wc_order_58d17c18352",
+    "downloads_remaining": "3",
+    "access_expires": "never",
+    "access_expires_gmt": "never",
+    "file": {
+      "name": "Song 2",
+      "file": "http://example.com/wp-content/uploads/woocommerce_uploads/2013/06/Song.mp3"
+    },
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/customers/26/downloads"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/87"
+        }
+      ],
+      "order": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ]
+    }
+  }
+]
+

Customer downloads properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
download_idstringDownload ID (MD5). read-only
download_urlstringDownload file URL. read-only
product_idintegerDownloadable product ID. read-only
product_namestringProduct name. read-only
download_namestringDownloadable file name. read-only
order_idintegerOrder ID. read-only
order_keystringOrder key. read-only
downloads_remainingstringNumber of downloads remaining. read-only
access_expiresstringThe date when download access expires, in the site's timezone. read-only
access_expires_gmtstringThe date when download access expires, as GMT. read-only
fileobjectFile details. read-only See Customers downloads - File properties
+

Customer downloads - File properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringFile name. read-only
filestringFile URL. read-only
+

Orders

+

The orders API allows you to create, view, update, and delete individual, or a batch, of orders.

+

Order properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
parent_idintegerParent order ID.
numberstringOrder number. read-only
order_keystringOrder key. read-only
created_viastringShows where the order was created. read-only
versionstringVersion of WooCommerce which last updated the order. read-only
statusstringOrder status. Options: pending, processing, on-hold, completed, cancelled, refunded, failed and trash. Default is pending.
currencystringCurrency the order was created with, in ISO format. Options: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTC, BTN, BWP, BYR, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, IRT, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PRB, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR and ZMW. Default is USD.
date_createddate-timeThe date the order was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order was created, as GMT. read-only
date_modifieddate-timeThe date the order was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the order was last modified, as GMT. read-only
discount_totalstringTotal discount amount for the order. read-only
discount_taxstringTotal discount tax amount for the order. read-only
shipping_totalstringTotal shipping amount for the order. read-only
shipping_taxstringTotal shipping tax amount for the order. read-only
cart_taxstringSum of line item taxes only. read-only
totalstringGrand total. read-only
total_taxstringSum of all taxes. read-only
prices_include_taxbooleanTrue the prices included tax during checkout. read-only
customer_idintegerUser ID who owns the order. 0 for guests. Default is 0.
customer_ip_addressstringCustomer's IP address. read-only
customer_user_agentstringUser agent of the customer. read-only
customer_notestringNote left by customer during checkout.
billingobjectBilling address. See Order - Billing properties
shippingobjectShipping address. See Order - Shipping properties
payment_methodstringPayment method ID.
payment_method_titlestringPayment method title.
transaction_idstringUnique transaction ID.
date_paiddate-timeThe date the order was paid, in the site's timezone. read-only
date_paid_gmtdate-timeThe date the order was paid, as GMT. read-only
date_completeddate-timeThe date the order was completed, in the site's timezone. read-only
date_completed_gmtdate-timeThe date the order was completed, as GMT. read-only
cart_hashstringMD5 hash of cart items to ensure orders are not modified. read-only
meta_dataarrayMeta data. See Order - Meta data properties
line_itemsarrayLine items data. See Order - Line items properties
tax_linesarrayTax lines data. See Order - Tax lines properties read-only
shipping_linesarrayShipping lines data. See Order - Shipping lines properties
fee_linesarrayFee lines data. See Order - Fee lines properties
coupon_linesarrayCoupons line data. See Order - Coupon lines properties
refundsarrayList of refunds. See Order - Refunds properties read-only
set_paidbooleanDefine if the order is paid. It will set the status to processing and reduce stock items. Default is false. write-only
+

Order - Billing properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringCountry code in ISO 3166-1 alpha-2 format.
emailstringEmail address.
phonestringPhone number.
+

Order - Shipping properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringCountry code in ISO 3166-1 alpha-2 format.
+

Order - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Order - Line items properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringProduct name.
product_idintegerProduct ID.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classstringSlug of the tax class of product.
subtotalstringLine subtotal (before discounts).
subtotal_taxstringLine subtotal tax (before discounts). read-only
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order - Taxes properties read-only
meta_dataarrayMeta data. See Order - Meta data properties
skustringProduct SKU. read-only
pricestringProduct price. read-only
+

Order - Tax lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
rate_codestringTax rate code. read-only
rate_idstringTax rate ID. read-only
labelstringTax rate label. read-only
compoundbooleanShow if is a compound tax rate. read-only
tax_totalstringTax total (not including shipping taxes). read-only
shipping_tax_totalstringShipping tax total. read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Shipping lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
method_titlestringShipping method name.
method_idstringShipping method ID.
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order - Taxes properties read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Fee lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringFee name.
tax_classstringTax class of fee.
tax_statusstringTax status of fee. Options: taxable and none.
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order - Taxes properties read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Coupon lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
codestringCoupon code.
discountstringDiscount total. read-only
discount_taxstringDiscount total tax. read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Refunds properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerRefund ID. read-only
reasonstringRefund reason. read-only
totalstringRefund total. read-only
+

Order - Taxes properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
rate_codestringTax rate code. read-only
rate_idstringTax rate ID. read-only
labelstringTax rate label. read-only
compoundbooleanShow if is a compound tax rate. read-only
tax_totalstringTax total (not including shipping taxes). read-only
shipping_tax_totalstringShipping tax total. read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Create an order

+

This API helps you to create a new order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/orders
+
+
+ +
+

Example of create a paid order:

+
+
curl -X POST https://example.com/wp-json/wc/v3/orders \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "set_paid": true,
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "line_items": [
+    {
+      "product_id": 93,
+      "quantity": 2
+    },
+    {
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1
+    }
+  ],
+  "shipping_lines": [
+    {
+      "method_id": "flat_rate",
+      "method_title": "Flat Rate",
+      "total": "10.00"
+    }
+  ]
+}'
+
const data = {
+  payment_method: "bacs",
+  payment_method_title: "Direct Bank Transfer",
+  set_paid: true,
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  },
+  line_items: [
+    {
+      product_id: 93,
+      quantity: 2
+    },
+    {
+      product_id: 22,
+      variation_id: 23,
+      quantity: 1
+    }
+  ],
+  shipping_lines: [
+    {
+      method_id: "flat_rate",
+      method_title: "Flat Rate",
+      total: "10.00"
+    }
+  ]
+};
+
+WooCommerce.post("orders", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'payment_method' => 'bacs',
+    'payment_method_title' => 'Direct Bank Transfer',
+    'set_paid' => true,
+    'billing' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US',
+        'email' => 'john.doe@example.com',
+        'phone' => '(555) 555-5555'
+    ],
+    'shipping' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US'
+    ],
+    'line_items' => [
+        [
+            'product_id' => 93,
+            'quantity' => 2
+        ],
+        [
+            'product_id' => 22,
+            'variation_id' => 23,
+            'quantity' => 1
+        ]
+    ],
+    'shipping_lines' => [
+        [
+            'method_id' => 'flat_rate',
+            'method_title' => 'Flat Rate',
+            'total' => '10.00'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('orders', $data));
+?>
+
data = {
+    "payment_method": "bacs",
+    "payment_method_title": "Direct Bank Transfer",
+    "set_paid": True,
+    "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+    },
+    "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+    },
+    "line_items": [
+        {
+            "product_id": 93,
+            "quantity": 2
+        },
+        {
+            "product_id": 22,
+            "variation_id": 23,
+            "quantity": 1
+        }
+    ],
+    "shipping_lines": [
+        {
+            "method_id": "flat_rate",
+            "method_title": "Flat Rate",
+            "total": "10.00"
+        }
+    ]
+}
+
+print(wcapi.post("orders", data).json())
+
data = {
+  payment_method: "bacs",
+  payment_method_title: "Direct Bank Transfer",
+  set_paid: true,
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  },
+  line_items: [
+    {
+      product_id: 93,
+      quantity: 2
+    },
+    {
+      product_id: 22,
+      variation_id: 23,
+      quantity: 1
+    }
+  ],
+  shipping_lines: [
+    {
+      method_id: "flat_rate",
+      method_title: "Flat Rate",
+      total: "10.00"
+    }
+  ]
+}
+
+woocommerce.post("orders", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "processing",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:28:08",
+  "date_modified_gmt": "2017-03-22T19:28:08",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": null,
+  "date_completed_gmt": null,
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders"
+      }
+    ]
+  }
+}
+

Retrieve an order

+

This API lets you retrieve and view a specific order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/orders/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/orders/727 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/727")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/727')); ?>
+
print(wcapi.get("orders/727").json())
+
woocommerce.get("orders/727").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "processing",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:28:08",
+  "date_modified_gmt": "2017-03-22T19:28:08",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": null,
+  "date_completed_gmt": null,
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
dpstringNumber of decimal points to use in each resource.
+

List all orders

+

This API helps you to view all the orders.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/orders
+
+
+
curl https://example.com/wp-json/wc/v3/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders')); ?>
+
print(wcapi.get("orders").json())
+
woocommerce.get("orders").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 727,
+    "parent_id": 0,
+    "number": "727",
+    "order_key": "wc_order_58d2d042d1d",
+    "created_via": "rest-api",
+    "version": "3.0.0",
+    "status": "processing",
+    "currency": "USD",
+    "date_created": "2017-03-22T16:28:02",
+    "date_created_gmt": "2017-03-22T19:28:02",
+    "date_modified": "2017-03-22T16:28:08",
+    "date_modified_gmt": "2017-03-22T19:28:08",
+    "discount_total": "0.00",
+    "discount_tax": "0.00",
+    "shipping_total": "10.00",
+    "shipping_tax": "0.00",
+    "cart_tax": "1.35",
+    "total": "29.35",
+    "total_tax": "1.35",
+    "prices_include_tax": false,
+    "customer_id": 0,
+    "customer_ip_address": "",
+    "customer_user_agent": "",
+    "customer_note": "",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "payment_method": "bacs",
+    "payment_method_title": "Direct Bank Transfer",
+    "transaction_id": "",
+    "date_paid": "2017-03-22T16:28:08",
+    "date_paid_gmt": "2017-03-22T19:28:08",
+    "date_completed": null,
+    "date_completed_gmt": null,
+    "cart_hash": "",
+    "meta_data": [
+      {
+        "id": 13106,
+        "key": "_download_permissions_granted",
+        "value": "yes"
+      },
+      {
+        "id": 13109,
+        "key": "_order_stock_reduced",
+        "value": "yes"
+      }
+    ],
+    "line_items": [
+      {
+        "id": 315,
+        "name": "Woo Single #1",
+        "product_id": 93,
+        "variation_id": 0,
+        "quantity": 2,
+        "tax_class": "",
+        "subtotal": "6.00",
+        "subtotal_tax": "0.45",
+        "total": "6.00",
+        "total_tax": "0.45",
+        "taxes": [
+          {
+            "id": 75,
+            "total": "0.45",
+            "subtotal": "0.45"
+          }
+        ],
+        "meta_data": [],
+        "sku": "",
+        "price": 3
+      },
+      {
+        "id": 316,
+        "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+        "product_id": 22,
+        "variation_id": 23,
+        "quantity": 1,
+        "tax_class": "",
+        "subtotal": "12.00",
+        "subtotal_tax": "0.90",
+        "total": "12.00",
+        "total_tax": "0.90",
+        "taxes": [
+          {
+            "id": 75,
+            "total": "0.9",
+            "subtotal": "0.9"
+          }
+        ],
+        "meta_data": [
+          {
+            "id": 2095,
+            "key": "pa_color",
+            "value": "black"
+          },
+          {
+            "id": 2096,
+            "key": "size",
+            "value": "M Test"
+          }
+        ],
+        "sku": "Bar3",
+        "price": 12
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 318,
+        "rate_code": "US-CA-STATE TAX",
+        "rate_id": 75,
+        "label": "State Tax",
+        "compound": false,
+        "tax_total": "1.35",
+        "shipping_tax_total": "0.00",
+        "meta_data": []
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 317,
+        "method_title": "Flat Rate",
+        "method_id": "flat_rate",
+        "total": "10.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": []
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "refunds": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/727"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders"
+        }
+      ]
+    }
+  },
+  {
+    "id": 723,
+    "parent_id": 0,
+    "number": "723",
+    "order_key": "wc_order_58d17c18352",
+    "created_via": "checkout",
+    "version": "3.0.0",
+    "status": "completed",
+    "currency": "USD",
+    "date_created": "2017-03-21T16:16:00",
+    "date_created_gmt": "2017-03-21T19:16:00",
+    "date_modified": "2017-03-21T16:54:51",
+    "date_modified_gmt": "2017-03-21T19:54:51",
+    "discount_total": "0.00",
+    "discount_tax": "0.00",
+    "shipping_total": "10.00",
+    "shipping_tax": "0.00",
+    "cart_tax": "0.00",
+    "total": "39.00",
+    "total_tax": "0.00",
+    "prices_include_tax": false,
+    "customer_id": 26,
+    "customer_ip_address": "127.0.0.1",
+    "customer_user_agent": "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:52.0) gecko/20100101 firefox/52.0",
+    "customer_note": "",
+    "billing": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR",
+      "email": "joao.silva@example.com",
+      "phone": "(11) 1111-1111"
+    },
+    "shipping": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR"
+    },
+    "payment_method": "bacs",
+    "payment_method_title": "Direct bank transfer",
+    "transaction_id": "",
+    "date_paid": null,
+    "date_paid_gmt": null,
+    "date_completed": "2017-03-21T16:54:51",
+    "date_completed_gmt": "2017-03-21T19:54:51",
+    "cart_hash": "5040ce7273261e31d8bcf79f9be3d279",
+    "meta_data": [
+      {
+        "id": 13023,
+        "key": "_download_permissions_granted",
+        "value": "yes"
+      }
+    ],
+    "line_items": [
+      {
+        "id": 311,
+        "name": "Woo Album #2",
+        "product_id": 87,
+        "variation_id": 0,
+        "quantity": 1,
+        "tax_class": "",
+        "subtotal": "9.00",
+        "subtotal_tax": "0.00",
+        "total": "9.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [],
+        "sku": "",
+        "price": 9
+      },
+      {
+        "id": 313,
+        "name": "Woo Ninja",
+        "product_id": 34,
+        "variation_id": 0,
+        "quantity": 1,
+        "tax_class": "",
+        "subtotal": "20.00",
+        "subtotal_tax": "0.00",
+        "total": "20.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [],
+        "sku": "",
+        "price": 20
+      }
+    ],
+    "tax_lines": [],
+    "shipping_lines": [
+      {
+        "id": 312,
+        "method_title": "Flat rate",
+        "method_id": "flat_rate:25",
+        "total": "10.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [
+          {
+            "id": 2057,
+            "key": "Items",
+            "value": "Woo Album #2 &times; 1"
+          }
+        ]
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "refunds": [
+      {
+        "id": 726,
+        "refund": "",
+        "total": "-10.00"
+      },
+      {
+        "id": 724,
+        "refund": "",
+        "total": "-9.00"
+      }
+    ],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders"
+        }
+      ],
+      "customer": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/customers/26"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
modified_afterstringLimit response to resources modified after a given ISO8601 compliant date.
modified_beforestringLimit response to resources modified after a given ISO8601 compliant date.
dates_are_gmtbooleanWhether to consider GMT post dates when limiting response by published or modified date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
statusarrayLimit result set to orders assigned a specific status. Options: any, pending, processing, on-hold, completed, cancelled, refunded, failed and trash. Default is any.
customerintegerLimit result set to orders assigned a specific customer.
productintegerLimit result set to orders assigned a specific product.
dpintegerNumber of decimal points to use in each resource. Default is 2.
+

Update an Order

+

This API lets you make changes to an order.

+

HTTP Request

+
+
+ PUT +
/wp-json/wc/v3/orders/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/orders/727 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "status": "completed"
+}'
+
const data = {
+  status: "completed"
+};
+
+WooCommerce.put("orders/727", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'status' => 'completed'
+];
+
+print_r($woocommerce->put('orders/727', $data));
+?>
+
data = {
+    "status": "completed"
+}
+
+print(wcapi.put("orders/727", data).json())
+
data = {
+  status: "completed"
+}
+
+woocommerce.put("orders/727", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "completed",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:30:35",
+  "date_modified_gmt": "2017-03-22T19:30:35",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": "2017-03-22T16:30:35",
+  "date_completed_gmt": "2017-03-22T19:30:35",
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    },
+    {
+      "id": 13109,
+      "key": "_order_stock_reduced",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders"
+      }
+    ]
+  }
+}
+

Delete an order

+

This API helps you delete an order.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/orders/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/orders/727?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/727", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/727', ['force' => true])); ?>
+
print(wcapi.delete("orders/727", params={"force": True}).json())
+
woocommerce.delete("orders/727", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "completed",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:30:35",
+  "date_modified_gmt": "2017-03-22T19:30:35",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": "2017-03-22T16:30:35",
+  "date_completed_gmt": "2017-03-22T19:30:35",
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    },
+    {
+      "id": 13109,
+      "key": "_order_stock_reduced",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the order, Default is false.
+

Batch update orders

+

This API helps you to batch create, update and delete multiple orders.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/orders/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/orders/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "line_items": [
+        {
+          "product_id": 79,
+          "quantity": 1
+        },
+        {
+          "product_id": 93,
+          "quantity": 1
+        },
+        {
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1
+        }
+      ],
+      "shipping_lines": [
+        {
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "30.00"
+        }
+      ]
+    },
+    {
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "set_paid": true,
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "line_items": [
+        {
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1
+        },
+        {
+          "product_id": 22,
+          "variation_id": 24,
+          "quantity": 1
+        }
+      ],
+      "shipping_lines": [
+        {
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "20.00"
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 727,
+      "shipping_methods": "Local Delivery"
+    }
+  ],
+  "delete": [
+    723
+  ]
+}'
+
const data = {
+  create: [
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 79,
+          quantity: 1
+        },
+        {
+          product_id: 93,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "30.00"
+        }
+      ]
+    },
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      set_paid: true,
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 24,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "20.00"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 727,
+      shipping_methods: "Local Delivery"
+    }
+  ],
+  delete: [
+    723
+  ]
+};
+
+WooCommerce.post("orders/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'payment_method' => 'bacs',
+            'payment_method_title' => 'Direct Bank Transfer',
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ],
+            'line_items' => [
+                [
+                    'product_id' => 79,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 93,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 22,
+                    'variation_id' => 23,
+                    'quantity' => 1
+                ]
+            ],
+            'shipping_lines' => [
+                [
+                    'method_id' => 'flat_rate',
+                    'method_title' => 'Flat Rate',
+                    'total' => '30.00'
+                ]
+            ]
+        ],
+        [
+            'payment_method' => 'bacs',
+            'payment_method_title' => 'Direct Bank Transfer',
+            'set_paid' => true,
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ],
+            'line_items' => [
+                [
+                    'product_id' => 22,
+                    'variation_id' => 23,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 22,
+                    'variation_id' => 24,
+                    'quantity' => 1
+                ]
+            ],
+            'shipping_lines' => [
+                [
+                    'method_id' => 'flat_rate',
+                    'method_title' => 'Flat Rate',
+                    'total' => '20.00'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 727,
+            'shipping_methods' => 'Local Delivery'
+        ]
+    ],
+    'delete' => [
+        723
+    ]
+];
+
+print_r($woocommerce->post('orders/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "payment_method": "bacs",
+            "payment_method_title": "Direct Bank Transfer",
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            },
+            "line_items": [
+                {
+                    "product_id": 79,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 93,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 22,
+                    "variation_id": 23,
+                    "quantity": 1
+                }
+            ],
+            "shipping_lines": [
+                {
+                    "method_id": "flat_rate",
+                    "method_title": "Flat Rate",
+                    "total": "30.00"
+                }
+            ]
+        },
+        {
+            "payment_method": "bacs",
+            "payment_method_title": "Direct Bank Transfer",
+            "set_paid": True,
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            },
+            "line_items": [
+                {
+                    "product_id": 22,
+                    "variation_id": 23,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 22,
+                    "variation_id": 24,
+                    "quantity": 1
+                }
+            ],
+            "shipping_lines": [
+                {
+                    "method_id": "flat_rate",
+                    "method_title": "Flat Rate",
+                    "total": "20.00"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 727,
+            "shipping_methods": "Local Delivery"
+        }
+    ],
+    "delete": [
+        723
+    ]
+}
+
+print(wcapi.post("orders/batch", data).json())
+
data = {
+  create: [
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 79,
+          quantity: 1
+        },
+        {
+          product_id: 93,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "30.00"
+        }
+      ]
+    },
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      set_paid: true,
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 24,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "20.00"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 727,
+      shipping_methods: "Local Delivery"
+    }
+  ],
+  delete: [
+    723
+  ]
+}
+
+woocommerce.post("orders/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 728,
+      "parent_id": 0,
+      "number": "728",
+      "order_key": "wc_order_58d2d18e580",
+      "created_via": "rest-api",
+      "version": "3.0.0",
+      "status": "pending",
+      "currency": "USD",
+      "date_created": "2017-03-22T16:33:34",
+      "date_created_gmt": "2017-03-22T19:33:34",
+      "date_modified": "2017-03-22T16:33:34",
+      "date_modified_gmt": "2017-03-22T19:33:34",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "30.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "2.25",
+      "total": "62.25",
+      "total_tax": "2.25",
+      "prices_include_tax": false,
+      "customer_id": 0,
+      "customer_ip_address": "",
+      "customer_user_agent": "",
+      "customer_note": "",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "transaction_id": "",
+      "date_paid": null,
+      "date_paid_gmt": null,
+      "date_completed": null,
+      "date_completed_gmt": null,
+      "cart_hash": "",
+      "meta_data": [],
+      "line_items": [
+        {
+          "id": 319,
+          "name": "Woo Logo",
+          "product_id": 79,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "15.00",
+          "subtotal_tax": "1.13",
+          "total": "15.00",
+          "total_tax": "1.13",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "1.125",
+              "subtotal": "1.125"
+            }
+          ],
+          "meta_data": [],
+          "sku": "",
+          "price": 15
+        },
+        {
+          "id": 320,
+          "name": "Woo Single #1",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "3.00",
+          "subtotal_tax": "0.23",
+          "total": "3.00",
+          "total_tax": "0.23",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.225",
+              "subtotal": "0.225"
+            }
+          ],
+          "meta_data": [],
+          "sku": "",
+          "price": 3
+        },
+        {
+          "id": 321,
+          "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "12.00",
+          "subtotal_tax": "0.90",
+          "total": "12.00",
+          "total_tax": "0.90",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.9",
+              "subtotal": "0.9"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2133,
+              "key": "pa_color",
+              "value": "black"
+            },
+            {
+              "id": 2134,
+              "key": "size",
+              "value": "M Test"
+            }
+          ],
+          "sku": "Bar3",
+          "price": 12
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 323,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": 75,
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "2.25",
+          "shipping_tax_total": "0.00",
+          "meta_data": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 322,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "30.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders/728"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders"
+          }
+        ]
+      }
+    },
+    {
+      "id": 729,
+      "parent_id": 0,
+      "number": "729",
+      "order_key": "wc_order_58d2d196171",
+      "created_via": "rest-api",
+      "version": "3.0.0",
+      "status": "processing",
+      "currency": "USD",
+      "date_created": "2017-03-22T16:33:42",
+      "date_created_gmt": "2017-03-22T19:33:42",
+      "date_modified": "2017-03-22T16:33:47",
+      "date_modified_gmt": "2017-03-22T19:33:47",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "20.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "2.40",
+      "total": "54.40",
+      "total_tax": "2.40",
+      "prices_include_tax": false,
+      "customer_id": 0,
+      "customer_ip_address": "",
+      "customer_user_agent": "",
+      "customer_note": "",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "transaction_id": "",
+      "date_paid": "2017-03-22T16:33:47",
+      "date_paid_gmt": "2017-03-22T19:33:47",
+      "date_completed": null,
+      "date_completed_gmt": null,
+      "cart_hash": "",
+      "meta_data": [
+        {
+          "id": 13198,
+          "key": "_download_permissions_granted",
+          "value": "yes"
+        }
+      ],
+      "line_items": [
+        {
+          "id": 324,
+          "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "12.00",
+          "subtotal_tax": "0.90",
+          "total": "12.00",
+          "total_tax": "0.90",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.9",
+              "subtotal": "0.9"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2153,
+              "key": "pa_color",
+              "value": "black"
+            },
+            {
+              "id": 2154,
+              "key": "size",
+              "value": "M Test"
+            }
+          ],
+          "sku": "Bar3",
+          "price": 12
+        },
+        {
+          "id": 325,
+          "name": "Ship Your Idea &ndash; Color: Green, Size: S Test",
+          "product_id": 22,
+          "variation_id": 24,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "1.5",
+              "subtotal": "1.5"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2164,
+              "key": "pa_color",
+              "value": "green"
+            },
+            {
+              "id": 2165,
+              "key": "size",
+              "value": "S Test"
+            }
+          ],
+          "sku": "",
+          "price": 20
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 327,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": 75,
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "2.40",
+          "shipping_tax_total": "0.00",
+          "meta_data": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 326,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders/729"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 727,
+      "parent_id": 0,
+      "number": "727",
+      "order_key": "wc_order_58d2d042d1d",
+      "created_via": "rest-api",
+      "version": "3.0.0",
+      "status": "completed",
+      "currency": "USD",
+      "date_created": "2017-03-22T16:28:02",
+      "date_created_gmt": "2017-03-22T19:28:02",
+      "date_modified": "2017-03-22T16:30:35",
+      "date_modified_gmt": "2017-03-22T19:30:35",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "10.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "1.35",
+      "total": "29.35",
+      "total_tax": "1.35",
+      "prices_include_tax": false,
+      "customer_id": 0,
+      "customer_ip_address": "",
+      "customer_user_agent": "",
+      "customer_note": "",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "transaction_id": "",
+      "date_paid": "2017-03-22T16:28:08",
+      "date_paid_gmt": "2017-03-22T19:28:08",
+      "date_completed": "2017-03-22T16:30:35",
+      "date_completed_gmt": "2017-03-22T19:30:35",
+      "cart_hash": "",
+      "meta_data": [
+        {
+          "id": 13106,
+          "key": "_download_permissions_granted",
+          "value": "yes"
+        },
+        {
+          "id": 13109,
+          "key": "_order_stock_reduced",
+          "value": "yes"
+        }
+      ],
+      "line_items": [
+        {
+          "id": 315,
+          "name": "Woo Single #1",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 2,
+          "tax_class": "",
+          "subtotal": "6.00",
+          "subtotal_tax": "0.45",
+          "total": "6.00",
+          "total_tax": "0.45",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.45",
+              "subtotal": "0.45"
+            }
+          ],
+          "meta_data": [],
+          "sku": "",
+          "price": 3
+        },
+        {
+          "id": 316,
+          "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "12.00",
+          "subtotal_tax": "0.90",
+          "total": "12.00",
+          "total_tax": "0.90",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.9",
+              "subtotal": "0.9"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2095,
+              "key": "pa_color",
+              "value": "black"
+            },
+            {
+              "id": 2096,
+              "key": "size",
+              "value": "M Test"
+            }
+          ],
+          "sku": "Bar3",
+          "price": 12
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 318,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": 75,
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "1.35",
+          "shipping_tax_total": "0.00",
+          "meta_data": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 317,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "10.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders/727"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 723,
+      "parent_id": 0,
+      "number": "723",
+      "order_key": "wc_order_58d17c18352",
+      "created_via": "checkout",
+      "version": "3.0.0",
+      "status": "completed",
+      "currency": "USD",
+      "date_created": "2017-03-21T16:16:00",
+      "date_created_gmt": "2017-03-21T19:16:00",
+      "date_modified": "2017-03-21T16:54:51",
+      "date_modified_gmt": "2017-03-21T19:54:51",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "10.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "0.00",
+      "total": "39.00",
+      "total_tax": "0.00",
+      "prices_include_tax": false,
+      "customer_id": 26,
+      "customer_ip_address": "127.0.0.1",
+      "customer_user_agent": "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:52.0) gecko/20100101 firefox/52.0",
+      "customer_note": "",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(11) 1111-1111"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct bank transfer",
+      "transaction_id": "",
+      "date_paid": null,
+      "date_paid_gmt": null,
+      "date_completed": "2017-03-21T16:54:51",
+      "date_completed_gmt": "2017-03-21T19:54:51",
+      "cart_hash": "5040ce7273261e31d8bcf79f9be3d279",
+      "meta_data": [
+        {
+          "id": 13023,
+          "key": "_download_permissions_granted",
+          "value": "yes"
+        }
+      ],
+      "line_items": [
+        {
+          "id": 311,
+          "name": "Woo Album #2",
+          "product_id": 87,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "9.00",
+          "subtotal_tax": "0.00",
+          "total": "9.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": [],
+          "sku": "",
+          "price": 9
+        },
+        {
+          "id": 313,
+          "name": "Woo Ninja",
+          "product_id": 34,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "20.00",
+          "subtotal_tax": "0.00",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": [],
+          "sku": "",
+          "price": 20
+        }
+      ],
+      "tax_lines": [],
+      "shipping_lines": [
+        {
+          "id": 312,
+          "method_title": "Flat rate",
+          "method_id": "flat_rate:25",
+          "total": "10.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": [
+            {
+              "id": 2057,
+              "key": "Items",
+              "value": "Woo Album #2 &times; 1"
+            }
+          ]
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [
+        {
+          "id": 726,
+          "refund": "",
+          "total": "-10.00"
+        },
+        {
+          "id": 724,
+          "refund": "",
+          "total": "-9.00"
+        }
+      ],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders/723"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/orders"
+          }
+        ],
+        "customer": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/customers/26"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Order notes

+

The order notes API allows you to create, view, and delete individual order notes.
+Order notes are added by administrators and programmatically to store data about an order, or order events.

+

Order note properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
authorstringOrder note author. read-only
date_createddate-timeThe date the order note was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order note was created, as GMT. read-only
notestringOrder note content. mandatory
customer_notebooleanIf true, the note will be shown to customers and they will be notified. If false, the note will be for admin reference only. Default is false.
added_by_userbooleanIf true, this note will be attributed to the current user. If false, the note will be attributed to the system. Default is false.
+

Create an order note

+

This API helps you to create a new note for an order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/orders/<id>/notes
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/orders/723/notes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "note": "Order ok!!!"
+}'
+
const data = {
+  note: "Order ok!!!"
+};
+
+WooCommerce.post("orders/723/notes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'note' => 'Order ok!!!'
+];
+
+print_r($woocommerce->post('orders/723/notes', $data));
+?>
+
data = {
+    "note": "Order ok!!!"
+}
+
+print(wcapi.post("orders/723/notes", data).json())
+
data = {
+  note: "Order ok!!!"
+}
+
+woocommerce.post("orders/723/notes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 281,
+  "author": "system",
+  "date_created": "2017-03-21T16:46:41",
+  "date_created_gmt": "2017-03-21T19:46:41",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/notes/281"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723"
+      }
+    ]
+  }
+}
+

Retrieve an order note

+

This API lets you retrieve and view a specific note from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/orders/<id>/notes/<note_id>
+
+
+
curl https://example.com/wp-json/wc/v3/orders/723/notes/281 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/notes/281")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/notes/281')); ?>
+
print(wcapi.get("orders/723/notes/281").json())
+
woocommerce.get("orders/723/notes/281").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 281,
+  "author": "system",
+  "date_created": "2017-03-21T16:46:41",
+  "date_created_gmt": "2017-03-21T19:46:41",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/notes/281"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723"
+      }
+    ]
+  }
+}
+

List all order notes

+

This API helps you to view all the notes from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/orders/<id>/notes
+
+
+
curl https://example.com/wp-json/wc/v3/orders/723/notes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/notes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/notes')); ?>
+
print(wcapi.get("orders/723/notes").json())
+
woocommerce.get("orders/723/notes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 281,
+    "author": "system",
+    "date_created": "2017-03-21T16:46:41",
+    "date_created_gmt": "2017-03-21T19:46:41",
+    "note": "Order ok!!!",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/notes/281"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ]
+    }
+  },
+  {
+    "id": 280,
+    "author": "system",
+    "date_created": "2017-03-21T16:16:58",
+    "date_created_gmt": "2017-03-21T19:16:58",
+    "note": "Order status changed from On hold to Completed.",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/notes/280"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ]
+    }
+  },
+  {
+    "id": 279,
+    "author": "system",
+    "date_created": "2017-03-21T16:16:46",
+    "date_created_gmt": "2017-03-21T19:16:46",
+    "note": "Awaiting BACS payment Order status changed from Pending payment to On hold.",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/notes/279"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
typestringLimit result to customers or internal notes. Options: any, customer and internal. Default is any.
+

Delete an order note

+

This API helps you delete an order note.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/orders/<id>/notes/<note_id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/orders/723/notes/281?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/723/notes/281", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/723/notes/281', ['force' => true])); ?>
+
print(wcapi.delete("orders/723/notes/281", params={"force": True}).json())
+
woocommerce.delete("orders/723/notes/281", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 281,
+  "author": "system",
+  "date_created": "2017-03-21T16:46:41",
+  "date_created_gmt": "2017-03-21T19:46:41",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/notes/281"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Refunds

+

The refunds API allows you to create, view, and delete individual refunds.

+

Order refund properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the order refund was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order refund was created, as GMT. read-only
amountstringTotal refund amount. Optional. If this parameter is provided, it will take precedence over line item totals, even when total of line items does not matches with this amount.
reasonstringReason for refund.
refunded_byintegerUser ID of user who created the refund.
refunded_paymentbooleanIf the payment was refunded via the API. See api_refund. read-only
meta_dataarrayMeta data. See Order refund - Meta data properties
line_itemsarrayLine items data. See Order refund - Line items properties
api_refundbooleanWhen true, the payment gateway API is used to generate the refund. Default is true. write-only
api_restockbooleanWhen true, the selected line items are restocked Default is true. write-only
+

Order refund - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Order refund - Line items properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringProduct name.
product_idintegerProduct ID.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classintegerTax class of product.
subtotalstringLine subtotal (before discounts).
subtotal_taxstringLine subtotal tax (before discounts). read-only
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order refund line item - Taxes properties read-only
meta_dataarrayMeta data. See Order refund - Meta data properties
skustringProduct SKU. read-only
pricestringProduct price. read-only
refund_totalnumberThe amount to refund for this line item, excluding taxes. write-only
+

Order refund line item - Taxes properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTax rate ID. read-only
totalstringTax total. read-only
subtotalstringTax subtotal. read-only
refund_totalnumberThe amount to refund for this tax. write-only
+

Create a refund

+

This API helps you to create a new refund for an order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/orders/<id>/refunds
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/orders/723/refunds \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "amount": "30",  
+  "line_items": [
+    {
+      "id": "111",
+      "refund_total": 10,
+      "refund_tax": [
+        {
+          "id" "222",
+          "refund_total": 20
+        }
+      ]
+    }
+}'
+
const data = {
+    amount: "30",
+    line_items: [
+      {
+         id: "111",
+         refund_total: 10,
+         refund_tax: [
+           {
+             id: "222",
+             refund_total: 20
+           }
+         ]
+      }
+   ]
+};
+
+WooCommerce.post("orders/723/refunds", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+     'amount' => '30',
+     'line_items' => [
+       [
+           'id' => '111',
+           'refund_total' => 10,
+           'refund_tax' => [
+              [
+                 'id' => '222',
+                 'amount' => 20
+              ]
+           ]
+       ]
+     ]
+];
+
+print_r($woocommerce->post('orders/723/refunds', $data));
+?>
+
data = {
+    "amount": "30",
+    "line_items": [
+      {
+         "id": "111",
+         "refund_total": 10,
+         "refund_tax": [
+           {
+             "id" "222",
+             "refund_total": 20
+           }
+         ]
+      }
+   ]
+}
+
+print(wcapi.post("orders/723/refunds", data).json())
+
data = {
+  amount: "30",
+  line_items: [
+    {
+       id: "111",
+       refund_total: 10,
+       refund_tax: [
+         {
+           id "222",
+           refund_total: 20
+         }
+       ]
+    }
+ ]
+}
+
+woocommerce.post("orders/723/refunds", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 726,
+  "date_created": "2017-03-21T17:07:11",
+  "date_created_gmt": "2017-03-21T20:07:11",
+  "amount": "10.00",
+  "reason": "",
+  "refunded_by": 1,
+  "refunded_payment": false,
+  "meta_data": [],
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/726"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723"
+      }
+    ]
+  }
+}
+

Retrieve a refund

+

This API lets you retrieve and view a specific refund from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/orders/<id>/refunds/<refund_id>
+
+
+
curl https://example.com/wp-json/wc/v3/orders/723/refunds/726 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/refunds/726")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/refunds/726')); ?>
+
print(wcapi.get("orders/723/refunds/726").json())
+
woocommerce.get("orders/723/refunds/726").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 726,
+  "date_created": "2017-03-21T17:07:11",
+  "date_created_gmt": "2017-03-21T20:07:11",
+  "amount": "10.00",
+  "reason": "",
+  "refunded_by": 1,
+  "refunded_payment": false,
+  "meta_data": [],
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/726"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
dpstringNumber of decimal points to use in each resource.
+

List all refunds

+

This API helps you to view all the refunds from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/orders/<id>/refunds
+
+
+
curl https://example.com/wp-json/wc/v3/orders/723/refunds \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/refunds")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/refunds')); ?>
+
print(wcapi.get("orders/723/refunds").json())
+
woocommerce.get("orders/723/refunds").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 726,
+    "date_created": "2017-03-21T17:07:11",
+    "date_created_gmt": "2017-03-21T20:07:11",
+    "amount": "10.00",
+    "reason": "",
+    "refunded_by": 1,
+    "refunded_payment": false,
+    "meta_data": [],
+    "line_items": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/726"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/refunds"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ]
+    }
+  },
+  {
+    "id": 724,
+    "date_created": "2017-03-21T16:55:37",
+    "date_created_gmt": "2017-03-21T19:55:37",
+    "amount": "9.00",
+    "reason": "",
+    "refunded_by": 1,
+    "refunded_payment": false,
+    "meta_data": [],
+    "line_items": [
+      {
+        "id": 314,
+        "name": "Woo Album #2",
+        "product_id": 87,
+        "variation_id": 0,
+        "quantity": -1,
+        "tax_class": "",
+        "subtotal": "-9.00",
+        "subtotal_tax": "0.00",
+        "total": "-9.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [
+          {
+            "id": 2076,
+            "key": "_refunded_item_id",
+            "value": "311"
+          }
+        ],
+        "sku": "",
+        "price": -9
+      }
+    ],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/724"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723/refunds"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/orders/723"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
dpintegerNumber of decimal points to use in each resource. Default is 2.
+

Delete a refund

+

This API helps you delete an order refund.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/orders/<id>/refunds/<refund_id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/orders/723/refunds/726?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/723/refunds/726", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/723/refunds/726', ['force' => true])); ?>
+
print(wcapi.delete("orders/723/refunds/726", params={"force": True}).json())
+
woocommerce.delete("orders/723/refunds/726", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 726,
+  "date_created": "2017-03-21T17:07:11",
+  "date_created_gmt": "2017-03-21T20:07:11",
+  "amount": "10.00",
+  "reason": "",
+  "refunded_by": 1,
+  "refunded_payment": false,
+  "meta_data": [],
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/refunds/726"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/orders/723"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Products

+

The products API allows you to create, view, update, and delete individual, or a batch, of products.

+

Product properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringProduct name.
slugstringProduct slug.
permalinkstringProduct URL. read-only
date_createddate-timeThe date the product was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the product was created, as GMT. read-only
date_modifieddate-timeThe date the product was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the product was last modified, as GMT. read-only
typestringProduct type. Options: simple, grouped, external and variable. Default is simple.
statusstringProduct status (post status). Options: draft, pending, private and publish. Default is publish.
featuredbooleanFeatured product. Default is false.
catalog_visibilitystringCatalog visibility. Options: visible, catalog, search and hidden. Default is visible.
descriptionstringProduct description.
short_descriptionstringProduct short description.
skustringUnique identifier.
pricestringCurrent product price. read-only
regular_pricestringProduct regular price.
sale_pricestringProduct sale price.
date_on_sale_fromdate-timeStart date of sale price, in the site's timezone.
date_on_sale_from_gmtdate-timeStart date of sale price, as GMT.
date_on_sale_todate-timeEnd date of sale price, in the site's timezone.
date_on_sale_to_gmtdate-timeEnd date of sale price, as GMT.
price_htmlstringPrice formatted in HTML. read-only
on_salebooleanShows if the product is on sale. read-only
purchasablebooleanShows if the product can be bought. read-only
total_salesintegerAmount of sales. read-only
virtualbooleanIf the product is virtual. Default is false.
downloadablebooleanIf the product is downloadable. Default is false.
downloadsarrayList of downloadable files. See Product - Downloads properties
download_limitintegerNumber of times downloadable files can be downloaded after purchase. Default is -1.
download_expiryintegerNumber of days until access to downloadable files expires. Default is -1.
external_urlstringProduct external URL. Only for external products.
button_textstringProduct external button text. Only for external products.
tax_statusstringTax status. Options: taxable, shipping and none. Default is taxable.
tax_classstringTax class.
manage_stockbooleanStock management at product level. Default is false.
stock_quantityintegerStock quantity.
stock_statusstringControls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock.
backordersstringIf managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.
backorders_allowedbooleanShows if backorders are allowed. read-only
backorderedbooleanShows if the product is on backordered. read-only
sold_individuallybooleanAllow one item to be bought in a single order. Default is false.
weightstringProduct weight.
dimensionsobjectProduct dimensions. See Product - Dimensions properties
shipping_requiredbooleanShows if the product need to be shipped. read-only
shipping_taxablebooleanShows whether or not the product shipping is taxable. read-only
shipping_classstringShipping class slug.
shipping_class_idintegerShipping class ID. read-only
reviews_allowedbooleanAllow reviews. Default is true.
average_ratingstringReviews average rating. read-only
rating_countintegerAmount of reviews that the product have. read-only
related_idsarrayList of related products IDs. read-only
upsell_idsarrayList of up-sell products IDs.
cross_sell_idsarrayList of cross-sell products IDs.
parent_idintegerProduct parent ID.
purchase_notestringOptional note to send the customer after purchase.
categoriesarrayList of categories. See Product - Categories properties
tagsarrayList of tags. See Product - Tags properties
imagesarrayList of images. See Product - Images properties
attributesarrayList of attributes. See Product - Attributes properties
default_attributesarrayDefaults variation attributes. See Product - Default attributes properties
variationsarrayList of variations IDs. read-only
grouped_productsarrayList of grouped products ID.
menu_orderintegerMenu order, used to custom sort products.
meta_dataarrayMeta data. See Product - Meta data properties
+

Product - Downloads properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID.
namestringFile name.
filestringFile URL.
+

Product - Dimensions properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringProduct length.
widthstringProduct width.
heightstringProduct height.
+

Product - Categories properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCategory ID.
namestringCategory name. read-only
slugstringCategory slug. read-only
+

Product - Tags properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTag ID.
namestringTag name. read-only
slugstringTag slug. read-only
+

Product - Images properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the image was created, as GMT. read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the image was last modified, as GMT. read-only
srcstringImage URL.
namestringImage name.
altstringImage alternative text.
+

Product - Attributes properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID.
namestringAttribute name.
positionintegerAttribute position.
visiblebooleanDefine if the attribute is visible on the "Additional information" tab in the product's page. Default is false.
variationbooleanDefine if the attribute can be used as variation. Default is false.
optionsarrayList of available term names of the attribute.
+

Product - Default attributes properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID.
namestringAttribute name.
optionstringSelected attribute term name.
+

Product - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a product

+

This API helps you to create a new product.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products
+
+
+ +
+

Example of how to create a simple product:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Premium Quality",
+  "type": "simple",
+  "regular_price": "21.99",
+  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  "categories": [
+    {
+      "id": 9
+    },
+    {
+      "id": 14
+    }
+  ],
+  "images": [
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+    }
+  ]
+}'
+
const data = {
+  name: "Premium Quality",
+  type: "simple",
+  regular_price: "21.99",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+    }
+  ]
+};
+
+WooCommerce.post("products", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Premium Quality',
+    'type' => 'simple',
+    'regular_price' => '21.99',
+    'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    'categories' => [
+        [
+            'id' => 9
+        ],
+        [
+            'id' => 14
+        ]
+    ],
+    'images' => [
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "name": "Premium Quality",
+    "type": "simple",
+    "regular_price": "21.99",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+        {
+            "id": 9
+        },
+        {
+            "id": 14
+        }
+    ],
+    "images": [
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+        }
+    ]
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  name: "Premium Quality",
+  type: "simple",
+  regular_price: "21.99",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+    }
+  ]
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "21.99",
+  "regular_price": "21.99",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    53,
+    40,
+    56,
+    479,
+    99
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": ""
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products"
+      }
+    ]
+  }
+}
+
+
+

Example of how to create a variable product with global and non-global attributes:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Ship Your Idea",
+  "type": "variable",
+  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  "categories": [
+    {
+      "id": 9
+    },
+    {
+      "id": 14
+    }
+  ],
+  "images": [
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg"
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg"
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg"
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg"
+    }
+  ],
+  "attributes": [
+    {
+      "id": 6,
+      "position": 0,
+      "visible": false,
+      "variation": true,
+      "options": [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      "name": "Size",
+      "position": 0,
+      "visible": true,
+      "variation": true,
+      "options": [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  "default_attributes": [
+    {
+      "id": 6,
+      "option": "Black"
+    },
+    {
+      "name": "Size",
+      "option": "S"
+    }
+  ]
+}'
+
const data = {
+  name: "Ship Your Idea",
+  type: "variable",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg"
+    }
+  ],
+  attributes: [
+    {
+      id: 6,
+      position: 0,
+      visible: true,
+      variation: true,
+      options: [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      name: "Size",
+      position: 0,
+      visible: false,
+      variation: true,
+      options: [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  default_attributes: [
+    {
+      id: 6,
+      option: "Black"
+    },
+    {
+      name: "Size",
+      option: "S"
+    }
+  ]
+};
+
+WooCommerce.post("products", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Ship Your Idea',
+    'type' => 'variable',
+    'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    'categories' => [
+        [
+            'id' => 9
+        ],
+        [
+            'id' => 14
+        ]
+    ],
+    'images' => [
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg'
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg'
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg'
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg'
+        ]
+    ],
+    'attributes' => [
+        [
+            'id' => 6,
+            'position' => 0,
+            'visible' => false,
+            'variation' => true,
+            'options' => [
+                'Black',
+                'Green'
+            ]
+        ],
+        [
+            'name' => 'Size',
+            'position' => 0,
+            'visible' => true,
+            'variation' => true,
+            'options' => [
+                'S',
+                'M'
+            ]
+        ]
+    ],
+    'default_attributes' => [
+        [
+            'id' => 6,
+            'option' => 'Black'
+        ],
+        [
+            'name' => 'Size',
+            'option' => 'S'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "name": "Ship Your Idea",
+    "type": "variable",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+        {
+            "id": 9
+        },
+        {
+            "id": 14
+        }
+    ],
+    "images": [
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg"
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg"
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg"
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg"
+        }
+    ],
+    "attributes": [
+        {
+            "id": 6,
+            "position": 0,
+            "visible": False,
+            "variation": True,
+            "options": [
+                "Black",
+                "Green"
+            ]
+        },
+        {
+            "name": "Size",
+            "position": 0,
+            "visible": True,
+            "variation": True,
+            "options": [
+                "S",
+                "M"
+            ]
+        }
+    ],
+    "default_attributes": [
+        {
+            "id": 6,
+            "option": "Black"
+        },
+        {
+            "name": "Size",
+            "option": "S"
+        }
+    ]
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  name: "Ship Your Idea",
+  type: "variable",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg"
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg"
+    }
+  ],
+  attributes: [
+    {
+      id: 6,
+      position: 0,
+      visible: false,
+      variation: true,
+      options: [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      name: "Size",
+      position: 0,
+      visible: true,
+      variation: true,
+      options: [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  default_attributes: [
+    {
+      id: 6,
+      option: "Black"
+    },
+    {
+      name: "Size",
+      option: "S"
+    }
+  ]
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 799,
+  "name": "Ship Your Idea",
+  "slug": "ship-your-idea-22",
+  "permalink": "https://example.com/product/ship-your-idea-22/",
+  "date_created": "2017-03-23T17:03:12",
+  "date_created_gmt": "2017-03-23T20:03:12",
+  "date_modified": "2017-03-23T17:03:12",
+  "date_modified_gmt": "2017-03-23T20:03:12",
+  "type": "variable",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "",
+  "regular_price": "",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "",
+  "on_sale": false,
+  "purchasable": false,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    472,
+    387,
+    19,
+    53,
+    396
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 795,
+      "date_created": "2017-03-23T14:03:08",
+      "date_created_gmt": "2017-03-23T20:03:08",
+      "date_modified": "2017-03-23T14:03:08",
+      "date_modified_gmt": "2017-03-23T20:03:08",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 796,
+      "date_created": "2017-03-23T14:03:09",
+      "date_created_gmt": "2017-03-23T20:03:09",
+      "date_modified": "2017-03-23T14:03:09",
+      "date_modified_gmt": "2017-03-23T20:03:09",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 797,
+      "date_created": "2017-03-23T14:03:10",
+      "date_created_gmt": "2017-03-23T20:03:10",
+      "date_modified": "2017-03-23T14:03:10",
+      "date_modified_gmt": "2017-03-23T20:03:10",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 798,
+      "date_created": "2017-03-23T14:03:11",
+      "date_created_gmt": "2017-03-23T20:03:11",
+      "date_modified": "2017-03-23T14:03:11",
+      "date_modified_gmt": "2017-03-23T20:03:11",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg",
+      "name": "",
+      "alt": ""
+    }
+  ],
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "position": 0,
+      "visible": false,
+      "variation": true,
+      "options": [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      "id": 0,
+      "name": "Size",
+      "position": 0,
+      "visible": true,
+      "variation": true,
+      "options": [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  "default_attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "black"
+    },
+    {
+      "id": 0,
+      "name": "Size",
+      "option": "S"
+    }
+  ],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/799"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products"
+      }
+    ]
+  }
+}
+

Retrieve a product

+

This API lets you retrieve and view a specific product by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/products/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/794 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/794")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/794')); ?>
+
print(wcapi.get("products/794").json())
+
woocommerce.get("products/794").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "21.99",
+  "regular_price": "21.99",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    53,
+    40,
+    56,
+    479,
+    99
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": ""
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products"
+      }
+    ]
+  }
+}
+

List all products

+

This API helps you to view all the products.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/products
+
+
+
curl https://example.com/wp-json/wc/v3/products \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products')); ?>
+
print(wcapi.get("products").json())
+
woocommerce.get("products").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 799,
+    "name": "Ship Your Idea",
+    "slug": "ship-your-idea-22",
+    "permalink": "https://example.com/product/ship-your-idea-22/",
+    "date_created": "2017-03-23T17:03:12",
+    "date_created_gmt": "2017-03-23T20:03:12",
+    "date_modified": "2017-03-23T17:03:12",
+    "date_modified_gmt": "2017-03-23T20:03:12",
+    "type": "variable",
+    "status": "publish",
+    "featured": false,
+    "catalog_visibility": "visible",
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "sku": "",
+    "price": "",
+    "regular_price": "",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "price_html": "",
+    "on_sale": false,
+    "purchasable": false,
+    "total_sales": 0,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "external_url": "",
+    "button_text": "",
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "stock_status": "instock",
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      31,
+      22,
+      369,
+      414,
+      56
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "purchase_note": "",
+    "categories": [
+      {
+        "id": 9,
+        "name": "Clothing",
+        "slug": "clothing"
+      },
+      {
+        "id": 14,
+        "name": "T-shirts",
+        "slug": "t-shirts"
+      }
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 795,
+        "date_created": "2017-03-23T14:03:08",
+        "date_created_gmt": "2017-03-23T20:03:08",
+        "date_modified": "2017-03-23T14:03:08",
+        "date_modified_gmt": "2017-03-23T20:03:08",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
+        "name": "",
+        "alt": ""
+      },
+      {
+        "id": 796,
+        "date_created": "2017-03-23T14:03:09",
+        "date_created_gmt": "2017-03-23T20:03:09",
+        "date_modified": "2017-03-23T14:03:09",
+        "date_modified_gmt": "2017-03-23T20:03:09",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg",
+        "name": "",
+        "alt": ""
+      },
+      {
+        "id": 797,
+        "date_created": "2017-03-23T14:03:10",
+        "date_created_gmt": "2017-03-23T20:03:10",
+        "date_modified": "2017-03-23T14:03:10",
+        "date_modified_gmt": "2017-03-23T20:03:10",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg",
+        "name": "",
+        "alt": ""
+      },
+      {
+        "id": 798,
+        "date_created": "2017-03-23T14:03:11",
+        "date_created_gmt": "2017-03-23T20:03:11",
+        "date_modified": "2017-03-23T14:03:11",
+        "date_modified_gmt": "2017-03-23T20:03:11",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg",
+        "name": "",
+        "alt": ""
+      }
+    ],
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "position": 0,
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      },
+      {
+        "id": 0,
+        "name": "Size",
+        "position": 0,
+        "visible": true,
+        "variation": true,
+        "options": [
+          "S",
+          "M"
+        ]
+      }
+    ],
+    "default_attributes": [],
+    "variations": [],
+    "grouped_products": [],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/799"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products"
+        }
+      ]
+    }
+  },
+  {
+    "id": 794,
+    "name": "Premium Quality",
+    "slug": "premium-quality-19",
+    "permalink": "https://example.com/product/premium-quality-19/",
+    "date_created": "2017-03-23T17:01:14",
+    "date_created_gmt": "2017-03-23T20:01:14",
+    "date_modified": "2017-03-23T17:01:14",
+    "date_modified_gmt": "2017-03-23T20:01:14",
+    "type": "simple",
+    "status": "publish",
+    "featured": false,
+    "catalog_visibility": "visible",
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+    "on_sale": false,
+    "purchasable": true,
+    "total_sales": 0,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "external_url": "",
+    "button_text": "",
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "stock_status": "instock",
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      463,
+      47,
+      31,
+      387,
+      458
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "purchase_note": "",
+    "categories": [
+      {
+        "id": 9,
+        "name": "Clothing",
+        "slug": "clothing"
+      },
+      {
+        "id": 14,
+        "name": "T-shirts",
+        "slug": "t-shirts"
+      }
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 792,
+        "date_created": "2017-03-23T14:01:13",
+        "date_created_gmt": "2017-03-23T20:01:13",
+        "date_modified": "2017-03-23T14:01:13",
+        "date_modified_gmt": "2017-03-23T20:01:13",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+        "name": "",
+        "alt": ""
+      },
+      {
+        "id": 793,
+        "date_created": "2017-03-23T14:01:14",
+        "date_created_gmt": "2017-03-23T20:01:14",
+        "date_modified": "2017-03-23T14:01:14",
+        "date_modified_gmt": "2017-03-23T20:01:14",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+        "name": "",
+        "alt": ""
+      }
+    ],
+    "attributes": [],
+    "default_attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "black"
+      },
+      {
+        "id": 0,
+        "name": "Size",
+        "option": "S"
+      }
+    ],
+    "variations": [],
+    "grouped_products": [],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/794"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
modified_afterstringLimit response to resources modified after a given ISO8601 compliant date.
modified_beforestringLimit response to resources modified after a given ISO8601 compliant date.
dates_are_gmtbooleanWhether to consider GMT post dates when limiting response by published or modified date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title, slug, price, popularity and rating. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
slugstringLimit result set to products with a specific slug.
statusstringLimit result set to products assigned a specific status. Options: any, draft, pending, private and publish. Default is any.
typestringLimit result set to products assigned a specific type. Options: simple, grouped, external and variable.
skustringLimit result set to products with a specific SKU.
featuredbooleanLimit result set to featured products.
categorystringLimit result set to products assigned a specific category ID.
tagstringLimit result set to products assigned a specific tag ID.
shipping_classstringLimit result set to products assigned a specific shipping class ID.
attributestringLimit result set to products with a specific attribute.
attribute_termstringLimit result set to products with a specific attribute term ID (required an assigned attribute).
tax_classstringLimit result set to products with a specific tax class. Default options: standard, reduced-rate and zero-rate.
on_salebooleanLimit result set to products on sale.
min_pricestringLimit result set to products based on a minimum price.
max_pricestringLimit result set to products based on a maximum price.
stock_statusstringLimit result set to products with specified stock status. Options: instock, outofstock and onbackorder.
+

Update a product

+

This API lets you make changes to a product.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/794 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "24.54"
+}'
+
const data = {
+  regular_price: "24.54"
+};
+
+WooCommerce.put("products/794", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '24.54'
+];
+
+print_r($woocommerce->put('products/794', $data));
+?>
+
data = {
+    "regular_price": "24.54"
+}
+
+print(wcapi.put("products/794", data).json())
+
data = {
+  regular_price: "24.54"
+}
+
+woocommerce.put("products/794", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "24.54",
+  "regular_price": "24.54",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>24.54</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    479,
+    387,
+    22,
+    463,
+    396
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": ""
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products"
+      }
+    ]
+  }
+}
+

Delete a product

+

This API helps you delete a product.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/794?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/794", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/794', ['force' => true])); ?>
+
print(wcapi.delete("products/794", params={"force": True}).json())
+
woocommerce.delete("products/794", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "24.54",
+  "regular_price": "24.54",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>24.54</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    479,
+    387,
+    22,
+    463,
+    396
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": ""
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": ""
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the product, Default is false.
+

Batch update products

+

This API helps you to batch create, update and delete multiple products.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/products/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Woo Single #1",
+      "type": "simple",
+      "regular_price": "21.99",
+      "virtual": true,
+      "downloadable": true,
+      "downloads": [
+        {
+          "name": "Woo Single",
+          "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      "categories": [
+        {
+          "id": 11
+        },
+        {
+          "id": 13
+        }
+      ],
+      "images": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ]
+    },
+    {
+      "name": "New Premium Quality",
+      "type": "simple",
+      "regular_price": "21.99",
+      "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      "categories": [
+        {
+          "id": 9
+        },
+        {
+          "id": 14
+        }
+      ],
+      "images": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+        },
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 799,
+      "default_attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Green"
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "option": "M"
+        }
+      ]
+    }
+  ],
+  "delete": [
+    794
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Woo Single #1",
+      type: "simple",
+      regular_price: "21.99",
+      virtual: true,
+      downloadable: true,
+      downloads: [
+        {
+          name: "Woo Single",
+          file: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      categories: [
+        {
+          id: 11
+        },
+        {
+          id: 13
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ]
+    },
+    {
+      name: "New Premium Quality",
+      type: "simple",
+      regular_price: "21.99",
+      description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      categories: [
+        {
+          id: 9
+        },
+        {
+          id: 14
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+        },
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 799,
+      default_attributes: [
+        {
+          id: 6,
+          name: "Color",
+          option: "Green"
+        },
+        {
+          id: 0,
+          name: "Size",
+          option: "M"
+        }
+      ]
+    }
+  ],
+  delete: [
+    794
+  ]
+};
+
+WooCommerce.post("products/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Woo Single #1',
+            'type' => 'simple',
+            'regular_price' => '21.99',
+            'virtual' => true,
+            'downloadable' => true,
+            'downloads' => [
+                [
+                    'name' => 'Woo Single',
+                    'file' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg'
+                ]
+            ],
+            'categories' => [
+                [
+                    'id' => 11
+                ],
+                [
+                    'id' => 13
+                ]
+            ],
+            'images' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg'
+                ]
+            ]
+        ],
+        [
+            'name' => 'New Premium Quality',
+            'type' => 'simple',
+            'regular_price' => '21.99',
+            'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+            'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+            'categories' => [
+                [
+                    'id' => 9
+                ],
+                [
+                    'id' => 14
+                ]
+            ],
+            'images' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
+                ],
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 799,
+            'default_attributes' => [
+                [
+                    'id' => 6,
+                    'name' => 'Color',
+                    'option' => 'Green'
+                ],
+                [
+                    'id' => 0,
+                    'name' => 'Size',
+                    'option' => 'M'
+                ]
+            ]
+        ]
+    ],
+    'delete' => [
+        794
+    ]
+];
+
+print_r($woocommerce->post('products/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Woo Single #1",
+            "type": "simple",
+            "regular_price": "21.99",
+            "virtual": True,
+            "downloadable": True,
+            "downloads": [
+                {
+                    "name": "Woo Single",
+                    "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+                }
+            ],
+            "categories": [
+                {
+                    "id": 11
+                },
+                {
+                    "id": 13
+                }
+            ],
+            "images": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+                }
+            ]
+        },
+        {
+            "name": "New Premium Quality",
+            "type": "simple",
+            "regular_price": "21.99",
+            "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+            "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+            "categories": [
+                {
+                    "id": 9
+                },
+                {
+                    "id": 14
+                }
+            ],
+            "images": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+                },
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 799,
+            "default_attributes": [
+                {
+                    "id": 6,
+                    "name": "Color,
+                    "option": "Green"
+                },
+                {
+                    "id": 0,
+                    "name": "Size",
+                    "option": "M"
+                }
+            ]
+        }
+    ],
+    "delete": [
+        794
+    ]
+}
+
+print(wcapi.post("products/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Woo Single #1",
+      type: "simple",
+      regular_price: "21.99",
+      virtual: true,
+      downloadable: true,
+      downloads: [
+        {
+          name: "Woo Single",
+          file: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      categories: [
+        {
+          id: 11
+        },
+        {
+          id: 13
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ]
+    },
+    {
+      name: "New Premium Quality",
+      type: "simple",
+      regular_price: "21.99",
+      description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      categories: [
+        {
+          id: 9
+        },
+        {
+          id: 14
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+        },
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 799,
+      default_attributes: [
+        {
+          id: 6,
+          name: "Color,
+          option: "Green"
+        },
+        {
+          id: 0,
+          name: "Size",
+          option: "M"
+        }
+      ]
+    }
+  ],
+  delete: [
+    794
+  ]
+}
+
+woocommerce.post("products/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 801,
+      "name": "Woo Single #1",
+      "slug": "woo-single-1-4",
+      "permalink": "https://example.com/product/woo-single-1-4/",
+      "date_created": "2017-03-23T17:35:43",
+      "date_created_gmt": "2017-03-23T20:35:43",
+      "date_modified": "2017-03-23T17:35:43",
+      "date_modified_gmt": "2017-03-23T20:35:43",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "",
+      "short_description": "",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": true,
+      "downloadable": true,
+      "downloads": [
+        {
+          "id": 0,
+          "name": "Woo Single",
+          "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": false,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        588,
+        87,
+        573,
+        96,
+        329
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 11,
+          "name": "Music",
+          "slug": "music"
+        },
+        {
+          "id": 13,
+          "name": "Singles",
+          "slug": "singles"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 800,
+          "date_created": "2017-03-23T14:35:43",
+          "date_created_gmt": "2017-03-23T20:35:43",
+          "date_modified": "2017-03-23T14:35:43",
+          "date_modified_gmt": "2017-03-23T20:35:43",
+          "src": "https://example.com/wp-content/uploads/2017/03/cd_4_angle.jpg",
+          "name": "",
+          "alt": ""
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/801"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products"
+          }
+        ]
+      }
+    },
+    {
+      "id": 804,
+      "name": "New Premium Quality",
+      "slug": "new-premium-quality",
+      "permalink": "https://example.com/product/new-premium-quality/",
+      "date_created": "2017-03-23T17:35:48",
+      "date_created_gmt": "2017-03-23T20:35:48",
+      "date_modified": "2017-03-23T17:35:48",
+      "date_modified_gmt": "2017-03-23T20:35:48",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        458,
+        56,
+        99,
+        34,
+        378
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 802,
+          "date_created": "2017-03-23T14:35:47",
+          "date_created_gmt": "2017-03-23T20:35:47",
+          "date_modified": "2017-03-23T14:35:47",
+          "date_modified_gmt": "2017-03-23T20:35:47",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-5.jpg",
+          "name": "",
+          "alt": ""
+        },
+        {
+          "id": 803,
+          "date_created": "2017-03-23T14:35:48",
+          "date_created_gmt": "2017-03-23T20:35:48",
+          "date_modified": "2017-03-23T14:35:48",
+          "date_modified_gmt": "2017-03-23T20:35:48",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-3.jpg",
+          "name": "",
+          "alt": ""
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/804"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 799,
+      "name": "Ship Your Idea",
+      "slug": "ship-your-idea-22",
+      "permalink": "https://example.com/product/ship-your-idea-22/",
+      "date_created": "2017-03-23T17:03:12",
+      "date_created_gmt": "2017-03-23T20:03:12",
+      "date_modified": "2017-03-23T17:03:12",
+      "date_modified_gmt": "2017-03-23T20:03:12",
+      "type": "variable",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "",
+      "regular_price": "",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "",
+      "on_sale": false,
+      "purchasable": false,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        414,
+        40,
+        34,
+        463,
+        15
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 795,
+          "date_created": "2017-03-23T14:03:08",
+          "date_created_gmt": "2017-03-23T20:03:08",
+          "date_modified": "2017-03-23T14:03:08",
+          "date_modified_gmt": "2017-03-23T20:03:08",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
+          "name": "",
+          "alt": ""
+        },
+        {
+          "id": 796,
+          "date_created": "2017-03-23T14:03:09",
+          "date_created_gmt": "2017-03-23T20:03:09",
+          "date_modified": "2017-03-23T14:03:09",
+          "date_modified_gmt": "2017-03-23T20:03:09",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg",
+          "name": "",
+          "alt": ""
+        },
+        {
+          "id": 797,
+          "date_created": "2017-03-23T14:03:10",
+          "date_created_gmt": "2017-03-23T20:03:10",
+          "date_modified": "2017-03-23T14:03:10",
+          "date_modified_gmt": "2017-03-23T20:03:10",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg",
+          "name": "",
+          "alt": ""
+        },
+        {
+          "id": 798,
+          "date_created": "2017-03-23T14:03:11",
+          "date_created_gmt": "2017-03-23T20:03:11",
+          "date_modified": "2017-03-23T14:03:11",
+          "date_modified_gmt": "2017-03-23T20:03:11",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg",
+          "name": "",
+          "alt": ""
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "position": 0,
+          "visible": false,
+          "variation": true,
+          "options": [
+            "Black",
+            "Green"
+          ]
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "position": 0,
+          "visible": true,
+          "variation": true,
+          "options": [
+            "S",
+            "M"
+          ]
+        }
+      ],
+      "default_attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "green"
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "option": "M"
+        }
+      ],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/799"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 794,
+      "name": "Premium Quality",
+      "slug": "premium-quality-19",
+      "permalink": "https://example.com/product/premium-quality-19/",
+      "date_created": "2017-03-23T17:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T17:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "24.54",
+      "regular_price": "24.54",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>24.54</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        369,
+        56,
+        378,
+        31,
+        22
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 792,
+          "date_created": "2017-03-23T14:01:13",
+          "date_created_gmt": "2017-03-23T20:01:13",
+          "date_modified": "2017-03-23T14:01:13",
+          "date_modified_gmt": "2017-03-23T20:01:13",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+          "name": "",
+          "alt": ""
+        },
+        {
+          "id": 793,
+          "date_created": "2017-03-23T14:01:14",
+          "date_created_gmt": "2017-03-23T20:01:14",
+          "date_modified": "2017-03-23T14:01:14",
+          "date_modified_gmt": "2017-03-23T20:01:14",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+          "name": "",
+          "alt": ""
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/794"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product variations

+

The product variations API allows you to create, view, update, and delete individual, or a batch, of product variations.

+

Product variation properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the variation was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the variation was created, as GMT. read-only
date_modifieddate-timeThe date the variation was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the variation was last modified, as GMT. read-only
descriptionstringVariation description.
permalinkstringVariation URL. read-only
skustringUnique identifier.
pricestringCurrent variation price. read-only
regular_pricestringVariation regular price.
sale_pricestringVariation sale price.
date_on_sale_fromdate-timeStart date of sale price, in the site's timezone.
date_on_sale_from_gmtdate-timeStart date of sale price, as GMT.
date_on_sale_todate-timeEnd date of sale price, in the site's timezone.
date_on_sale_to_gmtdate-timeEnd date of sale price, as GMT.
on_salebooleanShows if the variation is on sale. read-only
statusstringVariation status. Options: draft, pending, private and publish. Default is publish.
purchasablebooleanShows if the variation can be bought. read-only
virtualbooleanIf the variation is virtual. Default is false.
downloadablebooleanIf the variation is downloadable. Default is false.
downloadsarrayList of downloadable files. See Product variation - Downloads properties
download_limitintegerNumber of times downloadable files can be downloaded after purchase. Default is -1.
download_expiryintegerNumber of days until access to downloadable files expires. Default is -1.
tax_statusstringTax status. Options: taxable, shipping and none. Default is taxable.
tax_classstringTax class.
manage_stockbooleanStock management at variation level. Default is false.
stock_quantityintegerStock quantity.
stock_statusstringControls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock.
backordersstringIf managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.
backorders_allowedbooleanShows if backorders are allowed. read-only
backorderedbooleanShows if the variation is on backordered. read-only
weightstringVariation weight.
dimensionsobjectVariation dimensions. See Product variation - Dimensions properties
shipping_classstringShipping class slug.
shipping_class_idstringShipping class ID. read-only
imageobjectVariation image data. See Product variation - Image properties
attributesarrayList of attributes. See Product variation - Attributes properties
menu_orderintegerMenu order, used to custom sort products.
meta_dataarrayMeta data. See Product variation - Meta data properties
+

Product variation - Downloads properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID.
namestringFile name.
filestringFile URL.
+

Product variation - Dimensions properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringVariation length.
widthstringVariation width.
heightstringVariation height.
+

Product variation - Image properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the image was created, as GMT. read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the image was last modified, as GMT. read-only
srcstringImage URL.
namestringImage name.
altstringImage alternative text.
+

Product variation - Attributes properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID.
namestringAttribute name.
optionstringSelected attribute term name.
+

Product variation - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a product variation

+

This API helps you to create a new product variation.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/<product_id>/variations
+
+
+ +
+

JSON response example:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products/22/variations \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "9.00",
+  "image": {
+    "id": 423
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "option": "Black"
+    }
+  ]
+}'
+
const data = {
+  regular_price: "9.00",
+  image: {
+    id: 423
+  },
+  attributes: [
+    {
+      id: 9,
+      option: "Black"
+    }
+  ]
+};
+
+WooCommerce.post("products/22/variations", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '9.00',
+    'image' => [
+        'id' => 423
+    ],
+    'attributes' => [
+        [
+            'id' => 9,
+            'option' => 'Black'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products/22/variations', $data));
+?>
+
data = {
+    "regular_price": "9.00",
+    "image": {
+        "id": 423
+    },
+    "attributes": [
+        {
+            "id": 9,
+            "option": "Black"
+        }
+    ]
+}
+
+print(wcapi.post("products/22/variations", data).json())
+
data = {
+  regular_price: "9.00",
+  image: {
+    id: 423
+  },
+  attributes: [
+    {
+      id: 9,
+      option: "Black"
+    }
+  ]
+}
+
+woocommerce.post("products/22/variations", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 732,
+  "date_created": "2017-03-23T00:36:38",
+  "date_created_gmt": "2017-03-23T03:36:38",
+  "date_modified": "2017-03-23T00:36:38",
+  "date_modified_gmt": "2017-03-23T03:36:38",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+  "sku": "",
+  "price": "9.00",
+  "regular_price": "9.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "status": true,
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 423,
+    "date_created": "2016-10-19T12:21:14",
+    "date_created_gmt": "2016-10-19T16:21:14",
+    "date_modified": "2016-10-19T12:21:14",
+    "date_modified_gmt": "2016-10-19T16:21:14",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Black"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations/732"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22"
+      }
+    ]
+  }
+}
+

Retrieve a product variation

+

This API lets you retrieve and view a specific product variation by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/products/<product_id>/variations/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/22/variations/732 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/22/variations/732")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/22/variations/732')); ?>
+
print(wcapi.get("products/22/variations/732").json())
+
woocommerce.get("products/22/variations/732").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 732,
+  "date_created": "2017-03-23T00:36:38",
+  "date_created_gmt": "2017-03-23T03:36:38",
+  "date_modified": "2017-03-23T00:36:38",
+  "date_modified_gmt": "2017-03-23T03:36:38",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+  "sku": "",
+  "price": "9.00",
+  "regular_price": "9.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "status": "publish",
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 423,
+    "date_created": "2016-10-19T12:21:14",
+    "date_created_gmt": "2016-10-19T16:21:14",
+    "date_modified": "2016-10-19T12:21:14",
+    "date_modified_gmt": "2016-10-19T16:21:14",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Black"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations/732"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22"
+      }
+    ]
+  }
+}
+

List all product variations

+

This API helps you to view all the product variations.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/products/<product_id>/variations
+
+
+
curl https://example.com/wp-json/wc/v3/products/22/variations \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/22/variations")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/22/variations')); ?>
+
print(wcapi.get("products/22/variations").json())
+
woocommerce.get("products/22/variations").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 733,
+    "date_created": "2017-03-23T00:53:11",
+    "date_created_gmt": "2017-03-23T03:53:11",
+    "date_modified": "2017-03-23T00:53:11",
+    "date_modified_gmt": "2017-03-23T03:53:11",
+    "description": "",
+    "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+    "sku": "",
+    "price": "9.00",
+    "regular_price": "9.00",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "on_sale": false,
+    "status": "publish",
+    "purchasable": true,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "stock_status": "instock",
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "image": {
+      "id": 425,
+      "date_created": "2016-10-19T12:21:16",
+      "date_created_gmt": "2016-10-19T16:21:16",
+      "date_modified": "2016-10-19T12:21:16",
+      "date_modified_gmt": "2016-10-19T16:21:16",
+      "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+      "name": "",
+      "alt": ""
+    },
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "Green"
+      }
+    ],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/22/variations/733"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/22"
+        }
+      ]
+    }
+  },
+  {
+    "id": 732,
+    "date_created": "2017-03-23T00:36:38",
+    "date_created_gmt": "2017-03-23T03:36:38",
+    "date_modified": "2017-03-23T00:36:38",
+    "date_modified_gmt": "2017-03-23T03:36:38",
+    "description": "",
+    "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+    "sku": "",
+    "price": "9.00",
+    "regular_price": "9.00",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "on_sale": false,
+    "status": "publish",
+    "purchasable": true,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "stock_status": "instock",
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "image": {
+      "id": 423,
+      "date_created": "2016-10-19T12:21:14",
+      "date_created_gmt": "2016-10-19T16:21:14",
+      "date_modified": "2016-10-19T12:21:14",
+      "date_modified_gmt": "2016-10-19T16:21:14",
+      "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+      "name": "",
+      "alt": ""
+    },
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "Black"
+      }
+    ],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/22/variations/732"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/22"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
slugstringLimit result set to products with a specific slug.
statusstringLimit result set to products assigned a specific status. Options: any, draft, pending, private and publish. Default is any.
skustringLimit result set to products with a specific SKU.
tax_classstringLimit result set to products with a specific tax class. Default options: standard, reduced-rate and zero-rate.
on_salebooleanLimit result set to products on sale.
min_pricestringLimit result set to products based on a minimum price.
max_pricestringLimit result set to products based on a maximum price.
stock_statusstringLimit result set to products with specified stock status. Options: instock, outofstock and onbackorder.
+

Update a product variation

+

This API lets you make changes to a product variation.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/<product_id>/variations/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/22/variations/733 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "10.00"
+}'
+
const data = {
+  regular_price: "10.00"
+};
+
+WooCommerce.put("products/22/variations/733", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '10.00'
+];
+
+print_r($woocommerce->put('products/22/variations/733', $data));
+?>
+
data = {
+    "regular_price": "10.00"
+}
+
+print(wcapi.put("products/22/variations/733", data).json())
+
data = {
+  regular_price: "10.00"
+}
+
+woocommerce.put("products/22/variations/733", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 733,
+  "date_created": "2017-03-23T00:53:11",
+  "date_created_gmt": "2017-03-23T03:53:11",
+  "date_modified": "2017-03-23T00:53:11",
+  "date_modified_gmt": "2017-03-23T03:53:11",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+  "sku": "",
+  "price": "10.00",
+  "regular_price": "10.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "status": "publish",
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 425,
+    "date_created": "2016-10-19T12:21:16",
+    "date_created_gmt": "2016-10-19T16:21:16",
+    "date_modified": "2016-10-19T12:21:16",
+    "date_modified_gmt": "2016-10-19T16:21:16",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Green"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations/733"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22"
+      }
+    ]
+  }
+}
+

Delete a product variation

+

This API helps you delete a product variation.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/<product_id>/variations/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/22/variations/733?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/22/variations/733", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/22/variations/733', ['force' => true])); ?>
+
print(wcapi.delete("products/22/variations/733", params={"force": True}).json())
+
woocommerce.delete("products/22/variations/733", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 733,
+  "date_created": "2017-03-23T00:53:11",
+  "date_created_gmt": "2017-03-23T03:53:11",
+  "date_modified": "2017-03-23T00:53:11",
+  "date_modified_gmt": "2017-03-23T03:53:11",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+  "sku": "",
+  "price": "10.00",
+  "regular_price": "10.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "status": "publish",
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "stock_status": "instock",
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 425,
+    "date_created": "2016-10-19T12:21:16",
+    "date_created_gmt": "2016-10-19T16:21:16",
+    "date_modified": "2016-10-19T12:21:16",
+    "date_modified_gmt": "2016-10-19T16:21:16",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Green"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations/733"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/22"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product variations

+

This API helps you to batch create, update and delete multiple product variations.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/<product_id>/variations/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/products/22/variations/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "regular_price": "10.00",
+      "attributes": [
+        {
+          "id": 6,
+          "option": "Blue"
+        }
+      ]
+    },
+    {
+      "regular_price": "10.00",
+      "attributes": [
+        {
+          "id": 6,
+          "option": "White"
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 733,
+      "regular_price": "10.00"
+    }
+  ],
+  "delete": [
+    732
+  ]
+}'
+
const data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+};
+
+WooCommerce.post("products/22/variations/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'Blue'
+                ]
+            ]
+        ],
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'White'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 733,
+            'regular_price' => '10.00'
+        ]
+    ],
+    'delete' => [
+        732
+    ]
+];
+
+print_r($woocommerce->post('products/22/variations/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "Blue"
+                }
+            ]
+        },
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "White"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 733,
+            "regular_price": "10.00"
+        }
+    ],
+    "delete": [
+        732
+    ]
+}
+
+print(wcapi.post("products/22/variations/batch", data).json())
+
data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+}
+
+woocommerce.post("products/22/variations/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 735,
+      "date_created": "2017-03-23T01:19:37",
+      "date_created_gmt": "2017-03-23T04:19:37",
+      "date_modified": "2017-03-23T01:19:37",
+      "date_modified_gmt": "2017-03-23T04:19:37",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=blue",
+      "sku": "",
+      "price": "10.00",
+      "regular_price": "10.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "status": "publish",
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 0,
+        "date_created": "2017-03-22T22:19:40",
+        "date_created_gmt": "2017-03-23T04:19:40",
+        "date_modified": "2017-03-22T22:19:40",
+        "date_modified_gmt": "2017-03-23T04:19:40",
+        "src": "https://example.com/wp-content/plugins/woocommerce/assets/images/placeholder.png",
+        "name": "Placeholder",
+        "alt": "Placeholder"
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Blue"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations/735"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22"
+          }
+        ]
+      }
+    },
+    {
+      "id": 736,
+      "date_created": "2017-03-23T01:19:40",
+      "date_created_gmt": "2017-03-23T04:19:40",
+      "date_modified": "2017-03-23T01:19:40",
+      "date_modified_gmt": "2017-03-23T04:19:40",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=white",
+      "sku": "",
+      "price": "10.00",
+      "regular_price": "10.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "status": "publish",
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 0,
+        "date_created": "2017-03-22T22:19:42",
+        "date_created_gmt": "2017-03-23T04:19:42",
+        "date_modified": "2017-03-22T22:19:42",
+        "date_modified_gmt": "2017-03-23T04:19:42",
+        "src": "https://example.com/wp-content/plugins/woocommerce/assets/images/placeholder.png",
+        "name": "Placeholder",
+        "alt": "Placeholder"
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "White"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations/736"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 733,
+      "date_created": "2017-03-23T00:53:11",
+      "date_created_gmt": "2017-03-23T03:53:11",
+      "date_modified": "2017-03-23T00:53:11",
+      "date_modified_gmt": "2017-03-23T03:53:11",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+      "sku": "",
+      "price": "10.00",
+      "regular_price": "10.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "status": "publish",
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 425,
+        "date_created": "2016-10-19T12:21:16",
+        "date_created_gmt": "2016-10-19T16:21:16",
+        "date_modified": "2016-10-19T12:21:16",
+        "date_modified_gmt": "2016-10-19T16:21:16",
+        "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+        "name": "",
+        "alt": ""
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Green"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations/733"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 732,
+      "date_created": "2017-03-23T00:36:38",
+      "date_created_gmt": "2017-03-23T03:36:38",
+      "date_modified": "2017-03-23T00:36:38",
+      "date_modified_gmt": "2017-03-23T03:36:38",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+      "sku": "",
+      "price": "9.00",
+      "regular_price": "9.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "status": "publish",
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "stock_status": "instock",
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 423,
+        "date_created": "2016-10-19T12:21:14",
+        "date_created_gmt": "2016-10-19T16:21:14",
+        "date_modified": "2016-10-19T12:21:14",
+        "date_modified_gmt": "2016-10-19T16:21:14",
+        "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+        "name": "",
+        "alt": ""
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Black"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations/732"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/22"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product attributes

+

The product attributes API allows you to create, view, update, and delete individual, or a batch, of product attributes.

+

Product attribute properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringAttribute name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
typestringType of attribute. By default only select is supported.
order_bystringDefault sort order. Options: menu_order, name, name_num and id. Default is menu_order.
has_archivesbooleanEnable/Disable attribute archives. Default is false.
+

Create a product attribute

+

This API helps you to create a new product attribute.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/attributes
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/products/attributes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true
+}'
+
const data = {
+  name: "Color",
+  slug: "pa_color",
+  type: "select",
+  order_by: "menu_order",
+  has_archives: true
+};
+
+WooCommerce.post("products/attributes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Color',
+    'slug' => 'pa_color',
+    'type' => 'select',
+    'order_by' => 'menu_order',
+    'has_archives' => true
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+
data = {
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": True
+}
+
+print(wcapi.post("products/attributes", data).json())
+
data = {
+  name: "Color",
+  slug: "pa_color",
+  type: "select",
+  order_by: "menu_order",
+  has_archives: true
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes"
+      }
+    ]
+  }
+}
+

Retrieve a product attribute

+

This API lets you retrieve and view a specific product attribute by ID.

+ +
+
+ GET +
/wp-json/wc/v3/products/attributes/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/attributes/1 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/1")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/1')); ?>
+
print(wcapi.get("products/attributes/1").json())
+
woocommerce.get("products/attributes/1").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes"
+      }
+    ]
+  }
+}
+

List all product attributes

+

This API helps you to view all the product attributes.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/products/attributes
+
+
+
curl https://example.com/wp-json/wc/v3/products/attributes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes')); ?>
+
print(wcapi.get("products/attributes").json())
+
woocommerce.get("products/attributes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 1,
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": true,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/6"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 2,
+    "name": "Size",
+    "slug": "pa_size",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
+

Update a product attribute

+

This API lets you make changes to a product attribute.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/attributes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/attributes/1 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_by": "name"
+}'
+
const data = {
+  order_by: "name"
+};
+
+WooCommerce.put("products/attributes/1", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'order_by' => 'name'
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+
data = {
+    "order_by": "name"
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+
data = {
+  order_by: "name"
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "name",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes"
+      }
+    ]
+  }
+}
+

Delete a product attribute

+

This API helps you delete a product attribute.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/attributes/<id>
+
+
+ + +
curl -X DELETE https://example.com/wp-json/wc/v3/products/attributes/1?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/attributes/1", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/attributes/1', ['force' => true])); ?>
+
print(wcapi.delete("products/attributes/1", params={"force": True}).json())
+
woocommerce.delete("products/attributes/1", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product attributes

+

This API helps you to batch create, update and delete multiple product attributes.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/attributes/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/products/attributes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Brand"
+    },
+    {
+      "name": "Publisher"
+    }
+  ],
+  "update": [
+    {
+      "id": 2,
+      "order_by": "name"
+    }
+  ],
+  "delete": [
+    1
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Brand"
+    },
+    {
+      name: "Publisher"
+    }
+  ],
+  update: [
+    {
+      id: 2,
+      order_by: "name"
+    }
+  ],
+  delete: [
+    1
+  ]
+};
+
+WooCommerce.post("products/attributes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Brand'
+        ],
+        [
+            'name' => 'Publisher'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 2,
+            'order_by' => 'name'
+        ]
+    ],
+    'delete' => [
+        1
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Brand"
+        },
+        {
+            "name": "Publisher"
+        }
+    ],
+    "update": [
+        {
+            "id": 2,
+            "order_by": "name"
+        }
+    ],
+    "delete": [
+        1
+    ]
+}
+
+print(wcapi.post("products/attributes/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 2,
+      order_by: "name"
+    }
+  ],
+  delete: [
+    1
+  ]
+}
+
+woocommerce.post("products/attributes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 7,
+      "name": "Brand",
+      "slug": "pa_brand",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/7"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 8,
+      "name": "Publisher",
+      "slug": "pa_publisher",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/8"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 2,
+      "name": "Size",
+      "slug": "pa_size",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 1,
+      "name": "Color",
+      "slug": "pa_color",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": true,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/6"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product attribute terms

+

The product attribute terms API allows you to create, view, update, and delete individual, or a batch, of attribute terms.

+

Product attribute term properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringTerm name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
menu_orderintegerMenu order, used to custom sort the resource.
countintegerNumber of published products for the resource. read-only
+

Create an attribute term

+

This API helps you to create a new product attribute term.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/attributes/<attribute_id>/terms
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/products/attributes/2/terms \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "XXS"
+}'
+
const data = {
+  name: "XXS"
+};
+
+WooCommerce.post("products/attributes/2/terms", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'XXS'
+];
+
+print_r($woocommerce->post('products/attributes/2/terms', $data));
+?>
+
data = {
+    "name": "XXS"
+}
+
+print(wcapi.post("products/attributes/2/terms", data).json())
+
data = {
+  name: "XXS"
+}
+
+woocommerce.post("products/attributes/2/terms", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Retrieve an attribute term

+

This API lets you retrieve a product attribute term by ID.

+ +
+
+ GET +
/wp-json/wc/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/attributes/2/terms/23 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/2/terms/23")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/2/terms/23')); ?>
+
print(wcapi.get("products/attributes/2/terms/23").json())
+
woocommerce.get("products/attributes/2/terms/23").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

List all attribute terms

+

This API lets you retrieve all terms from a product attribute.

+ +
+
+ GET +
/wp-json/wc/v3/products/attributes/<attribute_id>/terms
+
+
+
curl https://example.com/wp-json/wc/v3/products/attributes/2/terms \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/2/terms")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/2/terms')); ?>
+
print(wcapi.get("products/attributes/2/terms").json())
+
woocommerce.get("products/attributes/2/terms").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 23,
+    "name": "XXS",
+    "slug": "xxs",
+    "description": "",
+    "menu_order": 1,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/23"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 22,
+    "name": "XS",
+    "slug": "xs",
+    "description": "",
+    "menu_order": 2,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/22"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 17,
+    "name": "S",
+    "slug": "s",
+    "description": "",
+    "menu_order": 3,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/17"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 18,
+    "name": "M",
+    "slug": "m",
+    "description": "",
+    "menu_order": 4,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/18"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 19,
+    "name": "L",
+    "slug": "l",
+    "description": "",
+    "menu_order": 5,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/19"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 20,
+    "name": "XL",
+    "slug": "xl",
+    "description": "",
+    "menu_order": 6,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/20"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 21,
+    "name": "XXL",
+    "slug": "xxl",
+    "description": "",
+    "menu_order": 7,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/21"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
parentintegerLimit result set to resources assigned to a specific parent.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update an attribute term

+

This API lets you make changes to a product attribute term.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/attributes/2/terms/23 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "XXS"
+}'
+
const data = {
+  name: "XXS"
+};
+
+WooCommerce.put("products/attributes/2/terms/23", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'XXS'
+];
+
+print_r($woocommerce->put('products/attributes/2/terms/23', $data));
+?>
+
data = {
+    "name": "XXS"
+}
+
+print(wcapi.put("products/attributes/2/terms/23", data).json())
+
data = {
+  name: "XXS"
+}
+
+woocommerce.put("products/attributes/2/terms/23", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Delete an attribute term

+

This API helps you delete a product attribute term.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/attributes/2/terms/23?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/attributes/2/terms/23", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/attributes/2/terms/23', ['force' => true])); ?>
+
print(wcapi.delete("products/attributes/2/terms/23", params={"force": True}).json())
+
woocommerce.delete("products/attributes/2/terms/23", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update attribute terms

+

This API helps you to batch create, update and delete multiple product attribute terms.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/attributes/<attribute_id>/terms/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/products/attributes/&lt;attribute_id&gt;/terms/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "XXS"
+    },
+    {
+      "name": "S"
+    }
+  ],
+  "update": [
+    {
+      "id": 19,
+      "menu_order": 6
+    }
+  ],
+  "delete": [
+    21,
+    20
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "XXS"
+    },
+    {
+      name: "S"
+    }
+  ],
+  update: [
+    {
+      id: 19,
+      menu_order: 6
+    }
+  ],
+  delete: [
+    21,
+    20
+  ]
+};
+
+WooCommerce.post("products/attributes/2/terms/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'XXS'
+        ],
+        [
+            'name' => 'S'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 19,
+            'menu_order' => 6
+        ]
+    ],
+    'delete' => [
+        21,
+        20
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/2/terms/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "XXS"
+        },
+        {
+            "name": "S"
+        }
+    ],
+    "update": [
+        {
+            "id": 19,
+            "menu_order": 6
+        }
+    ],
+    "delete": [
+        21,
+        20
+    ]
+}
+
+print(wcapi.post("products/attributes/2/terms/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "XXS"
+    },
+    {
+      name: "S"
+    }
+  ],
+  update: [
+    {
+      id: 19,
+      menu_order: 6
+    }
+  ],
+  delete: [
+    21,
+    20
+  ]
+}
+
+woocommerce.post("products/attributes/2/terms/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 23,
+      "name": "XXS",
+      "slug": "xxs",
+      "description": "",
+      "menu_order": 1,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/23"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+          }
+        ]
+      }
+    },
+    {
+      "id": 17,
+      "name": "S",
+      "slug": "s",
+      "description": "",
+      "menu_order": 3,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/17"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 19,
+      "name": "L",
+      "slug": "l",
+      "description": "",
+      "menu_order": 5,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/19"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 21,
+      "name": "XXL",
+      "slug": "xxl",
+      "description": "",
+      "menu_order": 7,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/21"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+          }
+        ]
+      }
+    },
+    {
+      "id": 20,
+      "name": "XL",
+      "slug": "xl",
+      "description": "",
+      "menu_order": 6,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms/20"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product categories

+

The product categories API allows you to create, view, update, and delete individual, or a batch, of categories.

+

Product category properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringCategory name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
parentintegerThe ID for the parent of the resource.
descriptionstringHTML description of the resource.
displaystringCategory archive display type. Options: default, products, subcategories and both. Default is default.
imageobjectImage data. See Product category - Image properties
menu_orderintegerMenu order, used to custom sort the resource.
countintegerNumber of published products for the resource. read-only
+

Product category - Image properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the image was created, as GMT read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the image was last modified, as GMT. read-only
srcstringImage URL.
namestringImage name.
altstringImage alternative text.
+

Create a product category

+

This API helps you to create a new product category.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/categories
+
+
+ +
+

Example of how to create a product category:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products/categories \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Clothing",
+  "image": {
+    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+}'
+
const data = {
+  name: "Clothing",
+  image: {
+    src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+};
+
+WooCommerce.post("products/categories", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    "name' => 'Clothing',
+    'image' => [
+        'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
+    ]
+];
+
+print_r($woocommerce->post('products/categories', $data));
+?>
+
data = {
+    "name": "Clothing",
+    "image": {
+        "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+    }
+}
+
+print(wcapi.post("products/categories", data).json())
+
data = {
+  name: "Clothing",
+  image: {
+    src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+}
+
+woocommerce.post("products/categories", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories"
+      }
+    ]
+  }
+}
+

Retrieve a product category

+

This API lets you retrieve a product category by ID.

+ +
+
+ GET +
/wp-json/wc/v3/products/categories/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/categories/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/categories/9")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/categories/9')); ?>
+
print(wcapi.get("products/categories/9").json())
+
woocommerce.get("products/categories/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories"
+      }
+    ]
+  }
+}
+

List all product categories

+

This API lets you retrieve all product categories.

+ +
+
+ GET +
/wp-json/wc/v3/products/categories
+
+
+
curl https://example.com/wp-json/wc/v3/products/categories \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/categories")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/categories')); ?>
+
print(wcapi.get("products/categories").json())
+
woocommerce.get("products/categories").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 15,
+    "name": "Albums",
+    "slug": "albums",
+    "parent": 11,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 4,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/15"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/11"
+        }
+      ]
+    }
+  },
+  {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": {
+      "id": 730,
+      "date_created": "2017-03-23T00:01:07",
+      "date_created_gmt": "2017-03-23T03:01:07",
+      "date_modified": "2017-03-23T00:01:07",
+      "date_modified_gmt": "2017-03-23T03:01:07",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+      "name": "",
+      "alt": ""
+    },
+    "menu_order": 0,
+    "count": 36,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example/wp-json/wc/v3/products/categories/9"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example/wp-json/wc/v3/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 10,
+    "name": "Hoodies",
+    "slug": "hoodies",
+    "parent": 9,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 6,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/10"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+        }
+      ]
+    }
+  },
+  {
+    "id": 11,
+    "name": "Music",
+    "slug": "music",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 7,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/11"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 12,
+    "name": "Posters",
+    "slug": "posters",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 5,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/12"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 13,
+    "name": "Singles",
+    "slug": "singles",
+    "parent": 11,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 3,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/13"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/11"
+        }
+      ]
+    }
+  },
+  {
+    "id": 14,
+    "name": "T-shirts",
+    "slug": "t-shirts",
+    "parent": 9,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 6,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/14"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
parentintegerLimit result set to resources assigned to a specific parent.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a product category

+

This API lets you make changes to a product category.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/categories/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/categories/9 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "All kinds of clothes."
+}'
+
const data = {
+  description: "All kinds of clothes."
+};
+
+WooCommerce.put("products/categories/9", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description' => 'All kinds of clothes.'
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+
data = {
+    "description": "All kinds of clothes."
+}
+
+print(wcapi.put("products/categories/9", data).json())
+
data = {
+  description: "All kinds of clothes."
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "All kinds of clothes.",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories"
+      }
+    ]
+  }
+}
+

Delete a product category

+

This API helps you delete a product category.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/categories/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/categories/9?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/categories/9", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/categories/9', ['force' => true])); ?>
+
print(wcapi.delete("products/categories/9", params={"force": True}).json())
+
woocommerce.delete("products/categories/9", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "All kinds of clothes.",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "name": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/categories"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product categories

+

This API helps you to batch create, update and delete multiple product categories.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/categories/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/products/categories/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Albums"
+    },
+    {
+      "name": "Clothing"
+    }
+  ],
+  "update": [
+    {
+      "id": 10,
+      "description": "Nice hoodies"
+    }
+  ],
+  "delete": [
+    11,
+    12
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Albums"
+    },
+    {
+      name: "Clothing"
+    }
+  ],
+  update: [
+    {
+      id: 10,
+      description: "Nice hoodies"
+    }
+  ],
+  delete: [
+    11,
+    12
+  ]
+};
+
+WooCommerce.post("products/categories/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Albums'
+        ],
+        [
+            'name' => 'Clothing'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 10,
+            'description' => 'Nice hoodies'
+        ]
+    ],
+    'delete' => [
+        11,
+        12
+    ]
+];
+
+print_r($woocommerce->post('products/categories/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Albums"
+        },
+        {
+            "name": "Clothing"
+        }
+    ],
+    "update": [
+        {
+            "id": 10,
+            "description": "Nice hoodies"
+        }
+    ],
+    "delete": [
+        11,
+        12
+    ]
+}
+
+print(wcapi.post("products/categories/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Albums"
+    },
+    {
+      name: "Clothing"
+    }
+  ],
+  update: [
+    {
+      id: 10,
+      description: "Nice hoodies"
+    }
+  ],
+  delete: [
+    11,
+    12
+  ]
+}
+
+woocommerce.post("products/categories/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 15,
+      "name": "Albums",
+      "slug": "albums",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/15"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/11"
+          }
+        ]
+      }
+    },
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 10,
+      "name": "Hoodies",
+      "slug": "hoodies",
+      "parent": 9,
+      "description": "Nice hoodies",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 6,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/10"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/9"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 11,
+      "name": "Music",
+      "slug": "music",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 7,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/11"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories"
+          }
+        ]
+      }
+    },
+    {
+      "id": 12,
+      "name": "Posters",
+      "slug": "posters",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 5,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories/12"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/categories"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product shipping classes

+

The product shipping class API allows you to create, view, update, and delete individual, or a batch, of shipping classes.

+

Product shipping class properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringShipping class name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
countintegerNumber of published products for the resource. read-only
+

Create a shipping class

+

This API helps you to create a new product shipping class.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/shipping_classes
+
+
+ +
+

Example of how to create a product shipping class:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products/shipping_classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Priority"
+}'
+
const data = {
+  name: "Priority"
+};
+
+WooCommerce.post("products/shipping_classes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Priority'
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+
data = {
+    "name": "Priority"
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+
data = {
+  name: "Priority"
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Retrieve a shipping class

+

This API lets you retrieve a product shipping class by ID.

+ +
+
+ GET +
/wp-json/wc/v3/products/shipping_classes/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/shipping_classes/32 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/shipping_classes/32")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/shipping_classes/32')); ?>
+
print(wcapi.get("products/shipping_classes/32").json())
+
woocommerce.get("products/shipping_classes/32").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+      }
+    ]
+  }
+}
+

List all shipping classes

+

This API lets you retrieve all product shipping classes.

+ +
+
+ GET +
/wp-json/wc/v3/products/shipping_classes
+
+
+
curl https://example.com/wp-json/wc/v3/products/shipping_classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/shipping_classes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+
print(wcapi.get("products/shipping_classes").json())
+
woocommerce.get("products/shipping_classes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 33,
+    "name": "Express",
+    "slug": "express",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/33"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 32,
+    "name": "Priority",
+    "slug": "priority",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/32"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a shipping class

+

This API lets you make changes to a product shipping class.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/shipping_classes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/shipping_classes/32 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "Priority mail."
+}'
+
const data = {
+  description: "Priority mail."
+};
+
+WooCommerce.put("products/shipping_classes/32", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description' => 'Priority mail.'
+];
+
+print_r($woocommerce->put('products/shipping_classes/32', $data));
+?>
+
data = {
+    "description": "Priority mail."
+}
+
+print(wcapi.put("products/shipping_classes/32", data).json())
+
data = {
+  description: "Priority mail."
+}
+
+woocommerce.put("products/shipping_classes/32", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "Priority mail.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Delete a shipping class

+

This API helps you delete a product shipping class.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/shipping_classes/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/shipping_classes/32?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/shipping_classes/32", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/shipping_classes/32', ['force' => true])); ?>
+
print(wcapi.delete("products/shipping_classes/32", params={"force": True}).json())
+
woocommerce.delete("products/shipping_classes/32", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "Priority mail.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update shipping classes

+

This API helps you to batch create, update and delete multiple product shipping classes.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/shipping_classes/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/products/shipping_classes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Small items"
+    },
+    {
+      "name": "Large items"
+    }
+  ],
+  "update": [
+    {
+      "id": 33,
+      "description": "Express shipping"
+    }
+  ],
+  "delete": [
+    32
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Small items"
+    },
+    {
+      name: "Large items"
+    }
+  ],
+  update: [
+    {
+      id: 33,
+      description: "Express shipping"
+    }
+  ],
+  delete: [
+    32
+  ]
+};
+
+WooCommerce.post("products/shipping_classes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Small items'
+        ],
+        [
+            'name' => 'Large items'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 33,
+            'description' => 'Express shipping'
+        ]
+    ],
+    'delete' => [
+        32
+    ]
+];
+
+print_r($woocommerce->post('products/shipping_classes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Small items"
+        },
+        {
+            "name": "Large items"
+        }
+    ],
+    "update": [
+        {
+            "id": 33,
+            "description": "Express shipping"
+        }
+    ],
+    "delete": [
+        32
+    ]
+}
+
+print(wcapi.post("products/shipping_classes/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Small items"
+    },
+    {
+      name: "Large items"
+    }
+  ],
+  update: [
+    {
+      id: 33,
+      description: "Express shipping"
+    }
+  ],
+  delete: [
+    32
+  ]
+}
+
+woocommerce.post("products/shipping_classes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 34,
+      "name": "Small items",
+      "slug": "small-items",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/34"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 35,
+      "name": "Large items",
+      "slug": "large-items",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/35"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 33,
+      "name": "Express",
+      "slug": "express",
+      "description": "Express shipping",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/33"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 32,
+      "name": "Priority",
+      "slug": "priority",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes/32"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product tags

+

The product tags API allows you to create, view, update, and delete individual, or a batch, of product tags.

+

Product tag properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringTag name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
countintegerNumber of published products for the resource. read-only
+

Create a product tag

+

This API helps you to create a new product tag.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/tags
+
+
+ +
+

Example of how to create a product tag:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products/tags \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Leather Shoes"
+}'
+
const data = {
+  name: "Leather Shoes"
+};
+
+WooCommerce.post("products/tags", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Leather Shoes'
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+
data = {
+    "name": "Leather Shoes"
+}
+
+print(wcapi.post("products/tags", data).json())
+
data = {
+  name: "Leather Shoes"
+}
+
+woocommerce.post("products/tags", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags"
+      }
+    ]
+  }
+}
+

Retrieve a product tag

+

This API lets you retrieve a product tag by ID.

+ +
+
+ GET +
/wp-json/wc/v3/products/tags/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/tags/34 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags/34")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags/34')); ?>
+
print(wcapi.get("products/tags/34").json())
+
woocommerce.get("products/tags/34").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags"
+      }
+    ]
+  }
+}
+

List all product tags

+

This API lets you retrieve all product tag.

+ +
+
+ GET +
/wp-json/wc/v3/products/tags
+
+
+
curl https://example.com/wp-json/wc/v3/products/tags \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags')); ?>
+
print(wcapi.get("products/tags").json())
+
woocommerce.get("products/tags").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 34,
+    "name": "Leather Shoes",
+    "slug": "leather-shoes",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/tags/34"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/tags"
+        }
+      ]
+    }
+  },
+  {
+    "id": 35,
+    "name": "Oxford Shoes",
+    "slug": "oxford-shoes",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/tags/35"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/tags"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a product tag

+

This API lets you make changes to a product tag.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/tags/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/tags/34 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "Genuine leather."
+}'
+
const data = {
+  description: "Genuine leather."
+};
+
+WooCommerce.put("products/tags/34", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description': 'Genuine leather.'
+];
+
+print_r($woocommerce->put('products/tags/34', $data));
+?>
+
data = {
+    "description": "Genuine leather."
+}
+
+print(wcapi.put("products/tags/34", data).json())
+
data = {
+  description: "Genuine leather."
+}
+
+woocommerce.put("products/tags/34", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "Genuine leather.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags"
+      }
+    ]
+  }
+}
+

Delete a product tag

+

This API helps you delete a product tag.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/tags/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/tags/34?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/tags/34", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/tags/34', ['force' => true])); ?>
+
print(wcapi.delete("products/tags/34", params={"force": True}).json())
+
woocommerce.delete("products/tags/34", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "Genuine leather.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/products/tags"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product tags

+

This API helps you to batch create, update and delete multiple product tags.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/tags/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/products/tags/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Round toe"
+    },
+    {
+      "name": "Flat"
+    }
+  ],
+  "update": [
+    {
+      "id": 34,
+      "description": "Genuine leather."
+    }
+  ],
+  "delete": [
+    35
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 34,
+      description: "Genuine leather."
+    }
+  ],
+  delete: [
+    35
+  ]
+};
+
+WooCommerce.post("products/tags/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Round toe'
+        ],
+        [
+            'name' => 'Flat'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 34,
+            'description' => 'Genuine leather.'
+        ]
+    ],
+    'delete' => [
+        35
+    ]
+];
+
+print_r($woocommerce->post('products/tags/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Round toe"
+        },
+        {
+            "name": "Flat"
+        }
+    ],
+    "update": [
+        {
+            "id": 34,
+            "description": "Genuine leather."
+        }
+    ],
+    "delete": [
+        35
+    ]
+}
+
+print(wcapi.post("products/tags/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 34,
+      description: "Genuine leather."
+    }
+  ],
+  delete: [
+    35
+  ]
+}
+
+woocommerce.post("products/tags/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 36,
+      "name": "Round toe",
+      "slug": "round-toe",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags/36"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags"
+          }
+        ]
+      }
+    },
+    {
+      "id": 37,
+      "name": "Flat",
+      "slug": "flat",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags/37"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 34,
+      "name": "Leather Shoes",
+      "slug": "leather-shoes",
+      "description": "Genuine leather.",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags/34"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 35,
+      "name": "Oxford Shoes",
+      "slug": "oxford-shoes",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags/35"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/products/tags"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product reviews

+

The product reviews API allows you to create, view, update, and delete individual, or a batch, of product reviews.

+

Product review properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createdstringThe date the review was created, in the site's timezone. read-only
date_created_gmtstringThe date the review was created, as GMT. read-only
product_idintegerUnique identifier for the product that the review belongs to.
statusstringStatus of the review. Options: approved, hold, spam, unspam, trash and untrash. Defaults to approved.
reviewerstringReviewer name.
reviewer_emailstringReviewer email.
reviewstringThe content of the review.
ratingintegerReview rating (0 to 5).
verifiedbooleanShows if the reviewer bought the product or not.
+

Create a product review

+

This API helps you to create a new product review.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/reviews
+
+
+ +
+

Example of how to create a product review:

+
+
curl -X POST https://example.com/wp-json/wc/v3/products/reviews \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_id": 22,
+  "review": "Nice album!",
+  "reviewer": "John Doe",
+  "reviewer_email": "john.doe@example.com",
+  "rating": 5
+}'
+
const data = {
+  product_id: 22,
+  review: "Nice album!",
+  reviewer: "John Doe",
+  reviewer_email: "john.doe@example.com",
+  rating: 5
+};
+
+WooCommerce.post("products/reviews", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'product_id' => 22,
+    'review' => 'Nice album!',
+    'reviewer' => 'John Doe',
+    'reviewer_email' => 'john.doe@example.com',
+    'rating' => 5
+];
+
+print_r($woocommerce->post('products/reviews', $data));
+?>
+
data = {
+    "product_id": 22,
+    "review": "Nice album!",
+    "reviewer": "John Doe",
+    "reviewer_email": "john.doe@example.com",
+    "rating": 5,
+}
+
+print(wcapi.post("products/reviews", data).json())
+
data = {
+  product_id: 22,
+  review: "Nice album!",
+  reviewer: "John Doe",
+  reviewer_email: "john.doe@example.com",
+  rating: 5
+}
+
+woocommerce.post("products/reviews", data).parsed_response
+
+
+

JSON response example:

+
+
{
+    "id": 22,
+    "date_created": "2018-10-18T17:59:17",
+    "date_created_gmt": "2018-10-18T20:59:17",
+    "product_id": 22,
+    "status": "approved",
+    "reviewer": "John Doe",
+    "reviewer_email": "john.doe@example.com",
+    "review": "Nice album!",
+    "rating": 5,
+    "verified": false,
+    "reviewer_avatar_urls": {
+        "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+        "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+        "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+    },
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/reviews/22"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/reviews"
+            }
+        ],
+        "up": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/22"
+            }
+        ]
+    }
+}
+

Retrieve a product review

+

This API lets you retrieve a product review by ID.

+ +
+
+ GET +
/wp-json/wc/v3/products/reviews/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/products/reviews/22 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/reviews/22")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/reviews/22')); ?>
+
print(wcapi.get("products/reviews/22").json())
+
woocommerce.get("products/reviews/22").parsed_response
+
+
+

JSON response example:

+
+
{
+    "id": 22,
+    "date_created": "2018-10-18T17:59:17",
+    "date_created_gmt": "2018-10-18T20:59:17",
+    "product_id": 22,
+    "status": "approved",
+    "reviewer": "John Doe",
+    "reviewer_email": "john.doe@example.com",
+    "review": "Nice album!",
+    "rating": 5,
+    "verified": false,
+    "reviewer_avatar_urls": {
+        "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+        "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+        "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+    },
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/reviews/22"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/reviews"
+            }
+        ],
+        "up": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/22"
+            }
+        ]
+    }
+}
+

List all product reviews

+

This API lets you retrieve all product review.

+ +
+
+ GET +
/wp-json/wc/v3/products/reviews
+
+
+
curl https://example.com/wp-json/wc/v3/products/reviews \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/reviews")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/reviews')); ?>
+
print(wcapi.get("products/reviews").json())
+
woocommerce.get("products/reviews").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "id": 22,
+        "date_created": "2018-10-18T17:59:17",
+        "date_created_gmt": "2018-10-18T20:59:17",
+        "product_id": 22,
+        "status": "approved",
+        "reviewer": "John Doe",
+        "reviewer_email": "john.doe@example.com",
+        "review": "<p>Nice album!</p>\n",
+        "rating": 5,
+        "verified": false,
+        "reviewer_avatar_urls": {
+            "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+            "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+            "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+        },
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/products/reviews/22"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/products/reviews"
+                }
+            ],
+            "up": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/products/22"
+                }
+            ]
+        }
+    },
+    {
+        "id": 20,
+        "date_created": "2018-09-08T21:47:19",
+        "date_created_gmt": "2018-09-09T00:47:19",
+        "product_id": 31,
+        "status": "approved",
+        "reviewer": "Claudio Sanches",
+        "reviewer_email": "john.doe@example.com",
+        "review": "<p>Now works just fine.</p>\n",
+        "rating": 1,
+        "verified": true,
+        "reviewer_avatar_urls": {
+            "24": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=24&d=mm&r=g",
+            "48": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=48&d=mm&r=g",
+            "96": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=96&d=mm&r=g"
+        },
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/products/reviews/20"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/products/reviews"
+                }
+            ],
+            "up": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/products/31"
+                }
+            ],
+            "reviewer": [
+                {
+                    "embeddable": true,
+                    "href": "https://example.com/wp-json/wp/v2/users/1"
+                }
+            ]
+        }
+    }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to reviews published after a given ISO8601 compliant date.
beforestringLimit response to reviews published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by resource attribute. Options: date, date_gmt, id, slug, include and product. Default is date_gmt.
reviewerarrayLimit result set to reviews assigned to specific user IDs.
reviewer_excludearrayEnsure result set excludes reviews assigned to specific user IDs.
reviewer_emailarrayLimit result set to that from a specific author email.
productarrayLimit result set to reviews assigned to specific product IDs.
statusstringLimit result set to reviews assigned a specific status. Options: all, hold, approved, spam and trash. Default is approved.
+

Update a product review

+

This API lets you make changes to a product review.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/products/reviews/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/products/reviews/20 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "rating": 5
+}'
+
const data = {
+  rating: 5
+};
+
+WooCommerce.put("products/reviews/20", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'rating': 5
+];
+
+print_r($woocommerce->put('products/reviews/20', $data));
+?>
+
data = {
+    "rating": 5
+}
+
+print(wcapi.put("products/reviews/20", data).json())
+
data = {
+  rating: 5
+}
+
+woocommerce.put("products/reviews/20", data).parsed_response
+
+
+

JSON response example:

+
+
{
+    "id": 20,
+    "date_created": "2018-09-08T21:47:19",
+    "date_created_gmt": "2018-09-09T00:47:19",
+    "product_id": 31,
+    "status": "approved",
+    "reviewer": "Claudio Sanches",
+    "reviewer_email": "john.doe@example.com",
+    "review": "Now works just fine.",
+    "rating": 5,
+    "verified": true,
+    "reviewer_avatar_urls": {
+        "24": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=24&d=mm&r=g",
+        "48": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=48&d=mm&r=g",
+        "96": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=96&d=mm&r=g"
+    },
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/reviews/20"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/reviews"
+            }
+        ],
+        "up": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/products/31"
+            }
+        ],
+        "reviewer": [
+            {
+                "embeddable": true,
+                "href": "https://example.com/wp-json/wp/v2/users/1"
+            }
+        ]
+    }
+}
+

Delete a product review

+

This API helps you delete a product review.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/products/reviews/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/products/reviews/34?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/reviews/20", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/reviews/20', ['force' => true])); ?>
+
print(wcapi.delete("products/reviews/20", params={"force": True}).json())
+
woocommerce.delete("products/reviews/20", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+    "deleted": true,
+    "previous": {
+        "id": 20,
+        "date_created": "2018-09-08T21:47:19",
+        "date_created_gmt": "2018-09-09T00:47:19",
+        "product_id": 31,
+        "status": "trash",
+        "reviewer": "Claudio Sanches",
+        "reviewer_email": "john.doe@example.com",
+        "review": "Now works just fine.",
+        "rating": 5,
+        "verified": true,
+        "reviewer_avatar_urls": {
+            "24": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=24&d=mm&r=g",
+            "48": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=48&d=mm&r=g",
+            "96": "https://secure.gravatar.com/avatar/908480753c07509e76322dc17d305c8b?s=96&d=mm&r=g"
+        }
+    }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product reviews

+

This API helps you to batch create, update and delete multiple product reviews.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/products/reviews/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/products/reviews/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "product_id": 22,
+      "review": "Looks fine",
+      "reviewer": "John Doe",
+      "reviewer_email": "john.doe@example.com",
+      "rating": 4
+    },
+    {
+      "product_id": 22,
+      "review": "I love this album",
+      "reviewer": "John Doe",
+      "reviewer_email": "john.doe@example.com",
+      "rating": 5
+    }
+  ],
+  "update": [
+    {
+      "id": 7,
+      "reviewer": "John Doe",
+      "reviewer_email": "john.doe@example.com"
+    }
+  ],
+  "delete": [
+    22
+  ]
+}'
+
const data = {
+  create: [
+    {
+      product_id: 22,
+      review: "Looks fine",
+      reviewer: "John Doe",
+      reviewer_email: "john.doe@example.com",
+      rating: 4
+    },
+    {
+      product_id: 22,
+      review: "I love this album",
+      reviewer: "John Doe",
+      reviewer_email: "john.doe@example.com",
+      rating: 5
+    }
+  ],
+  update: [
+    {
+      id: 7,
+      reviewer: "John Doe",
+      reviewer_email: "john.doe@example.com"
+    }
+  ],
+  delete: [
+    22
+  ]
+};
+
+WooCommerce.post("products/reviews/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'product_id' => 22,
+            'review' => 'Looks fine',
+            'reviewer' => 'John Doe',
+            'reviewer_email' => 'john.doe@example.com',
+            'rating' => 4
+        ],
+        [
+            'product_id' => 22,
+            'review' => 'I love this album',
+            'reviewer' => 'John Doe',
+            'reviewer_email' => 'john.doe@example.com',
+            'rating' => 5
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 7,
+            'reviewer' => 'John Doe',
+            'reviewer_email' => 'john.doe@example.com',
+        ]
+    ],
+    'delete' => [
+        22
+    ]
+];
+
+print_r($woocommerce->post('products/reviews/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "product_id": 22,
+            "review": "Looks fine",
+            "reviewer": "John Doe",
+            "reviewer_email": "john.doe@example.com",
+            "rating": 4
+        },
+        {
+            "product_id": 22,
+            "review": "I love this album",
+            "reviewer": "John Doe",
+            "reviewer_email": "john.doe@example.com",
+            "rating": 5
+        }
+    ],
+    "update": [
+        {
+            "id": 7,
+            "reviewer": "John Doe",
+            "reviewer_email": "john.doe@example.com"
+        }
+    ],
+    "delete": [
+        22
+    ]
+}
+
+print(wcapi.post("products/reviews/batch", data).json())
+
data = {
+  create: [
+    {
+      product_id: "22",
+      review: "Looks fine",
+      reviewer: "John Doe",
+      reviewer_email: "john.doe@example.com",
+      rating: "4"
+    },
+    {
+      product_id: "22",
+      review: "I love this album",
+      reviewer: "John Doe",
+      reviewer_email: "john.doe@example.com",
+      rating: "5"
+    }
+  ],
+  update: [
+    {
+      id: 7,
+      reviewer: "John Doe"
+      reviewer_email: "john.doe@example.com"
+    }
+  ],
+  delete: [
+    22
+  ]
+}
+
+woocommerce.post("products/reviews/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+    "create": [
+        {
+            "id": 25,
+            "date_created": "2018-10-18T18:37:35",
+            "date_created_gmt": "2018-10-18T21:37:35",
+            "product_id": 22,
+            "status": "approved",
+            "reviewer": "John Doe",
+            "reviewer_email": "john.doe@example.com",
+            "review": "Looks fine",
+            "rating": 4,
+            "verified": false,
+            "reviewer_avatar_urls": {
+                "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+                "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+                "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+            },
+            "_links": {
+                "self": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/reviews/25"
+                    }
+                ],
+                "collection": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/reviews"
+                    }
+                ],
+                "up": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/22"
+                    }
+                ]
+            }
+        },
+        {
+            "id": 26,
+            "date_created": "2018-10-18T18:37:35",
+            "date_created_gmt": "2018-10-18T21:37:35",
+            "product_id": 22,
+            "status": "approved",
+            "reviewer": "John Doe",
+            "reviewer_email": "john.doe@example.com",
+            "review": "I love this album",
+            "rating": 5,
+            "verified": false,
+            "reviewer_avatar_urls": {
+                "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+                "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+                "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+            },
+            "_links": {
+                "self": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/reviews/26"
+                    }
+                ],
+                "collection": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/reviews"
+                    }
+                ],
+                "up": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/22"
+                    }
+                ]
+            }
+        }
+    ],
+    "update": [
+        {
+            "id": 7,
+            "date_created": "2018-07-26T19:29:21",
+            "date_created_gmt": "2018-07-26T22:29:21",
+            "product_id": 66,
+            "status": "approved",
+            "reviewer": "John Doe",
+            "reviewer_email": "john.doe@example.com",
+            "review": "Not so bad :(",
+            "rating": 3,
+            "verified": false,
+            "reviewer_avatar_urls": {
+                "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+                "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+                "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+            },
+            "_links": {
+                "self": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/reviews/7"
+                    }
+                ],
+                "collection": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/reviews"
+                    }
+                ],
+                "up": [
+                    {
+                        "href": "https://example.com/wp-json/wc/v3/products/66"
+                    }
+                ]
+            }
+        }
+    ],
+    "delete": [
+        {
+            "deleted": true,
+            "previous": {
+                "id": 22,
+                "date_created": "2018-10-18T17:59:17",
+                "date_created_gmt": "2018-10-18T20:59:17",
+                "product_id": 22,
+                "status": "approved",
+                "reviewer": "John Doe",
+                "reviewer_email": "john.doe@example.com",
+                "review": "Nice album!",
+                "rating": 5,
+                "verified": false,
+                "reviewer_avatar_urls": {
+                    "24": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=24&d=mm&r=g",
+                    "48": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=48&d=mm&r=g",
+                    "96": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96&d=mm&r=g"
+                }
+            }
+        }
+    ]
+}
+

Reports

+

The reports API allows you to view all types of reports available.

+

List all reports

+

This API lets you retrieve and view a simple list of available reports.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports
+
+
+
curl https://example.com/wp-json/wc/v3/reports \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('reports')); ?>
+
print(wcapi.get("reports").json())
+
woocommerce.get("reports").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "sales",
+        "description": "List of sales reports.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/sales"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "top_sellers",
+        "description": "List of top sellers products.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/top_sellers"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "orders/totals",
+        "description": "Orders totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/orders/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "products/totals",
+        "description": "Products totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/products/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "customers/totals",
+        "description": "Customers totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/customers/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "coupons/totals",
+        "description": "Coupons totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/coupons/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "reviews/totals",
+        "description": "Reviews totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/reviews/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "categories/totals",
+        "description": "Categories totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/categories/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "tags/totals",
+        "description": "Tags totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/tags/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "attributes/totals",
+        "description": "Attributes totals.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports/attributes/totals"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/reports"
+                }
+            ]
+        }
+    }
+]
+

Retrieve sales report

+

This API lets you retrieve and view a sales report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/sales
+
+
+
curl https://example.com/wp-json/wc/v3/reports/sales?date_min=2016-05-03&date_max=2016-05-04 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/sales", {
+  date_min: "2016-05-03",
+  date_max: "2016-05-04"
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$query = [
+    'date_min' => '2016-05-03', 
+    'date_max' => '2016-05-04'
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+
print(wcapi.get("reports/sales?date_min=2016-05-03&date_max=2016-05-04").json())
+
query = {
+  date_min: "2016-05-03",
+  date_max: "2016-05-04"
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "total_sales": "14.00",
+    "net_sales": "4.00",
+    "average_sales": "2.00",
+    "total_orders": 3,
+    "total_items": 6,
+    "total_tax": "0.00",
+    "total_shipping": "10.00",
+    "total_refunds": 0,
+    "total_discount": "0.00",
+    "totals_grouped_by": "day",
+    "totals": {
+      "2016-05-03": {
+        "sales": "14.00",
+        "orders": 3,
+        "items": 6,
+        "tax": "0.00",
+        "shipping": "10.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2016-05-04": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      }
+    },
+    "total_customers": 0,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/reports"
+        }
+      ]
+    }
+  }
+]
+

Sales report properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
total_salesstringGross sales in the period. read-only
net_salesstringNet sales in the period. read-only
average_salesstringAverage net daily sales. read-only
total_ordersintegerTotal of orders placed. read-only
total_itemsintegerTotal of items purchased. read-only
total_taxstringTotal charged for taxes. read-only
total_shippingstringTotal charged for shipping. read-only
total_refundsintegerTotal of refunded orders. read-only
total_discountintegerTotal of coupons used. read-only
totals_grouped_bystringGroup type. read-only
totalsarrayTotals. read-only
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is today's date. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.
+

Retrieve top sellers report

+

This API lets you retrieve and view a list of top sellers report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/top_sellers
+
+
+
curl https://example.com/wp-json/wc/v3/reports/top_sellers?period=last_month \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/top_sellers", {
+  period: "last_month"
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$query = [
+    'period' => 'last_month'
+];
+
+print_r($woocommerce->get('reports/top_sellers', $query));
+?>
+
print(wcapi.get("reports/top_sellers?period=last_month").json())
+
query = {
+  period: "last_month"
+}
+
+woocommerce.get("reports/top_sellers", query).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "title": "Happy Ninja",
+    "product_id": 37,
+    "quantity": 1,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/reports"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/37"
+        }
+      ]
+    }
+  },
+  {
+    "title": "Woo Album #4",
+    "product_id": 96,
+    "quantity": 1,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/reports"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/products/96"
+        }
+      ]
+    }
+  }
+]
+

Top sellers report properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
titlestringProduct title. read-only
product_idintegerProduct ID. read-only
quantityintegerTotal number of purchases. read-only
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is week. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.
+

Retrieve coupons totals

+

This API lets you retrieve and view coupons totals report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/coupons/totals
+
+
+
curl https://example.com/wp-json/wc/v3/reports/coupons/totals \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/coupons/totals")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('reports/coupons/totals'));
+?>
+
print(wcapi.get("reports/coupons/totals").json())
+
woocommerce.get("reports/coupons/totals").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "percent",
+        "name": "Percentage discount",
+        "total": 2
+    },
+    {
+        "slug": "fixed_cart",
+        "name": "Fixed cart discount",
+        "total": 1
+    },
+    {
+        "slug": "fixed_product",
+        "name": "Fixed product discount",
+        "total": 1
+    }
+]
+

Coupons totals properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringAn alphanumeric identifier for the resource. read-only
namestringCoupon type name. read-only
totalstringAmount of coupons. read-only
+

Retrieve customers totals

+

This API lets you retrieve and view customers totals report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/customers/totals
+
+
+
curl https://example.com/wp-json/wc/v3/reports/customers/totals \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/customers/totals")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('reports/customers/totals'));
+?>
+
print(wcapi.get("reports/customers/totals").json())
+
woocommerce.get("reports/customers/totals").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "paying",
+        "name": "Paying customer",
+        "total": 2
+    },
+    {
+        "slug": "non_paying",
+        "name": "Non-paying customer",
+        "total": 1
+    }
+]
+

Customers totals properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringAn alphanumeric identifier for the resource. read-only
namestringCustomer type name. read-only
totalstringAmount of customers. read-only
+

Retrieve orders totals

+

This API lets you retrieve and view orders totals report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/orders/totals
+
+
+
curl https://example.com/wp-json/wc/v3/reports/orders/totals \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/orders/totals")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('reports/orders/totals'));
+?>
+
print(wcapi.get("reports/orders/totals").json())
+
woocommerce.get("reports/orders/totals").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "pending",
+        "name": "Pending payment",
+        "total": 7
+    },
+    {
+        "slug": "processing",
+        "name": "Processing",
+        "total": 2
+    },
+    {
+        "slug": "on-hold",
+        "name": "On hold",
+        "total": 1
+    },
+    {
+        "slug": "completed",
+        "name": "Completed",
+        "total": 3
+    },
+    {
+        "slug": "cancelled",
+        "name": "Cancelled",
+        "total": 0
+    },
+    {
+        "slug": "refunded",
+        "name": "Refunded",
+        "total": 0
+    },
+    {
+        "slug": "failed",
+        "name": "Failed",
+        "total": 0
+    }
+]
+

Orders totals properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringAn alphanumeric identifier for the resource. read-only
namestringOrders status name. read-only
totalstringAmount of orders. read-only
+

Retrieve products totals

+

This API lets you retrieve and view products totals report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/products/totals
+
+
+
curl https://example.com/wp-json/wc/v3/reports/products/totals \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/products/totals")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('reports/products/totals'));
+?>
+
print(wcapi.get("reports/products/totals").json())
+
woocommerce.get("reports/products/totals").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "external",
+        "name": "External/Affiliate product",
+        "total": 1
+    },
+    {
+        "slug": "grouped",
+        "name": "Grouped product",
+        "total": 1
+    },
+    {
+        "slug": "simple",
+        "name": "Simple product",
+        "total": 21
+    },
+    {
+        "slug": "variable",
+        "name": "Variable product",
+        "total": 3
+    }
+]
+

Products totals properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringAn alphanumeric identifier for the resource. read-only
namestringProduct type name. read-only
totalstringAmount of products. read-only
+

Retrieve reviews totals

+

This API lets you retrieve and view reviews totals report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/reports/reviews/totals
+
+
+
curl https://example.com/wp-json/wc/v3/reports/reviews/totals \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/reviews/totals")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('reports/reviews/totals'));
+?>
+
print(wcapi.get("reports/reviews/totals").json())
+
woocommerce.get("reports/reviews/totals").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "rated_1_out_of_5",
+        "name": "Rated 1 out of 5",
+        "total": 1
+    },
+    {
+        "slug": "rated_2_out_of_5",
+        "name": "Rated 2 out of 5",
+        "total": 0
+    },
+    {
+        "slug": "rated_3_out_of_5",
+        "name": "Rated 3 out of 5",
+        "total": 3
+    },
+    {
+        "slug": "rated_4_out_of_5",
+        "name": "Rated 4 out of 5",
+        "total": 0
+    },
+    {
+        "slug": "rated_5_out_of_5",
+        "name": "Rated 5 out of 5",
+        "total": 4
+    }
+]
+

Reviews totals properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringAn alphanumeric identifier for the resource. read-only
namestringReview type name. read-only
totalstringAmount of reviews. read-only
+

Tax rates

+

The taxes API allows you to create, view, update, and delete individual tax rates, or a batch of tax rates.

+

Tax rate properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
countrystringCountry ISO 3166 code. See ISO 3166 Codes (Countries) for more details
statestringState code.
postcodestringPostcode/ZIP, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, postcodes should be used instead.
citystringCity name, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, postcodes should be used instead.
postcodesstring[]Postcodes/ZIPs. Introduced in WooCommerce 5.3.
citiesstring[]City names. Introduced in WooCommerce 5.3.
ratestringTax rate.
namestringTax rate name.
priorityintegerTax priority. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate. Default is 1.
compoundbooleanWhether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is false.
shippingbooleanWhether or not this tax rate also gets applied to shipping. Default is true.
orderintegerIndicates the order that will appear in queries.
classstringTax class. Default is standard.
+

Create a tax rate

+

This API helps you to create a new tax rate.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/taxes
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/taxes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "country": "US",
+  "state": "AL",
+  "cities": ["Alpine", "Brookside", "Cardiff"],
+  "postcodes": ["35014", "35036", "35041"],
+  "rate": "4",
+  "name": "State Tax",
+  "shipping": false
+}'
+
const data = {
+  country: "US",
+  state: "AL",
+  cities: ["Alpine", "Brookside", "Cardiff"],
+  postcodes: ["35014", "35036", "35041"],
+  rate: "4",
+  name: "State Tax",
+  shipping: false
+};
+
+WooCommerce.post("taxes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'country' => 'US',
+    'state' => 'AL',
+    'cities' => ['Alpine', 'Brookside', 'Cardiff'],
+    'postcodes' => ['35014', '35036', '35041'],
+    'rate' => '4',
+    'name' => 'State Tax',
+    'shipping' => false
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+
data = {
+    "country": "US",
+    "state": "AL",
+    "cities": ["Alpine", "Brookside", "Cardiff"],
+    "postcodes": ["35014", "35036", "35041"],
+    "rate": "4",
+    "name": "State Tax",
+    "shipping": False
+}
+
+print(wcapi.post("taxes", data).json())
+
data = {
+  country: "US",
+  state: "AL",
+  cities: ["Alpine", "Brookside", "Cardiff"],
+  postcodes: ["35014", "35036", "35041"],
+  rate: "4",
+  name: "State Tax",
+  shipping: false
+}
+
+woocommerce.post("taxes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "35041",
+  "city": "Cardiff",
+  "postcodes": [
+    "35014",
+    "35036",
+    "35041"
+  ],
+  "cities": [
+    "Alpine",
+    "Brookside",
+    "Cardiff"
+  ],
+  "rate": "4.0000",
+  "name": "State Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes"
+      }
+    ]
+  }
+}
+

Retrieve a tax rate

+

This API lets you retrieve and view a specific tax rate by ID.

+ +
+
+ GET +
/wp-json/wc/v3/taxes/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/taxes/72 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes/72")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes/72')); ?>
+
print(wcapi.get("taxes/72").json())
+
woocommerce.get("taxes/72").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "35041",
+  "city": "Cardiff",
+  "postcodes": [
+    "35014",
+    "35036",
+    "35041"
+  ],
+  "cities": [
+    "Alpine",
+    "Brookside",
+    "Cardiff"
+  ],
+  "rate": "4.0000",
+  "name": "State Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes"
+      }
+    ]
+  }
+}
+

List all tax rates

+

This API helps you to view all the tax rates.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/taxes
+
+
+
curl https://example.com/wp-json/wc/v3/taxes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes')); ?>
+
print(wcapi.get("taxes").json())
+
woocommerce.get("taxes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 72,
+    "country": "US",
+    "state": "AL",
+    "postcode": "35041",
+    "city": "Cardiff",
+    "postcodes": [
+      "35014",
+      "35036",
+      "35041"
+    ],
+    "cities": [
+      "Alpine",
+      "Brookside",
+      "Cardiff"
+    ],
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 1,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/72"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 73,
+    "country": "US",
+    "state": "AZ",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "5.6000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 2,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/73"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 74,
+    "country": "US",
+    "state": "AR",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "6.5000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 3,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/74"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 75,
+    "country": "US",
+    "state": "CA",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "7.5000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 4,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/75"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 76,
+    "country": "US",
+    "state": "CO",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "2.9000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 5,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/76"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 77,
+    "country": "US",
+    "state": "CT",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "6.3500",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 6,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/77"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 78,
+    "country": "US",
+    "state": "DC",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "5.7500",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 7,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/78"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 79,
+    "country": "US",
+    "state": "FL",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "6.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 8,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/79"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 80,
+    "country": "US",
+    "state": "GA",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 9,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/80"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 81,
+    "country": "US",
+    "state": "GU",
+    "postcode": "",
+    "city": "",
+    "postcodes": [],
+    "cities": [],
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 10,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/81"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is order. Options: id, order and priority.
classstringRetrieve only tax rates of this Tax class.
+

Update a tax rate

+

This API lets you make changes to a tax rate.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/taxes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/taxes/72 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "US Tax"
+}'
+
const data = {
+  name: "US Tax"
+};
+
+WooCommerce.put("taxes/72", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'US Tax'
+];
+
+print_r($woocommerce->put('taxes/72', $data));
+?>
+
data = {
+    "name": "US Tax"
+}
+
+print(wcapi.put("taxes/72", data).json())
+
data = {
+  name: "US Tax"
+}
+
+woocommerce.put("taxes/72", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "35041",
+  "city": "Cardiff",
+  "postcodes": [
+    "35014",
+    "35036",
+    "35041"
+  ],
+  "cities": [
+    "Alpine",
+    "Brookside",
+    "Cardiff"
+  ],
+  "rate": "4.0000",
+  "name": "US Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes"
+      }
+    ]
+  }
+}
+

Delete a tax rate

+

This API helps you delete a tax rate.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/taxes/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/taxes/72?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("taxes/72", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('taxes/72', ['force' => true])); ?>
+
print(wcapi.delete("taxes/72", params={"force": True}).json())
+
woocommerce.delete("taxes/72", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "35041",
+  "city": "Cardiff",
+  "postcodes": [
+    "35014",
+    "35036",
+    "35041"
+  ],
+  "cities": [
+    "Alpine",
+    "Brookside",
+    "Cardiff"
+  ],
+  "rate": "4.0000",
+  "name": "US Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update tax rates

+

This API helps you to batch create, update and delete multiple tax rates.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/taxes/batch
+
+
+ +
+

Example batch creating all US taxes:

+
+
curl -X POST https://example.com/wp-json/wc/v3/taxes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "country": "US",
+      "state": "AL",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 1
+    },
+    {
+      "country": "US",
+      "state": "AZ",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 2
+    },
+    {
+      "country": "US",
+      "state": "AR",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 3
+    },
+    {
+      "country": "US",
+      "state": "CA",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 4
+    },
+    {
+      "country": "US",
+      "state": "CO",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 5
+    },
+    {
+      "country": "US",
+      "state": "CT",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 6
+    },
+    {
+      "country": "US",
+      "state": "DC",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 7
+    },
+    {
+      "country": "US",
+      "state": "FL",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 8
+    },
+    {
+      "country": "US",
+      "state": "GA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 9
+    },
+    {
+      "country": "US",
+      "state": "GU",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 10
+    },
+    {
+      "country": "US",
+      "state": "HI",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 11
+    },
+    {
+      "country": "US",
+      "state": "ID",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 12
+    },
+    {
+      "country": "US",
+      "state": "IL",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 13
+    },
+    {
+      "country": "US",
+      "state": "IN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 14
+    },
+    {
+      "country": "US",
+      "state": "IA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 15
+    },
+    {
+      "country": "US",
+      "state": "KS",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 16
+    },
+    {
+      "country": "US",
+      "state": "KY",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 17
+    },
+    {
+      "country": "US",
+      "state": "LA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 18
+    },
+    {
+      "country": "US",
+      "state": "ME",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 19
+    },
+    {
+      "country": "US",
+      "state": "MD",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 20
+    },
+    {
+      "country": "US",
+      "state": "MA",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 21
+    },
+    {
+      "country": "US",
+      "state": "MI",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 22
+    },
+    {
+      "country": "US",
+      "state": "MN",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 23
+    },
+    {
+      "country": "US",
+      "state": "MS",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 24
+    },
+    {
+      "country": "US",
+      "state": "MO",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 25
+    },
+    {
+      "country": "US",
+      "state": "NE",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 26
+    },
+    {
+      "country": "US",
+      "state": "NV",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 27
+    },
+    {
+      "country": "US",
+      "state": "NJ",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 28
+    },
+    {
+      "country": "US",
+      "state": "NM",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 29
+    },
+    {
+      "country": "US",
+      "state": "NY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 30
+    },
+    {
+      "country": "US",
+      "state": "NC",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 31
+    },
+    {
+      "country": "US",
+      "state": "ND",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 32
+    },
+    {
+      "country": "US",
+      "state": "OH",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 33
+    },
+    {
+      "country": "US",
+      "state": "OK",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 34
+    },
+    {
+      "country": "US",
+      "state": "PA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 35
+    },
+    {
+      "country": "US",
+      "state": "PR",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 36
+    },
+    {
+      "country": "US",
+      "state": "RI",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 37
+    },
+    {
+      "country": "US",
+      "state": "SC",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 38
+    },
+    {
+      "country": "US",
+      "state": "SD",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 39
+    },
+    {
+      "country": "US",
+      "state": "TN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 40
+    },
+    {
+      "country": "US",
+      "state": "TX",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 41
+    },
+    {
+      "country": "US",
+      "state": "UT",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 42
+    },
+    {
+      "country": "US",
+      "state": "VT",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 43
+    },
+    {
+      "country": "US",
+      "state": "VA",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 44
+    },
+    {
+      "country": "US",
+      "state": "WA",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 45
+    },
+    {
+      "country": "US",
+      "state": "WV",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 46
+    },
+    {
+      "country": "US",
+      "state": "WI",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 47
+    },
+    {
+      "country": "US",
+      "state": "WY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 48
+    }
+  ]
+}'
+
const data = {
+  create: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+};
+
+WooCommerce.post("taxes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'country' => 'US',
+            'state' => 'AL',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 1
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AZ',
+            'rate' => '5.6000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 2
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AR',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 3
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CA',
+            'rate' => '7.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 4
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CO',
+            'rate' => '2.9000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 5
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CT',
+            'rate' => '6.3500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 6
+        ],
+        [
+            'country' => 'US',
+            'state' => 'DC',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 7
+        ],
+        [
+            'country' => 'US',
+            'state' => 'FL',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 8
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 9
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GU',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 10
+        ],
+        [
+            'country' => 'US',
+            'state' => 'HI',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 11
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ID',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 12
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IL',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 13
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 14
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 15
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KS',
+            'rate' => '6.1500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 16
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KY',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 17
+        ],
+        [
+            'country' => 'US',
+            'state' => 'LA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 18
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ME',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 19
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MD',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 20
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MA',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 21
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MI',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 22
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MN',
+            'rate' => '6.8750',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 23
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MS',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 24
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MO',
+            'rate' => '4.2250',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 25
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NE',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 26
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NV',
+            'rate' => '6.8500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 27
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NJ',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 28
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NM',
+            'rate' => '5.1250',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 29
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 30
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NC',
+            'rate' => '4.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 31
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ND',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 32
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OH',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 33
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OK',
+            'rate' => '4.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 34
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 35
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PR',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 36
+        ],
+        [
+            'country' => 'US',
+            'state' => 'RI',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 37
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SC',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 38
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SD',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 39
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 40
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TX',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 41
+        ],
+        [
+            'country' => 'US',
+            'state' => 'UT',
+            'rate' => '5.9500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 42
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VT',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 43
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VA',
+            'rate' => '5.3000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 44
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WA',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 45
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WV',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 46
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WI',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 47
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 48
+        ]
+    ]
+];
+
+print_r($woocommerce->post('taxes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "country": "US",
+            "state": "AL",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 1
+        },
+        {
+            "country": "US",
+            "state": "AZ",
+            "rate": "5.6000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 2
+        },
+        {
+            "country": "US",
+            "state": "AR",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 3
+        },
+        {
+            "country": "US",
+            "state": "CA",
+            "rate": "7.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 4
+        },
+        {
+            "country": "US",
+            "state": "CO",
+            "rate": "2.9000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 5
+        },
+        {
+            "country": "US",
+            "state": "CT",
+            "rate": "6.3500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 6
+        },
+        {
+            "country": "US",
+            "state": "DC",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 7
+        },
+        {
+            "country": "US",
+            "state": "FL",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 8
+        },
+        {
+            "country": "US",
+            "state": "GA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 9
+        },
+        {
+            "country": "US",
+            "state": "GU",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 10
+        },
+        {
+            "country": "US",
+            "state": "HI",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 11
+        },
+        {
+            "country": "US",
+            "state": "ID",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 12
+        },
+        {
+            "country": "US",
+            "state": "IL",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 13
+        },
+        {
+            "country": "US",
+            "state": "IN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 14
+        },
+        {
+            "country": "US",
+            "state": "IA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 15
+        },
+        {
+            "country": "US",
+            "state": "KS",
+            "rate": "6.1500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 16
+        },
+        {
+            "country": "US",
+            "state": "KY",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 17
+        },
+        {
+            "country": "US",
+            "state": "LA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 18
+        },
+        {
+            "country": "US",
+            "state": "ME",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 19
+        },
+        {
+            "country": "US",
+            "state": "MD",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 20
+        },
+        {
+            "country": "US",
+            "state": "MA",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 21
+        },
+        {
+            "country": "US",
+            "state": "MI",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 22
+        },
+        {
+            "country": "US",
+            "state": "MN",
+            "rate": "6.8750",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 23
+        },
+        {
+            "country": "US",
+            "state": "MS",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 24
+        },
+        {
+            "country": "US",
+            "state": "MO",
+            "rate": "4.2250",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 25
+        },
+        {
+            "country": "US",
+            "state": "NE",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 26
+        },
+        {
+            "country": "US",
+            "state": "NV",
+            "rate": "6.8500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 27
+        },
+        {
+            "country": "US",
+            "state": "NJ",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 28
+        },
+        {
+            "country": "US",
+            "state": "NM",
+            "rate": "5.1250",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 29
+        },
+        {
+            "country": "US",
+            "state": "NY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 30
+        },
+        {
+            "country": "US",
+            "state": "NC",
+            "rate": "4.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 31
+        },
+        {
+            "country": "US",
+            "state": "ND",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 32
+        },
+        {
+            "country": "US",
+            "state": "OH",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 33
+        },
+        {
+            "country": "US",
+            "state": "OK",
+            "rate": "4.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 34
+        },
+        {
+            "country": "US",
+            "state": "PA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 35
+        },
+        {
+            "country": "US",
+            "state": "PR",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 36
+        },
+        {
+            "country": "US",
+            "state": "RI",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 37
+        },
+        {
+            "country": "US",
+            "state": "SC",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 38
+        },
+        {
+            "country": "US",
+            "state": "SD",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 39
+        },
+        {
+            "country": "US",
+            "state": "TN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 40
+        },
+        {
+            "country": "US",
+            "state": "TX",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 41
+        },
+        {
+            "country": "US",
+            "state": "UT",
+            "rate": "5.9500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 42
+        },
+        {
+            "country": "US",
+            "state": "VT",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 43
+        },
+        {
+            "country": "US",
+            "state": "VA",
+            "rate": "5.3000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 44
+        },
+        {
+            "country": "US",
+            "state": "WA",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 45
+        },
+        {
+            "country": "US",
+            "state": "WV",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 46
+        },
+        {
+            "country": "US",
+            "state": "WI",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 47
+        },
+        {
+            "country": "US",
+            "state": "WY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 48
+        }
+    ]
+}
+
+print(wcapi.post("taxes/batch", data).json())
+
data = {
+  create: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+}
+
+woocommerce.post("taxes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 72,
+      "country": "US",
+      "state": "AL",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 1,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/72"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 73,
+      "country": "US",
+      "state": "AZ",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.6000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 2,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/73"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 74,
+      "country": "US",
+      "state": "AR",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 3,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/74"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 75,
+      "country": "US",
+      "state": "CA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "7.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 4,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/75"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 76,
+      "country": "US",
+      "state": "CO",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "2.9000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 5,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/76"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 77,
+      "country": "US",
+      "state": "CT",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.3500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 6,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/77"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 78,
+      "country": "US",
+      "state": "DC",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 7,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/78"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 79,
+      "country": "US",
+      "state": "FL",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 8,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/79"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 80,
+      "country": "US",
+      "state": "GA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 9,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/80"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 81,
+      "country": "US",
+      "state": "GU",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 10,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/81"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 82,
+      "country": "US",
+      "state": "HI",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 11,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/82"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 83,
+      "country": "US",
+      "state": "ID",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 12,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/83"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 84,
+      "country": "US",
+      "state": "IL",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 13,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/84"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 85,
+      "country": "US",
+      "state": "IN",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 14,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/85"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 86,
+      "country": "US",
+      "state": "IA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 15,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/86"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 87,
+      "country": "US",
+      "state": "KS",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.1500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 16,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/87"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 88,
+      "country": "US",
+      "state": "KY",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 17,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/88"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 89,
+      "country": "US",
+      "state": "LA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 18,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/89"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 90,
+      "country": "US",
+      "state": "ME",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 19,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/90"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 91,
+      "country": "US",
+      "state": "MD",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 20,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/91"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 92,
+      "country": "US",
+      "state": "MA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 21,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/92"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 93,
+      "country": "US",
+      "state": "MI",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 22,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/93"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 94,
+      "country": "US",
+      "state": "MN",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.8750",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 23,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/94"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 95,
+      "country": "US",
+      "state": "MS",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 24,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/95"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 96,
+      "country": "US",
+      "state": "MO",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.2250",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 25,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/96"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 97,
+      "country": "US",
+      "state": "NE",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 26,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/97"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 98,
+      "country": "US",
+      "state": "NV",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.8500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 27,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/98"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 99,
+      "country": "US",
+      "state": "NJ",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 28,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/99"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 100,
+      "country": "US",
+      "state": "NM",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.1250",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 29,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/100"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 101,
+      "country": "US",
+      "state": "NY",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 30,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/101"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 102,
+      "country": "US",
+      "state": "NC",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 31,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/102"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 103,
+      "country": "US",
+      "state": "ND",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 32,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/103"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 104,
+      "country": "US",
+      "state": "OH",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 33,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/104"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 105,
+      "country": "US",
+      "state": "OK",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 34,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/105"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 106,
+      "country": "US",
+      "state": "PA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 35,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/106"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 107,
+      "country": "US",
+      "state": "PR",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 36,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/107"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 108,
+      "country": "US",
+      "state": "RI",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 37,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/108"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 109,
+      "country": "US",
+      "state": "SC",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 38,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/109"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 110,
+      "country": "US",
+      "state": "SD",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 39,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/110"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 111,
+      "country": "US",
+      "state": "TN",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 40,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/111"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 112,
+      "country": "US",
+      "state": "TX",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 41,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/112"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 113,
+      "country": "US",
+      "state": "UT",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.9500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 42,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/113"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 114,
+      "country": "US",
+      "state": "VT",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 43,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/114"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 115,
+      "country": "US",
+      "state": "VA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.3000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 44,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/115"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 116,
+      "country": "US",
+      "state": "WA",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 45,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/116"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 117,
+      "country": "US",
+      "state": "WV",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 46,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/117"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 118,
+      "country": "US",
+      "state": "WI",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 47,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/118"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 119,
+      "country": "US",
+      "state": "WY",
+      "postcode": "",
+      "city": "",
+      "postcodes": [],
+      "cities": [],
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 48,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes/119"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/taxes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Tax classes

+

The tax classes API allows you to create, view, and delete individual tax classes.

+

Tax class properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringUnique identifier for the resource. read-only
namestringTax class name. required
+

Create a tax class

+

This API helps you to create a new tax class.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/taxes/classes
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/taxes/classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Zero Rate"
+}'
+
const data = {
+  name: "Zero Rate"
+};
+
+WooCommerce.post("taxes/classes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Zero Rate'
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+
data = {
+    "name": "Zero Rate"
+}
+
+print(wcapi.post("taxes/classes", data).json())
+
data = {
+  name: "Zero Rate"
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "slug": "zero-rate",
+  "name": "Zero Rate",
+  "_links": {
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+      }
+    ]
+  }
+}
+

List all tax classes

+

This API helps you to view all tax classes.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/taxes/classes
+
+
+
curl https://example.com/wp-json/wc/v3/taxes/classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes/classes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes/classes')); ?>
+
print(wcapi.get("taxes/classes").json())
+
woocommerce.get("taxes/classes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "slug": "standard",
+    "name": "Standard Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "reduced-rate",
+    "name": "Reduced Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "zero-rate",
+    "name": "Zero Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+        }
+      ]
+    }
+  }
+]
+

Delete a tax class

+

This API helps you delete a tax class.

+ + +

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/taxes/classes/<slug>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/taxes/classes/zero-rate?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("taxes/classes/zero-rate", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('taxes/classes/zero-rate', ['force' => true])); ?>
+
print(wcapi.delete("taxes/classes/zero-rate", params={"force": True}).json())
+
woocommerce.delete("taxes/classes/zero-rate", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "slug": "zero-rate",
+  "name": "Zero Rate",
+  "_links": {
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, since this resource does not support trashing.
+

Webhooks

+

The webhooks API allows you to create, view, update, and delete individual, or a batch, of webhooks.

+ +

Webhooks can be managed via the WooCommerce settings screen or by using the REST API endpoints. The WC_Webhook class manages all data storage and retrieval of the webhook custom post type, as well as enqueuing webhook actions and processing/delivering/logging webhooks. On woocommerce_init, active webhooks are loaded.

+ +

Each webhook has:

+ + +

Topics

+

The topic is a combination resource (e.g. order) and event (e.g. created) and maps to one or more hook names (e.g. woocommerce_checkout_order_processed). Webhooks can be created using the topic name and the appropriate hooks are automatically added.

+ +

Core topics are:

+ + + +

Custom topics can also be used which map to a single hook name, for example you could add a webhook with topic action.woocommerce_add_to_cart that is triggered on that event. Custom topics pass the first hook argument to the payload, so in this example the cart_item_key would be included in the payload.

+

Delivery/payload

+

Delivery is performed using wp_remote_post() (HTTP POST) and processed in the background by default using wp-cron. A few custom headers are added to the request to help the receiver process the webhook:

+ + + +

The payload is JSON encoded and for API resources (coupons, customers, orders, products), the response is exactly the same as if requested via the REST API.

+

Logging

+

Requests/responses are logged using the WooCommerce logging system. Each delivery log includes:

+ + + +

After 5 consecutive failed deliveries (as defined by a non HTTP 2xx response code), the webhook is disabled and must be edited via the REST API to re-enable.

+ +

Delivery logs can be accessed in "WooCommerce" > "Status" > "Logs".

+

Visual interface

+

You can find the Webhooks interface going to "WooCommerce" > "Settings" > "Advanced" > "Webhooks", see our Visual Webhooks docs for more details.

+

Webhook properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringA friendly name for the webhook.
statusstringWebhook status. Options: active, paused and disabled. Default is active.
topicstringWebhook topic. mandatory
resourcestringWebhook resource. read-only
eventstringWebhook event. read-only
hooksarrayWooCommerce action names associated with the webhook. read-only
delivery_urlstringThe URL where the webhook payload is delivered. read-only mandatory
secretstringSecret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID
date_createddate-timeThe date the webhook was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the webhook was created, as GMT. read-only
date_modifieddate-timeThe date the webhook was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the webhook was last modified, as GMT. read-only
+

Create a webhook

+

This API helps you to create a new webhook.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/webhooks
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/webhooks \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Order updated",
+  "topic": "order.updated",
+  "delivery_url": "http://requestb.in/1g0sxmo1"
+}'
+
const data = {
+  name: "Order updated",
+  topic: "order.updated",
+  delivery_url: "http://requestb.in/1g0sxmo1"
+};
+
+WooCommerce.post("webhooks", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Order updated',
+    'topic' => 'order.updated',
+    'delivery_url' => 'http://requestb.in/1g0sxmo1'
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+
data = {
+    "name": "Order updated",
+    "topic": "order.updated",
+    "delivery_url": "http://requestb.in/1g0sxmo1"
+}
+
+print(wcapi.post("webhooks", data).json())
+
data = {
+  name: "Order updated",
+  topic: "order.updated",
+  delivery_url: "http://requestb.in/1g0sxmo1"
+}
+
+woocommerce.post("webhooks", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "active",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T23:17:52",
+  "date_modified_gmt": "2016-05-15T20:17:52",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks"
+      }
+    ]
+  }
+}
+

Retrieve a webhook

+

This API lets you retrieve and view a specific webhook.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/webhooks/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/webhooks/142 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142')); ?>
+
print(wcapi.get("webhooks/142").json())
+
woocommerce.get("webhooks/142").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "active",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T23:17:52",
+  "date_modified_gmt": "2016-05-15T20:17:52",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks"
+      }
+    ]
+  }
+}
+

List all webhooks

+

This API helps you to view all the webhooks.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/webhooks
+
+
+
curl https://example.com/wp-json/wc/v3/webhooks \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks')); ?>
+
print(wcapi.get("webhooks").json())
+
woocommerce.get("webhooks").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 143,
+    "name": "Customer created",
+    "status": "active",
+    "topic": "customer.created",
+    "resource": "customer",
+    "event": "created",
+    "hooks": [
+      "user_register",
+      "woocommerce_created_customer",
+      "woocommerce_api_create_customer"
+    ],
+    "delivery_url": "http://requestb.in/1g0sxmo1",
+    "date_created": "2016-05-15T23:17:52",
+    "date_created_gmt": "2016-05-15T20:17:52",
+    "date_modified": "2016-05-15T23:17:52",
+    "date_modified_gmt": "2016-05-15T20:17:52",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/webhooks/143"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/webhooks"
+        }
+      ]
+    }
+  },
+  {
+    "id": 142,
+    "name": "Order updated",
+    "status": "active",
+    "topic": "order.updated",
+    "resource": "order",
+    "event": "updated",
+    "hooks": [
+      "woocommerce_process_shop_order_meta",
+      "woocommerce_api_edit_order",
+      "woocommerce_order_edit_status",
+      "woocommerce_order_status_changed"
+    ],
+    "delivery_url": "http://requestb.in/1g0sxmo1",
+    "date_created": "2016-05-15T23:17:52",
+    "date_created_gmt": "2016-05-15T20:17:52",
+    "date_modified": "2016-05-15T23:17:52",
+    "date_modified_gmt": "2016-05-15T20:17:52",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/webhooks/142"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/webhooks"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
statusstringLimit result set to webhooks assigned a specific status. Options: all, active, paused and disabled. Default is all.
+

Update a webhook

+

This API lets you make changes to a webhook.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/webhook/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/webhook/142 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "status": "paused"
+}'
+
const data = {
+  status: "paused"
+}
+
+WooCommerce.put("webhooks/142", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'status' => 'paused'
+];
+
+print_r($woocommerce->put('webhooks/142', $data));
+?>
+
data = {
+    "status": "paused"
+}
+
+print(wcapi.put("webhooks/142", data).json())
+
data = {
+  status: "paused"
+}
+
+woocommerce.put("webhooks/142", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "paused",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T17:30:12",
+  "date_modified_gmt": "2016-05-15T20:30:12",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks"
+      }
+    ]
+  }
+}
+

Delete a webhook

+

This API helps you delete a webhook.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/webhooks/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/webhooks/142 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("webhooks/142")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('webhooks/142')); ?>
+
print(wcapi.delete("webhooks/142").json())
+
woocommerce.delete("webhooks/142").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "paused",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T23:30:12",
+  "date_modified_gmt": "2016-05-15T20:30:12",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/webhooks"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the webhook, Defaults is false.
+

Batch update webhooks

+

This API helps you to batch create, update and delete multiple webhooks.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/webhooks/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v3/webhooks/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Coupon created",
+      "topic": "coupon.created",
+      "delivery_url": "http://requestb.in/1g0sxmo1"
+    },
+    {
+      "name": "Customer deleted",
+      "topic": "customer.deleted",
+      "delivery_url": "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  "delete": [
+    143
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Round toe",
+      topic: "coupon.created",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    },
+    {
+      name: "Customer deleted",
+      topic: "customer.deleted",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  delete: [
+    143
+  ]
+};
+
+WooCommerce.post("webhooks/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Round toe',
+            'topic' => 'coupon.created',
+            'delivery_url' => 'http://requestb.in/1g0sxmo1'
+        ],
+        [
+            'name' => 'Customer deleted',
+            'topic' => 'customer.deleted',
+            'delivery_url' => 'http://requestb.in/1g0sxmo1'
+        ]
+    ],
+    'delete' => [
+        143
+    ]
+];
+
+print_r($woocommerce->post('webhooks/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Round toe",
+            "topic": "coupon.created",
+            "delivery_url": "http://requestb.in/1g0sxmo1"
+        },
+        {
+            "name": "Customer deleted",
+            "topic": "customer.deleted",
+            "delivery_url": "http://requestb.in/1g0sxmo1"
+        }
+    ],
+    "delete": [
+        143
+    ]
+}
+
+print(wcapi.post("webhooks/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe",
+      topic: "coupon.created",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    },
+    {
+      name: "Customer deleted",
+      topic: "customer.deleted",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  delete: [
+    143
+  ]
+}
+
+woocommerce.post("webhooks/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 146,
+      "name": "Coupon created",
+      "status": "active",
+      "topic": "coupon.created",
+      "resource": "coupon",
+      "event": "created",
+      "hooks": [
+        "woocommerce_process_shop_coupon_meta",
+        "woocommerce_api_create_coupon"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-25T01:56:26",
+      "date_created_gmt": "2016-05-24T22:56:26",
+      "date_modified": "2016-05-25T01:56:26",
+      "date_modified_gmt": "2016-05-24T22:56:26",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/webhooks/146"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/webhooks"
+          }
+        ]
+      }
+    },
+    {
+      "id": 147,
+      "name": "Customer deleted",
+      "status": "active",
+      "topic": "customer.deleted",
+      "resource": "customer",
+      "event": "deleted",
+      "hooks": [
+        "delete_user"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-25T01:56:30",
+      "date_created_gmt": "2016-05-24T22:56:30",
+      "date_modified": "2016-05-25T01:56:30",
+      "date_modified_gmt": "2016-05-24T22:56:30",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/webhooks/147"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/webhooks"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 143,
+      "name": "Webhook created on May 24, 2016 @ 03:20 AM",
+      "status": "active",
+      "topic": "customer.created",
+      "resource": "customer",
+      "event": "created",
+      "hooks": [
+        "user_register",
+        "woocommerce_created_customer",
+        "woocommerce_api_create_customer"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-15T23:17:52",
+      "date_created_gmt": "2016-05-15T20:17:52",
+      "date_modified": "2016-05-15T23:17:52",
+      "date_modified_gmt": "2016-05-15T20:17:52",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/webhooks/143"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/webhooks"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Settings

+

The settings API allows you to view all groups of settings available.

+

Setting group properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier that can be used to link settings together. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
parent_idstringID of parent grouping. read-only
sub_groupsstringIDs for settings sub groups. read-only
+

List all settings groups

+

This API helps you to view all the settings groups.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/settings
+
+
+
curl https://example.com/wp-json/wc/v3/settings \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("settings")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('settings')); ?>
+
print(wcapi.get("settings").json())
+
woocommerce.get("settings").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "general",
+    "label": "General",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "products",
+    "label": "Products",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/products"
+        }
+      ]
+    }
+  },
+  {
+    "id": "tax",
+    "label": "Tax",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/tax"
+        }
+      ]
+    }
+  },
+  {
+    "id": "shipping",
+    "label": "Shipping",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/shipping"
+        }
+      ]
+    }
+  },
+  {
+    "id": "checkout",
+    "label": "Checkout",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/checkout"
+        }
+      ]
+    }
+  },
+  {
+    "id": "account",
+    "label": "Accounts",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/account"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email",
+    "label": "Emails",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [
+      "email_new_order",
+      "email_cancelled_order",
+      "email_failed_order",
+      "email_customer_on_hold_order",
+      "email_customer_processing_order",
+      "email_customer_completed_order",
+      "email_customer_refunded_order",
+      "email_customer_invoice",
+      "email_customer_note",
+      "email_customer_reset_password",
+      "email_customer_new_account"
+    ],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email"
+        }
+      ]
+    }
+  },
+  {
+    "id": "integration",
+    "label": "Integration",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/integration"
+        }
+      ]
+    }
+  },
+  {
+    "id": "api",
+    "label": "API",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/api"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_new_order",
+    "label": "New order",
+    "description": "New order emails are sent to chosen recipient(s) when a new order is received.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_new_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_cancelled_order",
+    "label": "Cancelled order",
+    "description": "Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold).",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_cancelled_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_failed_order",
+    "label": "Failed order",
+    "description": "Failed order emails are sent to chosen recipient(s) when orders have been marked failed (if they were previously processing or on-hold).",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_failed_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_on_hold_order",
+    "label": "Order on-hold",
+    "description": "This is an order notification sent to customers containing order details after an order is placed on-hold.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_on_hold_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_processing_order",
+    "label": "Processing order",
+    "description": "This is an order notification sent to customers containing order details after payment.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_processing_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_completed_order",
+    "label": "Completed order",
+    "description": "Order complete emails are sent to customers when their orders are marked completed and usually indicate that their orders have been shipped.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_completed_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_refunded_order",
+    "label": "Refunded order",
+    "description": "Order refunded emails are sent to customers when their orders are marked refunded.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_refunded_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_invoice",
+    "label": "Customer invoice",
+    "description": "Customer invoice emails can be sent to customers containing their order information and payment links.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_invoice"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_note",
+    "label": "Customer note",
+    "description": "Customer note emails are sent when you add a note to an order.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_note"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_reset_password",
+    "label": "Reset password",
+    "description": "Customer \"reset password\" emails are sent when customers reset their passwords.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_reset_password"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_new_account",
+    "label": "New account",
+    "description": "Customer \"new account\" emails are sent to the customer when a customer signs up via checkout or account pages.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/email_customer_new_account"
+        }
+      ]
+    }
+  }
+]
+

Setting options

Setting option properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the setting. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
valuemixedSetting value.
defaultmixedDefault value for the setting. read-only
tipstringAdditional help text shown to the user about the setting. read-only
placeholderstringPlaceholder text to be displayed in text inputs. read-only
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. read-only
optionsobjectArray of options (key value pairs) for inputs such as select, multiselect, and radio buttons. read-only
group_idstringAn identifier for the group this setting belongs to. read-only
+

Retrieve a setting option

+

This API lets you retrieve and view a specific setting option.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/settings/<group_id>/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("settings/general/woocommerce_allowed_countries")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('settings/general/woocommerce_allowed_countries')); ?>
+
print(wcapi.get("settings/general/woocommerce_allowed_countries").json())
+
woocommerce.get("settings/general/woocommerce_allowed_countries").parsed_response
+
+
+

JSON response example:

+
+
{
+    "id": "woocommerce_allowed_countries",
+    "label": "Selling location(s)",
+    "description": "This option lets you limit which countries you are willing to sell to.",
+    "type": "select",
+    "default": "all",
+    "options": {
+        "all": "Sell to all countries",
+        "all_except": "Sell to all countries, except for&hellip;",
+        "specific": "Sell to specific countries"
+    },
+    "tip": "This option lets you limit which countries you are willing to sell to.",
+    "value": "all",
+    "group_id": "general",
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/settings/general"
+            }
+        ]
+    }
+}
+

List all setting options

+

This API helps you to view all the setting options.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/settings/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/settings/general \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("settings/general")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('settings/general')); ?>
+
print(wcapi.get("settings/general").json())
+
woocommerce.get("settings/general").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "woocommerce_allowed_countries",
+    "label": "Selling location(s)",
+    "description": "This option lets you limit which countries you are willing to sell to.",
+    "type": "select",
+    "default": "all",
+    "options": {
+      "all": "Sell to all countries",
+      "all_except": "Sell to all countries, except for&hellip;",
+      "specific": "Sell to specific countries"
+    },
+    "tip": "This option lets you limit which countries you are willing to sell to.",
+    "value": "all",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_all_except_countries",
+    "label": "Sell to all countries, except for&hellip;",
+    "description": "",
+    "type": "multiselect",
+    "default": "",
+    "value": "",
+    "options": {
+      "AX": "&#197;land Islands",
+      "AF": "Afghanistan",
+      "AL": "Albania",
+      "DZ": "Algeria",
+      "AS": "American Samoa",
+      "AD": "Andorra",
+      "AO": "Angola",
+      "AI": "Anguilla",
+      "AQ": "Antarctica",
+      "AG": "Antigua and Barbuda",
+      "AR": "Argentina",
+      "AM": "Armenia",
+      "AW": "Aruba",
+      "AU": "Australia",
+      "AT": "Austria",
+      "AZ": "Azerbaijan",
+      "BS": "Bahamas",
+      "BH": "Bahrain",
+      "BD": "Bangladesh",
+      "BB": "Barbados",
+      "BY": "Belarus",
+      "PW": "Belau",
+      "BE": "Belgium",
+      "BZ": "Belize",
+      "BJ": "Benin",
+      "BM": "Bermuda",
+      "BT": "Bhutan",
+      "BO": "Bolivia",
+      "BQ": "Bonaire, Saint Eustatius and Saba",
+      "BA": "Bosnia and Herzegovina",
+      "BW": "Botswana",
+      "BV": "Bouvet Island",
+      "BR": "Brazil",
+      "IO": "British Indian Ocean Territory",
+      "VG": "British Virgin Islands",
+      "BN": "Brunei",
+      "BG": "Bulgaria",
+      "BF": "Burkina Faso",
+      "BI": "Burundi",
+      "KH": "Cambodia",
+      "CM": "Cameroon",
+      "CA": "Canada",
+      "CV": "Cape Verde",
+      "KY": "Cayman Islands",
+      "CF": "Central African Republic",
+      "TD": "Chad",
+      "CL": "Chile",
+      "CN": "China",
+      "CX": "Christmas Island",
+      "CC": "Cocos (Keeling) Islands",
+      "CO": "Colombia",
+      "KM": "Comoros",
+      "CG": "Congo (Brazzaville)",
+      "CD": "Congo (Kinshasa)",
+      "CK": "Cook Islands",
+      "CR": "Costa Rica",
+      "HR": "Croatia",
+      "CU": "Cuba",
+      "CW": "Cura&ccedil;ao",
+      "CY": "Cyprus",
+      "CZ": "Czech Republic",
+      "DK": "Denmark",
+      "DJ": "Djibouti",
+      "DM": "Dominica",
+      "DO": "Dominican Republic",
+      "EC": "Ecuador",
+      "EG": "Egypt",
+      "SV": "El Salvador",
+      "GQ": "Equatorial Guinea",
+      "ER": "Eritrea",
+      "EE": "Estonia",
+      "ET": "Ethiopia",
+      "FK": "Falkland Islands",
+      "FO": "Faroe Islands",
+      "FJ": "Fiji",
+      "FI": "Finland",
+      "FR": "France",
+      "GF": "French Guiana",
+      "PF": "French Polynesia",
+      "TF": "French Southern Territories",
+      "GA": "Gabon",
+      "GM": "Gambia",
+      "GE": "Georgia",
+      "DE": "Germany",
+      "GH": "Ghana",
+      "GI": "Gibraltar",
+      "GR": "Greece",
+      "GL": "Greenland",
+      "GD": "Grenada",
+      "GP": "Guadeloupe",
+      "GU": "Guam",
+      "GT": "Guatemala",
+      "GG": "Guernsey",
+      "GN": "Guinea",
+      "GW": "Guinea-Bissau",
+      "GY": "Guyana",
+      "HT": "Haiti",
+      "HM": "Heard Island and McDonald Islands",
+      "HN": "Honduras",
+      "HK": "Hong Kong",
+      "HU": "Hungary",
+      "IS": "Iceland",
+      "IN": "India",
+      "ID": "Indonesia",
+      "IR": "Iran",
+      "IQ": "Iraq",
+      "IE": "Ireland",
+      "IM": "Isle of Man",
+      "IL": "Israel",
+      "IT": "Italy",
+      "CI": "Ivory Coast",
+      "JM": "Jamaica",
+      "JP": "Japan",
+      "JE": "Jersey",
+      "JO": "Jordan",
+      "KZ": "Kazakhstan",
+      "KE": "Kenya",
+      "KI": "Kiribati",
+      "KW": "Kuwait",
+      "KG": "Kyrgyzstan",
+      "LA": "Laos",
+      "LV": "Latvia",
+      "LB": "Lebanon",
+      "LS": "Lesotho",
+      "LR": "Liberia",
+      "LY": "Libya",
+      "LI": "Liechtenstein",
+      "LT": "Lithuania",
+      "LU": "Luxembourg",
+      "MO": "Macao S.A.R., China",
+      "MK": "Macedonia",
+      "MG": "Madagascar",
+      "MW": "Malawi",
+      "MY": "Malaysia",
+      "MV": "Maldives",
+      "ML": "Mali",
+      "MT": "Malta",
+      "MH": "Marshall Islands",
+      "MQ": "Martinique",
+      "MR": "Mauritania",
+      "MU": "Mauritius",
+      "YT": "Mayotte",
+      "MX": "Mexico",
+      "FM": "Micronesia",
+      "MD": "Moldova",
+      "MC": "Monaco",
+      "MN": "Mongolia",
+      "ME": "Montenegro",
+      "MS": "Montserrat",
+      "MA": "Morocco",
+      "MZ": "Mozambique",
+      "MM": "Myanmar",
+      "NA": "Namibia",
+      "NR": "Nauru",
+      "NP": "Nepal",
+      "NL": "Netherlands",
+      "NC": "New Caledonia",
+      "NZ": "New Zealand",
+      "NI": "Nicaragua",
+      "NE": "Niger",
+      "NG": "Nigeria",
+      "NU": "Niue",
+      "NF": "Norfolk Island",
+      "KP": "North Korea",
+      "MP": "Northern Mariana Islands",
+      "NO": "Norway",
+      "OM": "Oman",
+      "PK": "Pakistan",
+      "PS": "Palestinian Territory",
+      "PA": "Panama",
+      "PG": "Papua New Guinea",
+      "PY": "Paraguay",
+      "PE": "Peru",
+      "PH": "Philippines",
+      "PN": "Pitcairn",
+      "PL": "Poland",
+      "PT": "Portugal",
+      "PR": "Puerto Rico",
+      "QA": "Qatar",
+      "RE": "Reunion",
+      "RO": "Romania",
+      "RU": "Russia",
+      "RW": "Rwanda",
+      "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
+      "BL": "Saint Barth&eacute;lemy",
+      "SH": "Saint Helena",
+      "KN": "Saint Kitts and Nevis",
+      "LC": "Saint Lucia",
+      "SX": "Saint Martin (Dutch part)",
+      "MF": "Saint Martin (French part)",
+      "PM": "Saint Pierre and Miquelon",
+      "VC": "Saint Vincent and the Grenadines",
+      "WS": "Samoa",
+      "SM": "San Marino",
+      "SA": "Saudi Arabia",
+      "SN": "Senegal",
+      "RS": "Serbia",
+      "SC": "Seychelles",
+      "SL": "Sierra Leone",
+      "SG": "Singapore",
+      "SK": "Slovakia",
+      "SI": "Slovenia",
+      "SB": "Solomon Islands",
+      "SO": "Somalia",
+      "ZA": "South Africa",
+      "GS": "South Georgia/Sandwich Islands",
+      "KR": "South Korea",
+      "SS": "South Sudan",
+      "ES": "Spain",
+      "LK": "Sri Lanka",
+      "SD": "Sudan",
+      "SR": "Suriname",
+      "SJ": "Svalbard and Jan Mayen",
+      "SZ": "Swaziland",
+      "SE": "Sweden",
+      "CH": "Switzerland",
+      "SY": "Syria",
+      "TW": "Taiwan",
+      "TJ": "Tajikistan",
+      "TZ": "Tanzania",
+      "TH": "Thailand",
+      "TL": "Timor-Leste",
+      "TG": "Togo",
+      "TK": "Tokelau",
+      "TO": "Tonga",
+      "TT": "Trinidad and Tobago",
+      "TN": "Tunisia",
+      "TR": "Turkey",
+      "TM": "Turkmenistan",
+      "TC": "Turks and Caicos Islands",
+      "TV": "Tuvalu",
+      "UG": "Uganda",
+      "UA": "Ukraine",
+      "AE": "United Arab Emirates",
+      "GB": "United Kingdom (UK)",
+      "US": "United States (US)",
+      "UM": "United States (US) Minor Outlying Islands",
+      "VI": "United States (US) Virgin Islands",
+      "UY": "Uruguay",
+      "UZ": "Uzbekistan",
+      "VU": "Vanuatu",
+      "VA": "Vatican",
+      "VE": "Venezuela",
+      "VN": "Vietnam",
+      "WF": "Wallis and Futuna",
+      "EH": "Western Sahara",
+      "YE": "Yemen",
+      "ZM": "Zambia",
+      "ZW": "Zimbabwe"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_all_except_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_specific_allowed_countries",
+    "label": "Sell to specific countries",
+    "description": "",
+    "type": "multiselect",
+    "default": "",
+    "value": "",
+    "options": {
+      "AX": "&#197;land Islands",
+      "AF": "Afghanistan",
+      "AL": "Albania",
+      "DZ": "Algeria",
+      "AS": "American Samoa",
+      "AD": "Andorra",
+      "AO": "Angola",
+      "AI": "Anguilla",
+      "AQ": "Antarctica",
+      "AG": "Antigua and Barbuda",
+      "AR": "Argentina",
+      "AM": "Armenia",
+      "AW": "Aruba",
+      "AU": "Australia",
+      "AT": "Austria",
+      "AZ": "Azerbaijan",
+      "BS": "Bahamas",
+      "BH": "Bahrain",
+      "BD": "Bangladesh",
+      "BB": "Barbados",
+      "BY": "Belarus",
+      "PW": "Belau",
+      "BE": "Belgium",
+      "BZ": "Belize",
+      "BJ": "Benin",
+      "BM": "Bermuda",
+      "BT": "Bhutan",
+      "BO": "Bolivia",
+      "BQ": "Bonaire, Saint Eustatius and Saba",
+      "BA": "Bosnia and Herzegovina",
+      "BW": "Botswana",
+      "BV": "Bouvet Island",
+      "BR": "Brazil",
+      "IO": "British Indian Ocean Territory",
+      "VG": "British Virgin Islands",
+      "BN": "Brunei",
+      "BG": "Bulgaria",
+      "BF": "Burkina Faso",
+      "BI": "Burundi",
+      "KH": "Cambodia",
+      "CM": "Cameroon",
+      "CA": "Canada",
+      "CV": "Cape Verde",
+      "KY": "Cayman Islands",
+      "CF": "Central African Republic",
+      "TD": "Chad",
+      "CL": "Chile",
+      "CN": "China",
+      "CX": "Christmas Island",
+      "CC": "Cocos (Keeling) Islands",
+      "CO": "Colombia",
+      "KM": "Comoros",
+      "CG": "Congo (Brazzaville)",
+      "CD": "Congo (Kinshasa)",
+      "CK": "Cook Islands",
+      "CR": "Costa Rica",
+      "HR": "Croatia",
+      "CU": "Cuba",
+      "CW": "Cura&ccedil;ao",
+      "CY": "Cyprus",
+      "CZ": "Czech Republic",
+      "DK": "Denmark",
+      "DJ": "Djibouti",
+      "DM": "Dominica",
+      "DO": "Dominican Republic",
+      "EC": "Ecuador",
+      "EG": "Egypt",
+      "SV": "El Salvador",
+      "GQ": "Equatorial Guinea",
+      "ER": "Eritrea",
+      "EE": "Estonia",
+      "ET": "Ethiopia",
+      "FK": "Falkland Islands",
+      "FO": "Faroe Islands",
+      "FJ": "Fiji",
+      "FI": "Finland",
+      "FR": "France",
+      "GF": "French Guiana",
+      "PF": "French Polynesia",
+      "TF": "French Southern Territories",
+      "GA": "Gabon",
+      "GM": "Gambia",
+      "GE": "Georgia",
+      "DE": "Germany",
+      "GH": "Ghana",
+      "GI": "Gibraltar",
+      "GR": "Greece",
+      "GL": "Greenland",
+      "GD": "Grenada",
+      "GP": "Guadeloupe",
+      "GU": "Guam",
+      "GT": "Guatemala",
+      "GG": "Guernsey",
+      "GN": "Guinea",
+      "GW": "Guinea-Bissau",
+      "GY": "Guyana",
+      "HT": "Haiti",
+      "HM": "Heard Island and McDonald Islands",
+      "HN": "Honduras",
+      "HK": "Hong Kong",
+      "HU": "Hungary",
+      "IS": "Iceland",
+      "IN": "India",
+      "ID": "Indonesia",
+      "IR": "Iran",
+      "IQ": "Iraq",
+      "IE": "Ireland",
+      "IM": "Isle of Man",
+      "IL": "Israel",
+      "IT": "Italy",
+      "CI": "Ivory Coast",
+      "JM": "Jamaica",
+      "JP": "Japan",
+      "JE": "Jersey",
+      "JO": "Jordan",
+      "KZ": "Kazakhstan",
+      "KE": "Kenya",
+      "KI": "Kiribati",
+      "KW": "Kuwait",
+      "KG": "Kyrgyzstan",
+      "LA": "Laos",
+      "LV": "Latvia",
+      "LB": "Lebanon",
+      "LS": "Lesotho",
+      "LR": "Liberia",
+      "LY": "Libya",
+      "LI": "Liechtenstein",
+      "LT": "Lithuania",
+      "LU": "Luxembourg",
+      "MO": "Macao S.A.R., China",
+      "MK": "Macedonia",
+      "MG": "Madagascar",
+      "MW": "Malawi",
+      "MY": "Malaysia",
+      "MV": "Maldives",
+      "ML": "Mali",
+      "MT": "Malta",
+      "MH": "Marshall Islands",
+      "MQ": "Martinique",
+      "MR": "Mauritania",
+      "MU": "Mauritius",
+      "YT": "Mayotte",
+      "MX": "Mexico",
+      "FM": "Micronesia",
+      "MD": "Moldova",
+      "MC": "Monaco",
+      "MN": "Mongolia",
+      "ME": "Montenegro",
+      "MS": "Montserrat",
+      "MA": "Morocco",
+      "MZ": "Mozambique",
+      "MM": "Myanmar",
+      "NA": "Namibia",
+      "NR": "Nauru",
+      "NP": "Nepal",
+      "NL": "Netherlands",
+      "NC": "New Caledonia",
+      "NZ": "New Zealand",
+      "NI": "Nicaragua",
+      "NE": "Niger",
+      "NG": "Nigeria",
+      "NU": "Niue",
+      "NF": "Norfolk Island",
+      "KP": "North Korea",
+      "MP": "Northern Mariana Islands",
+      "NO": "Norway",
+      "OM": "Oman",
+      "PK": "Pakistan",
+      "PS": "Palestinian Territory",
+      "PA": "Panama",
+      "PG": "Papua New Guinea",
+      "PY": "Paraguay",
+      "PE": "Peru",
+      "PH": "Philippines",
+      "PN": "Pitcairn",
+      "PL": "Poland",
+      "PT": "Portugal",
+      "PR": "Puerto Rico",
+      "QA": "Qatar",
+      "RE": "Reunion",
+      "RO": "Romania",
+      "RU": "Russia",
+      "RW": "Rwanda",
+      "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
+      "BL": "Saint Barth&eacute;lemy",
+      "SH": "Saint Helena",
+      "KN": "Saint Kitts and Nevis",
+      "LC": "Saint Lucia",
+      "SX": "Saint Martin (Dutch part)",
+      "MF": "Saint Martin (French part)",
+      "PM": "Saint Pierre and Miquelon",
+      "VC": "Saint Vincent and the Grenadines",
+      "WS": "Samoa",
+      "SM": "San Marino",
+      "SA": "Saudi Arabia",
+      "SN": "Senegal",
+      "RS": "Serbia",
+      "SC": "Seychelles",
+      "SL": "Sierra Leone",
+      "SG": "Singapore",
+      "SK": "Slovakia",
+      "SI": "Slovenia",
+      "SB": "Solomon Islands",
+      "SO": "Somalia",
+      "ZA": "South Africa",
+      "GS": "South Georgia/Sandwich Islands",
+      "KR": "South Korea",
+      "SS": "South Sudan",
+      "ES": "Spain",
+      "LK": "Sri Lanka",
+      "SD": "Sudan",
+      "SR": "Suriname",
+      "SJ": "Svalbard and Jan Mayen",
+      "SZ": "Swaziland",
+      "SE": "Sweden",
+      "CH": "Switzerland",
+      "SY": "Syria",
+      "TW": "Taiwan",
+      "TJ": "Tajikistan",
+      "TZ": "Tanzania",
+      "TH": "Thailand",
+      "TL": "Timor-Leste",
+      "TG": "Togo",
+      "TK": "Tokelau",
+      "TO": "Tonga",
+      "TT": "Trinidad and Tobago",
+      "TN": "Tunisia",
+      "TR": "Turkey",
+      "TM": "Turkmenistan",
+      "TC": "Turks and Caicos Islands",
+      "TV": "Tuvalu",
+      "UG": "Uganda",
+      "UA": "Ukraine",
+      "AE": "United Arab Emirates",
+      "GB": "United Kingdom (UK)",
+      "US": "United States (US)",
+      "UM": "United States (US) Minor Outlying Islands",
+      "VI": "United States (US) Virgin Islands",
+      "UY": "Uruguay",
+      "UZ": "Uzbekistan",
+      "VU": "Vanuatu",
+      "VA": "Vatican",
+      "VE": "Venezuela",
+      "VN": "Vietnam",
+      "WF": "Wallis and Futuna",
+      "EH": "Western Sahara",
+      "YE": "Yemen",
+      "ZM": "Zambia",
+      "ZW": "Zimbabwe"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_specific_allowed_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_ship_to_countries",
+    "label": "Shipping location(s)",
+    "description": "Choose which countries you want to ship to, or choose to ship to all locations you sell to.",
+    "type": "select",
+    "default": "",
+    "options": {
+      "": "Ship to all countries you sell to",
+      "all": "Ship to all countries",
+      "specific": "Ship to specific countries only",
+      "disabled": "Disable shipping &amp; shipping calculations"
+    },
+    "tip": "Choose which countries you want to ship to, or choose to ship to all locations you sell to.",
+    "value": "",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_ship_to_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_specific_ship_to_countries",
+    "label": "Ship to specific countries",
+    "description": "",
+    "type": "multiselect",
+    "default": "",
+    "value": "",
+    "options": {
+      "AX": "&#197;land Islands",
+      "AF": "Afghanistan",
+      "AL": "Albania",
+      "DZ": "Algeria",
+      "AS": "American Samoa",
+      "AD": "Andorra",
+      "AO": "Angola",
+      "AI": "Anguilla",
+      "AQ": "Antarctica",
+      "AG": "Antigua and Barbuda",
+      "AR": "Argentina",
+      "AM": "Armenia",
+      "AW": "Aruba",
+      "AU": "Australia",
+      "AT": "Austria",
+      "AZ": "Azerbaijan",
+      "BS": "Bahamas",
+      "BH": "Bahrain",
+      "BD": "Bangladesh",
+      "BB": "Barbados",
+      "BY": "Belarus",
+      "PW": "Belau",
+      "BE": "Belgium",
+      "BZ": "Belize",
+      "BJ": "Benin",
+      "BM": "Bermuda",
+      "BT": "Bhutan",
+      "BO": "Bolivia",
+      "BQ": "Bonaire, Saint Eustatius and Saba",
+      "BA": "Bosnia and Herzegovina",
+      "BW": "Botswana",
+      "BV": "Bouvet Island",
+      "BR": "Brazil",
+      "IO": "British Indian Ocean Territory",
+      "VG": "British Virgin Islands",
+      "BN": "Brunei",
+      "BG": "Bulgaria",
+      "BF": "Burkina Faso",
+      "BI": "Burundi",
+      "KH": "Cambodia",
+      "CM": "Cameroon",
+      "CA": "Canada",
+      "CV": "Cape Verde",
+      "KY": "Cayman Islands",
+      "CF": "Central African Republic",
+      "TD": "Chad",
+      "CL": "Chile",
+      "CN": "China",
+      "CX": "Christmas Island",
+      "CC": "Cocos (Keeling) Islands",
+      "CO": "Colombia",
+      "KM": "Comoros",
+      "CG": "Congo (Brazzaville)",
+      "CD": "Congo (Kinshasa)",
+      "CK": "Cook Islands",
+      "CR": "Costa Rica",
+      "HR": "Croatia",
+      "CU": "Cuba",
+      "CW": "Cura&ccedil;ao",
+      "CY": "Cyprus",
+      "CZ": "Czech Republic",
+      "DK": "Denmark",
+      "DJ": "Djibouti",
+      "DM": "Dominica",
+      "DO": "Dominican Republic",
+      "EC": "Ecuador",
+      "EG": "Egypt",
+      "SV": "El Salvador",
+      "GQ": "Equatorial Guinea",
+      "ER": "Eritrea",
+      "EE": "Estonia",
+      "ET": "Ethiopia",
+      "FK": "Falkland Islands",
+      "FO": "Faroe Islands",
+      "FJ": "Fiji",
+      "FI": "Finland",
+      "FR": "France",
+      "GF": "French Guiana",
+      "PF": "French Polynesia",
+      "TF": "French Southern Territories",
+      "GA": "Gabon",
+      "GM": "Gambia",
+      "GE": "Georgia",
+      "DE": "Germany",
+      "GH": "Ghana",
+      "GI": "Gibraltar",
+      "GR": "Greece",
+      "GL": "Greenland",
+      "GD": "Grenada",
+      "GP": "Guadeloupe",
+      "GU": "Guam",
+      "GT": "Guatemala",
+      "GG": "Guernsey",
+      "GN": "Guinea",
+      "GW": "Guinea-Bissau",
+      "GY": "Guyana",
+      "HT": "Haiti",
+      "HM": "Heard Island and McDonald Islands",
+      "HN": "Honduras",
+      "HK": "Hong Kong",
+      "HU": "Hungary",
+      "IS": "Iceland",
+      "IN": "India",
+      "ID": "Indonesia",
+      "IR": "Iran",
+      "IQ": "Iraq",
+      "IE": "Ireland",
+      "IM": "Isle of Man",
+      "IL": "Israel",
+      "IT": "Italy",
+      "CI": "Ivory Coast",
+      "JM": "Jamaica",
+      "JP": "Japan",
+      "JE": "Jersey",
+      "JO": "Jordan",
+      "KZ": "Kazakhstan",
+      "KE": "Kenya",
+      "KI": "Kiribati",
+      "KW": "Kuwait",
+      "KG": "Kyrgyzstan",
+      "LA": "Laos",
+      "LV": "Latvia",
+      "LB": "Lebanon",
+      "LS": "Lesotho",
+      "LR": "Liberia",
+      "LY": "Libya",
+      "LI": "Liechtenstein",
+      "LT": "Lithuania",
+      "LU": "Luxembourg",
+      "MO": "Macao S.A.R., China",
+      "MK": "Macedonia",
+      "MG": "Madagascar",
+      "MW": "Malawi",
+      "MY": "Malaysia",
+      "MV": "Maldives",
+      "ML": "Mali",
+      "MT": "Malta",
+      "MH": "Marshall Islands",
+      "MQ": "Martinique",
+      "MR": "Mauritania",
+      "MU": "Mauritius",
+      "YT": "Mayotte",
+      "MX": "Mexico",
+      "FM": "Micronesia",
+      "MD": "Moldova",
+      "MC": "Monaco",
+      "MN": "Mongolia",
+      "ME": "Montenegro",
+      "MS": "Montserrat",
+      "MA": "Morocco",
+      "MZ": "Mozambique",
+      "MM": "Myanmar",
+      "NA": "Namibia",
+      "NR": "Nauru",
+      "NP": "Nepal",
+      "NL": "Netherlands",
+      "NC": "New Caledonia",
+      "NZ": "New Zealand",
+      "NI": "Nicaragua",
+      "NE": "Niger",
+      "NG": "Nigeria",
+      "NU": "Niue",
+      "NF": "Norfolk Island",
+      "KP": "North Korea",
+      "MP": "Northern Mariana Islands",
+      "NO": "Norway",
+      "OM": "Oman",
+      "PK": "Pakistan",
+      "PS": "Palestinian Territory",
+      "PA": "Panama",
+      "PG": "Papua New Guinea",
+      "PY": "Paraguay",
+      "PE": "Peru",
+      "PH": "Philippines",
+      "PN": "Pitcairn",
+      "PL": "Poland",
+      "PT": "Portugal",
+      "PR": "Puerto Rico",
+      "QA": "Qatar",
+      "RE": "Reunion",
+      "RO": "Romania",
+      "RU": "Russia",
+      "RW": "Rwanda",
+      "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
+      "BL": "Saint Barth&eacute;lemy",
+      "SH": "Saint Helena",
+      "KN": "Saint Kitts and Nevis",
+      "LC": "Saint Lucia",
+      "SX": "Saint Martin (Dutch part)",
+      "MF": "Saint Martin (French part)",
+      "PM": "Saint Pierre and Miquelon",
+      "VC": "Saint Vincent and the Grenadines",
+      "WS": "Samoa",
+      "SM": "San Marino",
+      "SA": "Saudi Arabia",
+      "SN": "Senegal",
+      "RS": "Serbia",
+      "SC": "Seychelles",
+      "SL": "Sierra Leone",
+      "SG": "Singapore",
+      "SK": "Slovakia",
+      "SI": "Slovenia",
+      "SB": "Solomon Islands",
+      "SO": "Somalia",
+      "ZA": "South Africa",
+      "GS": "South Georgia/Sandwich Islands",
+      "KR": "South Korea",
+      "SS": "South Sudan",
+      "ES": "Spain",
+      "LK": "Sri Lanka",
+      "SD": "Sudan",
+      "SR": "Suriname",
+      "SJ": "Svalbard and Jan Mayen",
+      "SZ": "Swaziland",
+      "SE": "Sweden",
+      "CH": "Switzerland",
+      "SY": "Syria",
+      "TW": "Taiwan",
+      "TJ": "Tajikistan",
+      "TZ": "Tanzania",
+      "TH": "Thailand",
+      "TL": "Timor-Leste",
+      "TG": "Togo",
+      "TK": "Tokelau",
+      "TO": "Tonga",
+      "TT": "Trinidad and Tobago",
+      "TN": "Tunisia",
+      "TR": "Turkey",
+      "TM": "Turkmenistan",
+      "TC": "Turks and Caicos Islands",
+      "TV": "Tuvalu",
+      "UG": "Uganda",
+      "UA": "Ukraine",
+      "AE": "United Arab Emirates",
+      "GB": "United Kingdom (UK)",
+      "US": "United States (US)",
+      "UM": "United States (US) Minor Outlying Islands",
+      "VI": "United States (US) Virgin Islands",
+      "UY": "Uruguay",
+      "UZ": "Uzbekistan",
+      "VU": "Vanuatu",
+      "VA": "Vatican",
+      "VE": "Venezuela",
+      "VN": "Vietnam",
+      "WF": "Wallis and Futuna",
+      "EH": "Western Sahara",
+      "YE": "Yemen",
+      "ZM": "Zambia",
+      "ZW": "Zimbabwe"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_specific_ship_to_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_default_customer_address",
+    "label": "Default customer location",
+    "description": "",
+    "type": "select",
+    "default": "geolocation",
+    "options": {
+      "": "No location by default",
+      "base": "Shop base address",
+      "geolocation": "Geolocate",
+      "geolocation_ajax": "Geolocate (with page caching support)"
+    },
+    "tip": "This option determines a customers default location. The MaxMind GeoLite Database will be periodically downloaded to your wp-content directory if using geolocation.",
+    "value": "geolocation",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_default_customer_address"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_calc_taxes",
+    "label": "Enable taxes",
+    "description": "Enable taxes and tax calculations",
+    "type": "checkbox",
+    "default": "no",
+    "value": "yes",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_calc_taxes"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_demo_store",
+    "label": "Store notice",
+    "description": "Enable site-wide store notice text",
+    "type": "checkbox",
+    "default": "no",
+    "value": "no",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_demo_store"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_demo_store_notice",
+    "label": "Store notice text",
+    "description": "",
+    "type": "textarea",
+    "default": "This is a demo store for testing purposes &mdash; no orders shall be fulfilled.",
+    "value": "This is a demo store for testing purposes &mdash; no orders shall be fulfilled.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_demo_store_notice"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_currency",
+    "label": "Currency",
+    "description": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+    "type": "select",
+    "default": "GBP",
+    "options": {
+      "AED": "United Arab Emirates dirham (&#x62f;.&#x625;)",
+      "AFN": "Afghan afghani (&#x60b;)",
+      "ALL": "Albanian lek (L)",
+      "AMD": "Armenian dram (AMD)",
+      "ANG": "Netherlands Antillean guilder (&fnof;)",
+      "AOA": "Angolan kwanza (Kz)",
+      "ARS": "Argentine peso (&#36;)",
+      "AUD": "Australian dollar (&#36;)",
+      "AWG": "Aruban florin (&fnof;)",
+      "AZN": "Azerbaijani manat (AZN)",
+      "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+      "BBD": "Barbadian dollar (&#36;)",
+      "BDT": "Bangladeshi taka (&#2547;&nbsp;)",
+      "BGN": "Bulgarian lev (&#1083;&#1074;.)",
+      "BHD": "Bahraini dinar (.&#x62f;.&#x628;)",
+      "BIF": "Burundian franc (Fr)",
+      "BMD": "Bermudian dollar (&#36;)",
+      "BND": "Brunei dollar (&#36;)",
+      "BOB": "Bolivian boliviano (Bs.)",
+      "BRL": "Brazilian real (&#82;&#36;)",
+      "BSD": "Bahamian dollar (&#36;)",
+      "BTC": "Bitcoin (&#3647;)",
+      "BTN": "Bhutanese ngultrum (Nu.)",
+      "BWP": "Botswana pula (P)",
+      "BYR": "Belarusian ruble (Br)",
+      "BZD": "Belize dollar (&#36;)",
+      "CAD": "Canadian dollar (&#36;)",
+      "CDF": "Congolese franc (Fr)",
+      "CHF": "Swiss franc (&#67;&#72;&#70;)",
+      "CLP": "Chilean peso (&#36;)",
+      "CNY": "Chinese yuan (&yen;)",
+      "COP": "Colombian peso (&#36;)",
+      "CRC": "Costa Rican col&oacute;n (&#x20a1;)",
+      "CUC": "Cuban convertible peso (&#36;)",
+      "CUP": "Cuban peso (&#36;)",
+      "CVE": "Cape Verdean escudo (&#36;)",
+      "CZK": "Czech koruna (&#75;&#269;)",
+      "DJF": "Djiboutian franc (Fr)",
+      "DKK": "Danish krone (DKK)",
+      "DOP": "Dominican peso (RD&#36;)",
+      "DZD": "Algerian dinar (&#x62f;.&#x62c;)",
+      "EGP": "Egyptian pound (EGP)",
+      "ERN": "Eritrean nakfa (Nfk)",
+      "ETB": "Ethiopian birr (Br)",
+      "EUR": "Euro (&euro;)",
+      "FJD": "Fijian dollar (&#36;)",
+      "FKP": "Falkland Islands pound (&pound;)",
+      "GBP": "Pound sterling (&pound;)",
+      "GEL": "Georgian lari (&#x10da;)",
+      "GGP": "Guernsey pound (&pound;)",
+      "GHS": "Ghana cedi (&#x20b5;)",
+      "GIP": "Gibraltar pound (&pound;)",
+      "GMD": "Gambian dalasi (D)",
+      "GNF": "Guinean franc (Fr)",
+      "GTQ": "Guatemalan quetzal (Q)",
+      "GYD": "Guyanese dollar (&#36;)",
+      "HKD": "Hong Kong dollar (&#36;)",
+      "HNL": "Honduran lempira (L)",
+      "HRK": "Croatian kuna (Kn)",
+      "HTG": "Haitian gourde (G)",
+      "HUF": "Hungarian forint (&#70;&#116;)",
+      "IDR": "Indonesian rupiah (Rp)",
+      "ILS": "Israeli new shekel (&#8362;)",
+      "IMP": "Manx pound (&pound;)",
+      "INR": "Indian rupee (&#8377;)",
+      "IQD": "Iraqi dinar (&#x639;.&#x62f;)",
+      "IRR": "Iranian rial (&#xfdfc;)",
+      "IRT": "Iranian toman (&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;)",
+      "ISK": "Icelandic kr&oacute;na (kr.)",
+      "JEP": "Jersey pound (&pound;)",
+      "JMD": "Jamaican dollar (&#36;)",
+      "JOD": "Jordanian dinar (&#x62f;.&#x627;)",
+      "JPY": "Japanese yen (&yen;)",
+      "KES": "Kenyan shilling (KSh)",
+      "KGS": "Kyrgyzstani som (&#x441;&#x43e;&#x43c;)",
+      "KHR": "Cambodian riel (&#x17db;)",
+      "KMF": "Comorian franc (Fr)",
+      "KPW": "North Korean won (&#x20a9;)",
+      "KRW": "South Korean won (&#8361;)",
+      "KWD": "Kuwaiti dinar (&#x62f;.&#x643;)",
+      "KYD": "Cayman Islands dollar (&#36;)",
+      "KZT": "Kazakhstani tenge (KZT)",
+      "LAK": "Lao kip (&#8365;)",
+      "LBP": "Lebanese pound (&#x644;.&#x644;)",
+      "LKR": "Sri Lankan rupee (&#xdbb;&#xdd4;)",
+      "LRD": "Liberian dollar (&#36;)",
+      "LSL": "Lesotho loti (L)",
+      "LYD": "Libyan dinar (&#x644;.&#x62f;)",
+      "MAD": "Moroccan dirham (&#x62f;.&#x645;.)",
+      "MDL": "Moldovan leu (MDL)",
+      "MGA": "Malagasy ariary (Ar)",
+      "MKD": "Macedonian denar (&#x434;&#x435;&#x43d;)",
+      "MMK": "Burmese kyat (Ks)",
+      "MNT": "Mongolian t&ouml;gr&ouml;g (&#x20ae;)",
+      "MOP": "Macanese pataca (P)",
+      "MRO": "Mauritanian ouguiya (UM)",
+      "MUR": "Mauritian rupee (&#x20a8;)",
+      "MVR": "Maldivian rufiyaa (.&#x783;)",
+      "MWK": "Malawian kwacha (MK)",
+      "MXN": "Mexican peso (&#36;)",
+      "MYR": "Malaysian ringgit (&#82;&#77;)",
+      "MZN": "Mozambican metical (MT)",
+      "NAD": "Namibian dollar (&#36;)",
+      "NGN": "Nigerian naira (&#8358;)",
+      "NIO": "Nicaraguan c&oacute;rdoba (C&#36;)",
+      "NOK": "Norwegian krone (&#107;&#114;)",
+      "NPR": "Nepalese rupee (&#8360;)",
+      "NZD": "New Zealand dollar (&#36;)",
+      "OMR": "Omani rial (&#x631;.&#x639;.)",
+      "PAB": "Panamanian balboa (B/.)",
+      "PEN": "Peruvian nuevo sol (S/.)",
+      "PGK": "Papua New Guinean kina (K)",
+      "PHP": "Philippine peso (&#8369;)",
+      "PKR": "Pakistani rupee (&#8360;)",
+      "PLN": "Polish z&#x142;oty (&#122;&#322;)",
+      "PRB": "Transnistrian ruble (&#x440;.)",
+      "PYG": "Paraguayan guaran&iacute; (&#8370;)",
+      "QAR": "Qatari riyal (&#x631;.&#x642;)",
+      "RON": "Romanian leu (lei)",
+      "RSD": "Serbian dinar (&#x434;&#x438;&#x43d;.)",
+      "RUB": "Russian ruble (&#8381;)",
+      "RWF": "Rwandan franc (Fr)",
+      "SAR": "Saudi riyal (&#x631;.&#x633;)",
+      "SBD": "Solomon Islands dollar (&#36;)",
+      "SCR": "Seychellois rupee (&#x20a8;)",
+      "SDG": "Sudanese pound (&#x62c;.&#x633;.)",
+      "SEK": "Swedish krona (&#107;&#114;)",
+      "SGD": "Singapore dollar (&#36;)",
+      "SHP": "Saint Helena pound (&pound;)",
+      "SLL": "Sierra Leonean leone (Le)",
+      "SOS": "Somali shilling (Sh)",
+      "SRD": "Surinamese dollar (&#36;)",
+      "SSP": "South Sudanese pound (&pound;)",
+      "STD": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra (Db)",
+      "SYP": "Syrian pound (&#x644;.&#x633;)",
+      "SZL": "Swazi lilangeni (L)",
+      "THB": "Thai baht (&#3647;)",
+      "TJS": "Tajikistani somoni (&#x405;&#x41c;)",
+      "TMT": "Turkmenistan manat (m)",
+      "TND": "Tunisian dinar (&#x62f;.&#x62a;)",
+      "TOP": "Tongan pa&#x2bb;anga (T&#36;)",
+      "TRY": "Turkish lira (&#8378;)",
+      "TTD": "Trinidad and Tobago dollar (&#36;)",
+      "TWD": "New Taiwan dollar (&#78;&#84;&#36;)",
+      "TZS": "Tanzanian shilling (Sh)",
+      "UAH": "Ukrainian hryvnia (&#8372;)",
+      "UGX": "Ugandan shilling (UGX)",
+      "USD": "United States dollar (&#36;)",
+      "UYU": "Uruguayan peso (&#36;)",
+      "UZS": "Uzbekistani som (UZS)",
+      "VEF": "Venezuelan bol&iacute;var (Bs F)",
+      "VND": "Vietnamese &#x111;&#x1ed3;ng (&#8363;)",
+      "VUV": "Vanuatu vatu (Vt)",
+      "WST": "Samoan t&#x101;l&#x101; (T)",
+      "XAF": "Central African CFA franc (Fr)",
+      "XCD": "East Caribbean dollar (&#36;)",
+      "XOF": "West African CFA franc (Fr)",
+      "XPF": "CFP franc (Fr)",
+      "YER": "Yemeni rial (&#xfdfc;)",
+      "ZAR": "South African rand (&#82;)",
+      "ZMW": "Zambian kwacha (ZK)"
+    },
+    "tip": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+    "value": "USD",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_currency"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_currency_pos",
+    "label": "Currency position",
+    "description": "This controls the position of the currency symbol.",
+    "type": "select",
+    "default": "left",
+    "options": {
+      "left": "Left (&#36;99.99)",
+      "right": "Right (99.99&#36;)",
+      "left_space": "Left with space (&#36; 99.99)",
+      "right_space": "Right with space (99.99 &#36;)"
+    },
+    "tip": "This controls the position of the currency symbol.",
+    "value": "left",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_currency_pos"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_price_thousand_sep",
+    "label": "Thousand separator",
+    "description": "This sets the thousand separator of displayed prices.",
+    "type": "text",
+    "default": ",",
+    "tip": "This sets the thousand separator of displayed prices.",
+    "value": ",",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_price_thousand_sep"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_price_decimal_sep",
+    "label": "Decimal separator",
+    "description": "This sets the decimal separator of displayed prices.",
+    "type": "text",
+    "default": ".",
+    "tip": "This sets the decimal separator of displayed prices.",
+    "value": ".",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_price_decimal_sep"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_price_num_decimals",
+    "label": "Number of decimals",
+    "description": "This sets the number of decimal points shown in displayed prices.",
+    "type": "number",
+    "default": "2",
+    "tip": "This sets the number of decimal points shown in displayed prices.",
+    "value": "2",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_price_num_decimals"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/settings/general"
+        }
+      ]
+    }
+  }
+]
+

Update a setting option

+

This API lets you make changes to a setting option.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/settings/<group_id>/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "value": "all_except"
+}'
+
const data = {
+  value: "all_except"
+};
+
+WooCommerce.put("settings/general/woocommerce_allowed_countries", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'value' => 'all_except'
+];
+
+print_r($woocommerce->put('settings/general/woocommerce_allowed_countries', $data));
+?>
+
data = {
+    "value": "all_except"
+}
+
+print(wcapi.put("settings/general/woocommerce_allowed_countries", data).json())
+
data = {
+  value: "all_except"
+}
+
+woocommerce.put("settings/general/woocommerce_allowed_countries", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "woocommerce_allowed_countries",
+  "label": "Selling location(s)",
+  "description": "This option lets you limit which countries you are willing to sell to.",
+  "type": "select",
+  "default": "all",
+  "options": {
+    "all": "Sell to all countries",
+    "all_except": "Sell to all countries, except for&hellip;",
+    "specific": "Sell to specific countries"
+  },
+  "tip": "This option lets you limit which countries you are willing to sell to.",
+  "value": "all_except",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/settings/general"
+      }
+    ]
+  }
+}
+

Batch update setting options

+

This API helps you to batch update multiple setting options.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v3/settings/<id>/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v3/settings/general/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "update": [
+    {
+      "id": "woocommerce_allowed_countries",
+      "value": "all"
+    },
+    {
+      "id": "woocommerce_demo_store",
+      "value": "yes"
+    },
+    {
+      "id": "woocommerce_currency",
+      "value": "GBP"
+    }
+  ]
+}'
+
const data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+};
+
+WooCommerce.post("products/22/settings/general/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'Blue'
+                ]
+            ]
+        ],
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'White'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 733,
+            'regular_price' => '10.00'
+        ]
+    ],
+    'delete' => [
+        732
+    ]
+];
+
+print_r($woocommerce->post('products/22/settings/general/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "Blue"
+                }
+            ]
+        },
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "White"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 733,
+            "regular_price": "10.00"
+        }
+    ],
+    "delete": [
+        732
+    ]
+}
+
+print(wcapi.post("products/22/settings/general/batch", data).json())
+
data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+}
+
+woocommerce.post("products/22/settings/general/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "update": [
+    {
+      "id": "woocommerce_allowed_countries",
+      "label": "Selling location(s)",
+      "description": "This option lets you limit which countries you are willing to sell to.",
+      "type": "select",
+      "default": "all",
+      "options": {
+        "all": "Sell to all countries",
+        "all_except": "Sell to all countries, except for&hellip;",
+        "specific": "Sell to specific countries"
+      },
+      "tip": "This option lets you limit which countries you are willing to sell to.",
+      "value": "all",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/settings/general"
+          }
+        ]
+      }
+    },
+    {
+      "id": "woocommerce_demo_store",
+      "label": "Store notice",
+      "description": "Enable site-wide store notice text",
+      "type": "checkbox",
+      "default": "no",
+      "value": "yes",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_demo_store"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/settings/general"
+          }
+        ]
+      }
+    },
+    {
+      "id": "woocommerce_currency",
+      "label": "Currency",
+      "description": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+      "type": "select",
+      "default": "GBP",
+      "options": {
+        "AED": "United Arab Emirates dirham (&#x62f;.&#x625;)",
+        "AFN": "Afghan afghani (&#x60b;)",
+        "ALL": "Albanian lek (L)",
+        "AMD": "Armenian dram (AMD)",
+        "ANG": "Netherlands Antillean guilder (&fnof;)",
+        "AOA": "Angolan kwanza (Kz)",
+        "ARS": "Argentine peso (&#36;)",
+        "AUD": "Australian dollar (&#36;)",
+        "AWG": "Aruban florin (&fnof;)",
+        "AZN": "Azerbaijani manat (AZN)",
+        "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+        "BBD": "Barbadian dollar (&#36;)",
+        "BDT": "Bangladeshi taka (&#2547;&nbsp;)",
+        "BGN": "Bulgarian lev (&#1083;&#1074;.)",
+        "BHD": "Bahraini dinar (.&#x62f;.&#x628;)",
+        "BIF": "Burundian franc (Fr)",
+        "BMD": "Bermudian dollar (&#36;)",
+        "BND": "Brunei dollar (&#36;)",
+        "BOB": "Bolivian boliviano (Bs.)",
+        "BRL": "Brazilian real (&#82;&#36;)",
+        "BSD": "Bahamian dollar (&#36;)",
+        "BTC": "Bitcoin (&#3647;)",
+        "BTN": "Bhutanese ngultrum (Nu.)",
+        "BWP": "Botswana pula (P)",
+        "BYR": "Belarusian ruble (Br)",
+        "BZD": "Belize dollar (&#36;)",
+        "CAD": "Canadian dollar (&#36;)",
+        "CDF": "Congolese franc (Fr)",
+        "CHF": "Swiss franc (&#67;&#72;&#70;)",
+        "CLP": "Chilean peso (&#36;)",
+        "CNY": "Chinese yuan (&yen;)",
+        "COP": "Colombian peso (&#36;)",
+        "CRC": "Costa Rican col&oacute;n (&#x20a1;)",
+        "CUC": "Cuban convertible peso (&#36;)",
+        "CUP": "Cuban peso (&#36;)",
+        "CVE": "Cape Verdean escudo (&#36;)",
+        "CZK": "Czech koruna (&#75;&#269;)",
+        "DJF": "Djiboutian franc (Fr)",
+        "DKK": "Danish krone (DKK)",
+        "DOP": "Dominican peso (RD&#36;)",
+        "DZD": "Algerian dinar (&#x62f;.&#x62c;)",
+        "EGP": "Egyptian pound (EGP)",
+        "ERN": "Eritrean nakfa (Nfk)",
+        "ETB": "Ethiopian birr (Br)",
+        "EUR": "Euro (&euro;)",
+        "FJD": "Fijian dollar (&#36;)",
+        "FKP": "Falkland Islands pound (&pound;)",
+        "GBP": "Pound sterling (&pound;)",
+        "GEL": "Georgian lari (&#x10da;)",
+        "GGP": "Guernsey pound (&pound;)",
+        "GHS": "Ghana cedi (&#x20b5;)",
+        "GIP": "Gibraltar pound (&pound;)",
+        "GMD": "Gambian dalasi (D)",
+        "GNF": "Guinean franc (Fr)",
+        "GTQ": "Guatemalan quetzal (Q)",
+        "GYD": "Guyanese dollar (&#36;)",
+        "HKD": "Hong Kong dollar (&#36;)",
+        "HNL": "Honduran lempira (L)",
+        "HRK": "Croatian kuna (Kn)",
+        "HTG": "Haitian gourde (G)",
+        "HUF": "Hungarian forint (&#70;&#116;)",
+        "IDR": "Indonesian rupiah (Rp)",
+        "ILS": "Israeli new shekel (&#8362;)",
+        "IMP": "Manx pound (&pound;)",
+        "INR": "Indian rupee (&#8377;)",
+        "IQD": "Iraqi dinar (&#x639;.&#x62f;)",
+        "IRR": "Iranian rial (&#xfdfc;)",
+        "IRT": "Iranian toman (&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;)",
+        "ISK": "Icelandic kr&oacute;na (kr.)",
+        "JEP": "Jersey pound (&pound;)",
+        "JMD": "Jamaican dollar (&#36;)",
+        "JOD": "Jordanian dinar (&#x62f;.&#x627;)",
+        "JPY": "Japanese yen (&yen;)",
+        "KES": "Kenyan shilling (KSh)",
+        "KGS": "Kyrgyzstani som (&#x441;&#x43e;&#x43c;)",
+        "KHR": "Cambodian riel (&#x17db;)",
+        "KMF": "Comorian franc (Fr)",
+        "KPW": "North Korean won (&#x20a9;)",
+        "KRW": "South Korean won (&#8361;)",
+        "KWD": "Kuwaiti dinar (&#x62f;.&#x643;)",
+        "KYD": "Cayman Islands dollar (&#36;)",
+        "KZT": "Kazakhstani tenge (KZT)",
+        "LAK": "Lao kip (&#8365;)",
+        "LBP": "Lebanese pound (&#x644;.&#x644;)",
+        "LKR": "Sri Lankan rupee (&#xdbb;&#xdd4;)",
+        "LRD": "Liberian dollar (&#36;)",
+        "LSL": "Lesotho loti (L)",
+        "LYD": "Libyan dinar (&#x644;.&#x62f;)",
+        "MAD": "Moroccan dirham (&#x62f;.&#x645;.)",
+        "MDL": "Moldovan leu (MDL)",
+        "MGA": "Malagasy ariary (Ar)",
+        "MKD": "Macedonian denar (&#x434;&#x435;&#x43d;)",
+        "MMK": "Burmese kyat (Ks)",
+        "MNT": "Mongolian t&ouml;gr&ouml;g (&#x20ae;)",
+        "MOP": "Macanese pataca (P)",
+        "MRO": "Mauritanian ouguiya (UM)",
+        "MUR": "Mauritian rupee (&#x20a8;)",
+        "MVR": "Maldivian rufiyaa (.&#x783;)",
+        "MWK": "Malawian kwacha (MK)",
+        "MXN": "Mexican peso (&#36;)",
+        "MYR": "Malaysian ringgit (&#82;&#77;)",
+        "MZN": "Mozambican metical (MT)",
+        "NAD": "Namibian dollar (&#36;)",
+        "NGN": "Nigerian naira (&#8358;)",
+        "NIO": "Nicaraguan c&oacute;rdoba (C&#36;)",
+        "NOK": "Norwegian krone (&#107;&#114;)",
+        "NPR": "Nepalese rupee (&#8360;)",
+        "NZD": "New Zealand dollar (&#36;)",
+        "OMR": "Omani rial (&#x631;.&#x639;.)",
+        "PAB": "Panamanian balboa (B/.)",
+        "PEN": "Peruvian nuevo sol (S/.)",
+        "PGK": "Papua New Guinean kina (K)",
+        "PHP": "Philippine peso (&#8369;)",
+        "PKR": "Pakistani rupee (&#8360;)",
+        "PLN": "Polish z&#x142;oty (&#122;&#322;)",
+        "PRB": "Transnistrian ruble (&#x440;.)",
+        "PYG": "Paraguayan guaran&iacute; (&#8370;)",
+        "QAR": "Qatari riyal (&#x631;.&#x642;)",
+        "RON": "Romanian leu (lei)",
+        "RSD": "Serbian dinar (&#x434;&#x438;&#x43d;.)",
+        "RUB": "Russian ruble (&#8381;)",
+        "RWF": "Rwandan franc (Fr)",
+        "SAR": "Saudi riyal (&#x631;.&#x633;)",
+        "SBD": "Solomon Islands dollar (&#36;)",
+        "SCR": "Seychellois rupee (&#x20a8;)",
+        "SDG": "Sudanese pound (&#x62c;.&#x633;.)",
+        "SEK": "Swedish krona (&#107;&#114;)",
+        "SGD": "Singapore dollar (&#36;)",
+        "SHP": "Saint Helena pound (&pound;)",
+        "SLL": "Sierra Leonean leone (Le)",
+        "SOS": "Somali shilling (Sh)",
+        "SRD": "Surinamese dollar (&#36;)",
+        "SSP": "South Sudanese pound (&pound;)",
+        "STD": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra (Db)",
+        "SYP": "Syrian pound (&#x644;.&#x633;)",
+        "SZL": "Swazi lilangeni (L)",
+        "THB": "Thai baht (&#3647;)",
+        "TJS": "Tajikistani somoni (&#x405;&#x41c;)",
+        "TMT": "Turkmenistan manat (m)",
+        "TND": "Tunisian dinar (&#x62f;.&#x62a;)",
+        "TOP": "Tongan pa&#x2bb;anga (T&#36;)",
+        "TRY": "Turkish lira (&#8378;)",
+        "TTD": "Trinidad and Tobago dollar (&#36;)",
+        "TWD": "New Taiwan dollar (&#78;&#84;&#36;)",
+        "TZS": "Tanzanian shilling (Sh)",
+        "UAH": "Ukrainian hryvnia (&#8372;)",
+        "UGX": "Ugandan shilling (UGX)",
+        "USD": "United States dollar (&#36;)",
+        "UYU": "Uruguayan peso (&#36;)",
+        "UZS": "Uzbekistani som (UZS)",
+        "VEF": "Venezuelan bol&iacute;var (Bs F)",
+        "VND": "Vietnamese &#x111;&#x1ed3;ng (&#8363;)",
+        "VUV": "Vanuatu vatu (Vt)",
+        "WST": "Samoan t&#x101;l&#x101; (T)",
+        "XAF": "Central African CFA franc (Fr)",
+        "XCD": "East Caribbean dollar (&#36;)",
+        "XOF": "West African CFA franc (Fr)",
+        "XPF": "CFP franc (Fr)",
+        "YER": "Yemeni rial (&#xfdfc;)",
+        "ZAR": "South African rand (&#82;)",
+        "ZMW": "Zambian kwacha (ZK)"
+      },
+      "tip": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+      "value": "GBP",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/settings/general/woocommerce_currency"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v3/settings/general"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Payment gateways

+

The payment gateways API allows you to view, and update individual payment gateways. Results are not paginated - all gateways will be returned.

+

Payment gateway properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringPayment gateway ID. read-only
titlestringPayment gateway title on checkout.
descriptionstringPayment gateway description on checkout.
orderintegerPayment gateway sort order.
enabledbooleanPayment gateway enabled status.
method_titlestringPayment gateway method title. read-only
method_descriptionstringPayment gateway method description. read-only
method_supportsarraySupported features for this payment gateway. read-only
settingsobjectPayment gateway settings. See Payment gateway - Settings properties
+

Payment gateway - Settings properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the setting. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. read-only
valuestringSetting value.
defaultstringDefault value for the setting. read-only
tipstringAdditional help text shown to the user about the setting. read-only
placeholderstringPlaceholder text to be displayed in text inputs. read-only
+

Retrieve an payment gateway

+

This API lets you retrieve and view a specific payment gateway.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/payment_gateways/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/payment_gateways/bacs \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("payment_gateways/bacs")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('payment_gateways/bacs')); ?>
+
print(wcapi.get("payment_gateways/bacs").json())
+
woocommerce.get("payment_gateways/bacs").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "bacs",
+  "title": "Direct bank transfer",
+  "description": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+  "order": 0,
+  "enabled": true,
+  "method_title": "BACS",
+  "method_description": "Allows payments by BACS, more commonly known as direct bank/wire transfer.",
+    "method_supports": [
+      "products"
+    ],
+  "method_supports": [
+    "products"
+  ],
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Direct bank transfer",
+      "default": "Direct bank transfer",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "instructions": {
+      "id": "instructions",
+      "label": "Instructions",
+      "description": "Instructions that will be added to the thank you page and emails.",
+      "type": "textarea",
+      "value": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+      "default": "",
+      "tip": "Instructions that will be added to the thank you page and emails.",
+      "placeholder": ""
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/payment_gateways/bacs"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/payment_gateways"
+      }
+    ]
+  }
+}
+

List all payment gateways

+

This API helps you to view all the payment gateways.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/payment_gateways
+
+
+
curl https://example.com/wp-json/wc/v3/payment_gateways \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("payment_gateways")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('payment_gateways')); ?>
+
print(wcapi.get("payment_gateways").json())
+
woocommerce.get("payment_gateways").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "bacs",
+    "title": "Direct bank transfer",
+    "description": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+    "order": 0,
+    "enabled": true,
+    "method_title": "BACS",
+    "method_description": "Allows payments by BACS, more commonly known as direct bank/wire transfer.",
+    "method_supports": [
+      "products"
+    ],
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Direct bank transfer",
+        "default": "Direct bank transfer",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "instructions": {
+        "id": "instructions",
+        "label": "Instructions",
+        "description": "Instructions that will be added to the thank you page and emails.",
+        "type": "textarea",
+        "value": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+        "default": "",
+        "tip": "Instructions that will be added to the thank you page and emails.",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways/bacs"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways"
+        }
+      ]
+    }
+  },
+  {
+    "id": "cheque",
+    "title": "Check payments",
+    "description": "Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.",
+    "order": 1,
+    "enabled": false,
+    "method_title": "Check payments",
+    "method_description": "Allows check payments. Why would you take checks in this day and age? Well you probably wouldn't but it does allow you to make test purchases for testing order emails and the 'success' pages etc.",
+    "method_supports": [
+      "products"
+    ],
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Check payments",
+        "default": "Check payments",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "instructions": {
+        "id": "instructions",
+        "label": "Instructions",
+        "description": "Instructions that will be added to the thank you page and emails.",
+        "type": "textarea",
+        "value": "",
+        "default": "",
+        "tip": "Instructions that will be added to the thank you page and emails.",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways/cheque"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways"
+        }
+      ]
+    }
+  },
+  {
+    "id": "cod",
+    "title": "Cash on delivery",
+    "description": "Pay with cash upon delivery.",
+    "order": 2,
+    "enabled": false,
+    "method_title": "Cash on delivery",
+    "method_description": "Have your customers pay with cash (or by other means) upon delivery.",
+    "method_supports": [
+      "products"
+    ],
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "Payment method description that the customer will see on your checkout.",
+        "type": "text",
+        "value": "Cash on delivery",
+        "default": "Cash on delivery",
+        "tip": "Payment method description that the customer will see on your checkout.",
+        "placeholder": ""
+      },
+      "instructions": {
+        "id": "instructions",
+        "label": "Instructions",
+        "description": "Instructions that will be added to the thank you page.",
+        "type": "textarea",
+        "value": "",
+        "default": "Pay with cash upon delivery.",
+        "tip": "Instructions that will be added to the thank you page.",
+        "placeholder": ""
+      },
+      "enable_for_methods": {
+        "id": "enable_for_methods",
+        "label": "Enable for shipping methods",
+        "description": "If COD is only available for certain methods, set it up here. Leave blank to enable for all methods.",
+        "type": "multiselect",
+        "value": "",
+        "default": "",
+        "tip": "If COD is only available for certain methods, set it up here. Leave blank to enable for all methods.",
+        "placeholder": "",
+        "options": {
+          "flat_rate": "Flat rate",
+          "free_shipping": "Free shipping",
+          "local_pickup": "Local pickup"
+        }
+      },
+      "enable_for_virtual": {
+        "id": "enable_for_virtual",
+        "label": "Accept COD if the order is virtual",
+        "description": "",
+        "type": "checkbox",
+        "value": "yes",
+        "default": "yes",
+        "tip": "",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways/cod"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways"
+        }
+      ]
+    }
+  },
+  {
+    "id": "paypal",
+    "title": "PayPal",
+    "description": "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.",
+    "order": 3,
+    "enabled": true,
+    "method_title": "PayPal",
+    "method_description": "PayPal Standard sends customers to PayPal to enter their payment information. PayPal IPN requires fsockopen/cURL support to update order statuses after payment. Check the <a href=\"https://example.com/wp-admin/admin.php?page=wc-status\">system status</a> page for more details.",
+    "method_supports": [
+      "products",
+      "refunds"
+    ],
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "PayPal",
+        "default": "PayPal",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "email": {
+        "id": "email",
+        "label": "PayPal email",
+        "description": "Please enter your PayPal email address; this is needed in order to take payment.",
+        "type": "email",
+        "value": "me@example.com",
+        "default": "me@example.com",
+        "tip": "Please enter your PayPal email address; this is needed in order to take payment.",
+        "placeholder": "you@youremail.com"
+      },
+      "testmode": {
+        "id": "testmode",
+        "label": "Enable PayPal sandbox",
+        "description": "PayPal sandbox can be used to test payments. Sign up for a <a href=\"https://developer.paypal.com/\">developer account</a>.",
+        "type": "checkbox",
+        "value": "yes",
+        "default": "no",
+        "tip": "PayPal sandbox can be used to test payments. Sign up for a <a href=\"https://developer.paypal.com/\">developer account</a>.",
+        "placeholder": ""
+      },
+      "debug": {
+        "id": "debug",
+        "label": "Enable logging",
+        "description": "Log PayPal events, such as IPN requests, inside <code>/var/www/woocommerce/wp-content/uploads/wc-logs/paypal-de01f7c6894774e7ac8e4207bb8bac2f.log</code>",
+        "type": "checkbox",
+        "value": "yes",
+        "default": "no",
+        "tip": "Log PayPal events, such as IPN requests, inside <code>/var/www/woocommerce/wp-content/uploads/wc-logs/paypal-de01f7c6894774e7ac8e4207bb8bac2f.log</code>",
+        "placeholder": ""
+      },
+      "receiver_email": {
+        "id": "receiver_email",
+        "label": "Receiver email",
+        "description": "If your main PayPal email differs from the PayPal email entered above, input your main receiver email for your PayPal account here. This is used to validate IPN requests.",
+        "type": "email",
+        "value": "me@example.com",
+        "default": "",
+        "tip": "If your main PayPal email differs from the PayPal email entered above, input your main receiver email for your PayPal account here. This is used to validate IPN requests.",
+        "placeholder": "you@youremail.com"
+      },
+      "identity_token": {
+        "id": "identity_token",
+        "label": "PayPal identity token",
+        "description": "Optionally enable \"Payment Data Transfer\" (Profile > Profile and Settings > My Selling Tools > Website Preferences) and then copy your identity token here. This will allow payments to be verified without the need for PayPal IPN.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Optionally enable \"Payment Data Transfer\" (Profile > Profile and Settings > My Selling Tools > Website Preferences) and then copy your identity token here. This will allow payments to be verified without the need for PayPal IPN.",
+        "placeholder": ""
+      },
+      "invoice_prefix": {
+        "id": "invoice_prefix",
+        "label": "Invoice prefix",
+        "description": "Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number.",
+        "type": "text",
+        "value": "WC-",
+        "default": "WC-",
+        "tip": "Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number.",
+        "placeholder": ""
+      },
+      "send_shipping": {
+        "id": "send_shipping",
+        "label": "Send shipping details to PayPal instead of billing.",
+        "description": "PayPal allows us to send one address. If you are using PayPal for shipping labels you may prefer to send the shipping address rather than billing.",
+        "type": "checkbox",
+        "value": "no",
+        "default": "no",
+        "tip": "PayPal allows us to send one address. If you are using PayPal for shipping labels you may prefer to send the shipping address rather than billing.",
+        "placeholder": ""
+      },
+      "address_override": {
+        "id": "address_override",
+        "label": "Enable \"address_override\" to prevent address information from being changed.",
+        "description": "PayPal verifies addresses therefore this setting can cause errors (we recommend keeping it disabled).",
+        "type": "checkbox",
+        "value": "no",
+        "default": "no",
+        "tip": "PayPal verifies addresses therefore this setting can cause errors (we recommend keeping it disabled).",
+        "placeholder": ""
+      },
+      "paymentaction": {
+        "id": "paymentaction",
+        "label": "Payment action",
+        "description": "Choose whether you wish to capture funds immediately or authorize payment only.",
+        "type": "select",
+        "value": "sale",
+        "default": "sale",
+        "tip": "Choose whether you wish to capture funds immediately or authorize payment only.",
+        "placeholder": "",
+        "options": {
+          "sale": "Capture",
+          "authorization": "Authorize"
+        }
+      },
+      "page_style": {
+        "id": "page_style",
+        "label": "Page style",
+        "description": "Optionally enter the name of the page style you wish to use. These are defined within your PayPal account. This affects classic PayPal checkout screens.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Optionally enter the name of the page style you wish to use. These are defined within your PayPal account. This affects classic PayPal checkout screens.",
+        "placeholder": "Optional"
+      },
+      "image_url": {
+        "id": "image_url",
+        "label": "Image url",
+        "description": "Optionally enter the URL to a 150x50px image displayed as your logo in the upper left corner of the PayPal checkout pages.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Optionally enter the URL to a 150x50px image displayed as your logo in the upper left corner of the PayPal checkout pages.",
+        "placeholder": "Optional"
+      },
+      "api_username": {
+        "id": "api_username",
+        "label": "API username",
+        "description": "Get your API credentials from PayPal.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Get your API credentials from PayPal.",
+        "placeholder": "Optional"
+      },
+      "api_password": {
+        "id": "api_password",
+        "label": "API password",
+        "description": "Get your API credentials from PayPal.",
+        "type": "password",
+        "value": "",
+        "default": "",
+        "tip": "Get your API credentials from PayPal.",
+        "placeholder": "Optional"
+      },
+      "api_signature": {
+        "id": "api_signature",
+        "label": "API signature",
+        "description": "Get your API credentials from PayPal.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Get your API credentials from PayPal.",
+        "placeholder": "Optional"
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways/paypal"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/payment_gateways"
+        }
+      ]
+    }
+  }
+]
+

Update a payment gateway

+

This API lets you make changes to a payment gateway.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/payment_gateways/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/payment_gateways/bacs \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "enabled": false
+}'
+
const data = {
+  enabled: true
+};
+
+WooCommerce.put("payment_gateways/bacs", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'enabled' => true
+];
+
+print_r($woocommerce->put('payment_gateways/bacs', $data));
+?>
+
data = {
+    "enabled": True
+}
+
+print(wcapi.put("payment_gateways/bacs", data).json())
+
data = {
+  enabled: true
+}
+
+woocommerce.put("payment_gateways/bacs", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "bacs",
+  "title": "Direct bank transfer",
+  "description": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+  "order": 0,
+  "enabled": false,
+  "method_title": "BACS",
+  "method_description": "Allows payments by BACS, more commonly known as direct bank/wire transfer.",
+  "method_supports": [
+    "products"
+  ],
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Direct bank transfer",
+      "default": "Direct bank transfer",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "instructions": {
+      "id": "instructions",
+      "label": "Instructions",
+      "description": "Instructions that will be added to the thank you page and emails.",
+      "type": "textarea",
+      "value": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+      "default": "",
+      "tip": "Instructions that will be added to the thank you page and emails.",
+      "placeholder": ""
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/payment_gateways/bacs"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/payment_gateways"
+      }
+    ]
+  }
+}
+

Shipping zones

+

The shipping zones API allows you to create, view, update, and delete individual shipping zones.

+

Shipping zone properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringShipping zone name. mandatory
orderintegerShipping zone order.
+

Create a shipping zone

+

This API helps you to create a new shipping zone.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/shipping/zones
+
+
+ +
+

JSON response example:

+
+
curl -X POST https://example.com/wp-json/wc/v3/shipping/zones \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Brazil"
+}'
+
const data = {
+  name: "Brazil"
+};
+
+WooCommerce.post("shipping/zones", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Brazil'
+];
+
+print_r($woocommerce->post('shipping/zones', $data));
+?>
+
data = {
+    "name": "Brazil"
+}
+
+print(wcapi.post("shipping/zones", data).json())
+
data = {
+  name: "Brazil"
+}
+
+woocommerce.post("shipping/zones", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

Retrieve a shipping zone

+

This API lets you retrieve and view a specific shipping zone by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping/zones/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/shipping/zones/5 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5')); ?>
+
print(wcapi.get("shipping/zones/5").json())
+
woocommerce.get("shipping/zones/5").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

List all shipping zones

+

This API helps you to view all the shipping zones.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping/zones
+
+
+
curl https://example.com/wp-json/wc/v3/shipping/zones \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones')); ?>
+
print(wcapi.get("shipping/zones").json())
+
woocommerce.get("shipping/zones").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 0,
+    "name": "Rest of the World",
+    "order": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/0"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones"
+        }
+      ],
+      "describedby": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/0/locations"
+        }
+      ]
+    }
+  },
+  {
+    "id": 5,
+    "name": "Brazil",
+    "order": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones"
+        }
+      ],
+      "describedby": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+        }
+      ]
+    }
+  }
+]
+

Update a shipping zone

+

This API lets you make changes to a shipping zone.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/shipping/zones/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/shipping/zones/5 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order": 1
+}'
+
const data = {
+  order: 1
+};
+
+WooCommerce.put("shipping/zones/5", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'order' => 1
+];
+
+print_r($woocommerce->put('shipping/zones/5', $data));
+?>
+
data = {
+    "order": 1
+}
+
+print(wcapi.put("shipping/zones/5", data).json())
+
data = {
+  order: 1
+}
+
+woocommerce.put("shipping/zones/5", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

Delete a shipping zone

+

This API helps you delete a shipping zone.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/shipping/zones/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/shipping/zones/5?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("shipping/zones/5", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('shipping/zones/5', ['force' => true])); ?>
+
print(wcapi.delete("shipping/zones/5", params={"force": True}).json())
+
woocommerce.delete("shipping/zones/5", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Shipping zone locations

+

The shipping zone locations API allows you to view and batch update locations of a shipping zone.

+

Shipping location properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringShipping zone location code.
typestringShipping zone location type. Options: postcode, state, country and continent. Default is country.
+

List all locations of a shipping zone

+

This API helps you to view all the locations of a shipping zone.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping/zones/<id>/locations
+
+
+
curl https://example.com/wp-json/wc/v3/shipping/zones/5/locations \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5/locations")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5/locations')); ?>
+
print(wcapi.get("shipping/zones/5/locations").json())
+
woocommerce.get("shipping/zones/5/locations").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "code": "BR",
+    "type": "country",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+        }
+      ]
+    }
+  }
+]
+

Update a locations of a shipping zone

+

This API lets you make changes to locations of a shipping zone.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/shipping/zones/<id>/locations
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/shipping/zones/5/locations \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '[
+  {
+    "code": "BR:SP",
+    "type": "state"
+  },
+  {
+    "code": "BR:RJ",
+    "type": "state"
+  }
+]'
+
var data = [
+  {
+    code: 'BR:SP',
+    type: 'state'
+  },
+  {
+    code: 'BR:RJ',
+    type: 'state'
+  }
+];
+
+WooCommerce.put("shipping/zones/5/locations", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    [
+        'code' => 'BR:SP',
+        'type' => 'state'
+    ],
+    [
+        'code' => 'BR:RJ',
+        'type' => 'state'
+    ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/locations', $data));
+?>
+
data = [
+    {
+        "code": "BR:SP",
+        "type": "state"
+    },
+    {
+        "code": "BR:RJ",
+        "type": "state"
+    }
+]
+
+print(wcapi.put("shipping/zones/5/locations", data).json())
+
data = [
+  {
+    code: "BR:SP",
+    type: "state"
+  },
+  {
+    code: "BR:RJ",
+    type: "state"
+  }
+]
+
+woocommerce.put("shipping/zones/5/locations", data).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "code": "BR:SP",
+    "type": "state",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+        }
+      ]
+    }
+  },
+  {
+    "code": "BR:RJ",
+    "type": "state",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/locations"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+        }
+      ]
+    }
+  }
+]
+

Shipping zone methods

+

The shipping zone methods API allows you to create, view, update, and delete individual methods of a shipping zone.

+

Shipping method properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
instance_idintegerShipping method instance ID. read-only
titlestringShipping method customer facing title. read-only
orderintegerShipping method sort order.
enabledbooleanShipping method enabled status.
method_idstringShipping method ID. read-only mandatory
method_titlestringShipping method title. read-only
method_descriptionstringShipping method description. read-only
settingsobjectShipping method settings. See Shipping method - Settings properties
+

Shipping method - Settings properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the setting. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. read-only
valuestringSetting value.
defaultstringDefault value for the setting. read-only
tipstringAdditional help text shown to the user about the setting. read-only
placeholderstringPlaceholder text to be displayed in text inputs. read-only
+

Include a shipping method to a shipping zone

+

This API helps you to create a new shipping method to a shipping zone.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v3/shipping/zones/<id>/methods
+
+
+ +
+

JSON response example:

+
+
curl -X POST https://example.com/wp-json/wc/v3/shipping/zones/5/methods \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "method_id": "flat_rate"
+}'
+
const data = {
+  method_id: "flat_rate"
+};
+
+WooCommerce.post("shipping/zones/5/methods", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'method_id' => 'flat_rate'
+];
+
+print_r($woocommerce->post('shipping/zones/5/methods', $data));
+?>
+
data = {
+    "method_id": "flat_rate"
+}
+
+print(wcapi.post("shipping/zones/5/methods", data).json())
+
data = {
+  method_id: "flat_rate"
+}
+
+woocommerce.post("shipping/zones/5/methods", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "0",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ]
+  }
+}
+

Retrieve a shipping method from a shipping zone

+

This API lets you retrieve and view a specific shipping method from a shipping zone by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping/zones/<zone_id>/methods/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5/methods/26")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5/methods/26')); ?>
+
print(wcapi.get("shipping/zones/5/methods/26").json())
+
woocommerce.get("shipping/zones/5/methods/26").parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "0",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ]
+  }
+}
+

List all shipping methods from a shipping zone

+

This API helps you to view all the shipping methods from a shipping zone.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping/zones/<id>/methods
+
+
+
curl https://example.com/wp-json/wc/v3/shipping/zones/5/methods \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5/methods")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5/methods')); ?>
+
print(wcapi.get("shipping/zones/5/methods").json())
+
woocommerce.get("shipping/zones/5/methods").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "instance_id": 26,
+    "title": "Flat rate",
+    "order": 1,
+    "enabled": true,
+    "method_id": "flat_rate",
+    "method_title": "Flat rate",
+    "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Method title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Flat rate",
+        "default": "Flat rate",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "tax_status": {
+        "id": "tax_status",
+        "label": "Tax status",
+        "description": "",
+        "type": "select",
+        "value": "taxable",
+        "default": "taxable",
+        "tip": "",
+        "placeholder": "",
+        "options": {
+          "taxable": "Taxable",
+          "none": "None"
+        }
+      },
+      "cost": {
+        "id": "cost",
+        "label": "Cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "0",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": ""
+      },
+      "class_costs": {
+        "id": "class_costs",
+        "label": "Shipping class costs",
+        "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+        "type": "title",
+        "value": "",
+        "default": "",
+        "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+        "placeholder": ""
+      },
+      "class_cost_92": {
+        "id": "class_cost_92",
+        "label": "\"Express\" shipping class cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": "N/A"
+      },
+      "class_cost_91": {
+        "id": "class_cost_91",
+        "label": "\"Priority\" shipping class cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": "N/A"
+      },
+      "no_class_cost": {
+        "id": "no_class_cost",
+        "label": "No shipping class cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": "N/A"
+      },
+      "type": {
+        "id": "type",
+        "label": "Calculation type",
+        "description": "",
+        "type": "select",
+        "value": "class",
+        "default": "class",
+        "tip": "",
+        "placeholder": "",
+        "options": {
+          "class": "Per class: Charge shipping for each shipping class individually",
+          "order": "Per order: Charge shipping for the most expensive shipping class"
+        }
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+        }
+      ]
+    }
+  },
+  {
+    "instance_id": 27,
+    "title": "Free shipping",
+    "order": 2,
+    "enabled": true,
+    "method_id": "free_shipping",
+    "method_title": "Free shipping",
+    "method_description": "<p>Free shipping is a special method which can be triggered with coupons and minimum spends.</p>\n",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Free shipping",
+        "default": "Free shipping",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "requires": {
+        "id": "requires",
+        "label": "Free shipping requires...",
+        "description": "",
+        "type": "select",
+        "value": "",
+        "default": "",
+        "tip": "",
+        "placeholder": "",
+        "options": {
+          "": "N/A",
+          "coupon": "A valid free shipping coupon",
+          "min_amount": "A minimum order amount",
+          "either": "A minimum order amount OR a coupon",
+          "both": "A minimum order amount AND a coupon"
+        }
+      },
+      "min_amount": {
+        "id": "min_amount",
+        "label": "Minimum order amount",
+        "description": "Users will need to spend this amount to get free shipping (if enabled above).",
+        "type": "price",
+        "value": "0",
+        "default": "",
+        "tip": "Users will need to spend this amount to get free shipping (if enabled above).",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods/27"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+        }
+      ]
+    }
+  }
+]
+

Update a shipping method of a shipping zone

+

This API lets you make changes to a shipping method of a shipping zone.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/shipping/zones/<zone_id>/methods/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "settings": {
+    "cost": "20.00"
+  }
+}'
+
const data = {
+  settings: {
+    cost: "20.00"
+  }
+};
+
+WooCommerce.put("shipping/zones/5/methods/26", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => [
+        'cost' => '20.00'
+    ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/methods/26', $data));
+?>
+
data = {
+    "regular_price": {
+        "cost": "20.00"
+    }
+}
+
+print(wcapi.put("shipping/zones/5/methods/26", data).json())
+
data = {
+  regular_price: {
+    "cost": "20.00"
+  }
+}
+
+woocommerce.put("shipping/zones/5/methods/26", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "20.00",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ]
+  }
+}
+

Delete a shipping method from a shipping zone

+

This API helps you delete a shipping method from a shipping zone.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v3/shipping/zones/<zone_id>/methods/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("shipping/zones/5/methods/26", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('shipping/zones/5/methods/26', ['force' => true])); ?>
+
print(wcapi.delete("shipping/zones/5/methods/26", params={"force": True}).json())
+
woocommerce.delete("shipping/zones/5/methods/26", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "20.00",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping/zones/5"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Shipping methods

+

The shipping methods API allows you to view individual shipping methods.

+

Shipping method properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringMethod ID. read-only
titlestringShipping method title. read-only
descriptionstringShipping method description. read-only
+

Retrieve a shipping method

+

This API lets you retrieve and view a specific shipping method.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping_methods/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/shipping_methods/flat_rate \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping_methods/flat_rate")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping_methods/flat_rate')); ?>
+
print(wcapi.get("shipping_methods/flat_rate").json())
+
woocommerce.get("shipping_methods/flat_rate").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "flat_rate",
+  "title": "Flat rate",
+  "description": "Lets you charge a fixed rate for shipping.",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping_methods/flat_rate"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/shipping_methods"
+      }
+    ]
+  }
+}
+

List all shipping methods

+

This API helps you to view all the shipping methods.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/shipping_methods
+
+
+
curl https://example.com/wp-json/wc/v3/shipping_methods \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping_methods")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping_methods')); ?>
+
print(wcapi.get("shipping_methods").json())
+
woocommerce.get("shipping_methods").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "flat_rate",
+    "title": "Flat rate",
+    "description": "Lets you charge a fixed rate for shipping.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping_methods/flat_rate"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping_methods"
+        }
+      ]
+    }
+  },
+  {
+    "id": "free_shipping",
+    "title": "Free shipping",
+    "description": "Free shipping is a special method which can be triggered with coupons and minimum spends.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping_methods/free_shipping"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping_methods"
+        }
+      ]
+    }
+  },
+  {
+    "id": "local_pickup",
+    "title": "Local pickup",
+    "description": "Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping_methods/local_pickup"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/shipping_methods"
+        }
+      ]
+    }
+  }
+]
+

System status

+

The system status API allows you to view all system status items.

+

System status properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
environmentobjectEnvironment. See System status - Environment properties read-only
databaseobjectDatabase. See System status - Database properties read-only
active_pluginsarrayActive plugins. read-only
themeobjectTheme. See System status - Theme properties read-only
settingsobjectSettings. See System status - Settings properties read-only
securityobjectSecurity. See System status - Security properties read-only
pagesarrayWooCommerce pages. read-only
+

System status - Environment properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
home_urlstringHome URL. read-only
site_urlstringSite URL. read-only
wc_versionstringWooCommerce version. read-only
log_directorystringLog directory. read-only
log_directory_writablebooleanIs log directory writable? read-only
wp_versionstringWordPress version. read-only
wp_multisitebooleanIs WordPress multisite? read-only
wp_memory_limitintegerWordPress memory limit. read-only
wp_debug_modebooleanIs WordPress debug mode active? read-only
wp_cronbooleanAre WordPress cron jobs enabled? read-only
languagestringWordPress language. read-only
server_infostringServer info. read-only
php_versionstringPHP version. read-only
php_post_max_sizeintegerPHP post max size. read-only
php_max_execution_timeintegerPHP max execution time. read-only
php_max_input_varsintegerPHP max input vars. read-only
curl_versionstringcURL version. read-only
suhosin_installedbooleanIs SUHOSIN installed? read-only
max_upload_sizeintegerMax upload size. read-only
mysql_versionstringMySQL version. read-only
default_timezonestringDefault timezone. read-only
fsockopen_or_curl_enabledbooleanIs fsockopen/cURL enabled? read-only
soapclient_enabledbooleanIs SoapClient class enabled? read-only
domdocument_enabledbooleanIs DomDocument class enabled? read-only
gzip_enabledbooleanIs GZip enabled? read-only
mbstring_enabledbooleanIs mbstring enabled? read-only
remote_post_successfulbooleanRemote POST successful? read-only
remote_post_responsestringRemote POST response. read-only
remote_get_successfulbooleanRemote GET successful? read-only
remote_get_responsestringRemote GET response. read-only
+

System status - Database properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
wc_database_versionstringWC database version. read-only
database_prefixstringDatabase prefix. read-only
maxmind_geoip_databasestringMaxMind GeoIP database. read-only
database_tablesarrayDatabase tables. read-only
+

System status - Theme properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringTheme name. read-only
versionstringTheme version. read-only
version_lateststringLatest version of theme. read-only
author_urlstringTheme author URL. read-only
is_child_themebooleanIs this theme a child theme? read-only
has_woocommerce_supportbooleanDoes the theme declare WooCommerce support? read-only
has_woocommerce_filebooleanDoes the theme have a woocommerce.php file? read-only
has_outdated_templatesbooleanDoes this theme have outdated templates? read-only
overridesarrayTemplate overrides. read-only
parent_namestringParent theme name. read-only
parent_versionstringParent theme version. read-only
parent_author_urlstringParent theme author URL. read-only
+

System status - Settings properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
api_enabledbooleanREST API enabled? read-only
force_sslbooleanSSL forced? read-only
currencystringCurrency. read-only
currency_symbolstringCurrency symbol. read-only
currency_positionstringCurrency position. read-only
thousand_separatorstringThousand separator. read-only
decimal_separatorstringDecimal separator. read-only
number_of_decimalsintegerNumber of decimals. read-only
geolocation_enabledbooleanGeolocation enabled? read-only
taxonomiesarrayTaxonomy terms for product/order statuses. read-only
+

System status - Security properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
secure_connectionbooleanIs the connection to your store secure? read-only
hide_errorsbooleanHide errors from visitors? read-only
+

List all system status items

+

This API helps you to view all the system status items.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/system_status
+
+
+
curl https://example.com/wp-json/wc/v3/system_status \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("system_status")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('system_status')); ?>
+
print(wcapi.get("system_status").json())
+
woocommerce.get("system_status").parsed_response
+
+
+

JSON response example:

+
+
{
+  "environment": {
+    "home_url": "http://example.com",
+    "site_url": "http://example.com",
+    "version": "3.0.0",
+    "log_directory": "/var/www/woocommerce/wp-content/uploads/wc-logs/",
+    "log_directory_writable": true,
+    "wp_version": "4.7.3",
+    "wp_multisite": false,
+    "wp_memory_limit": 134217728,
+    "wp_debug_mode": true,
+    "wp_cron": true,
+    "language": "en_US",
+    "server_info": "Apache/2.4.18 (Ubuntu)",
+    "php_version": "7.1.3-2+deb.sury.org~yakkety+1",
+    "php_post_max_size": 8388608,
+    "php_max_execution_time": 30,
+    "php_max_input_vars": 1000,
+    "curl_version": "7.50.1, OpenSSL/1.0.2g",
+    "suhosin_installed": false,
+    "max_upload_size": 2097152,
+    "mysql_version": "5.7.17",
+    "default_timezone": "UTC",
+    "fsockopen_or_curl_enabled": true,
+    "soapclient_enabled": true,
+    "domdocument_enabled": true,
+    "gzip_enabled": true,
+    "mbstring_enabled": true,
+    "remote_post_successful": true,
+    "remote_post_response": "200",
+    "remote_get_successful": true,
+    "remote_get_response": "200"
+  },
+  "database": {
+    "wc_database_version": "3.0.0",
+    "database_prefix": "wp_",
+    "maxmind_geoip_database": "/var/www/woocommerce/wp-content/uploads/GeoIP.dat",
+    "database_tables": {
+      "woocommerce_sessions": true,
+      "woocommerce_api_keys": true,
+      "woocommerce_attribute_taxonomies": true,
+      "woocommerce_downloadable_product_permissions": true,
+      "woocommerce_order_items": true,
+      "woocommerce_order_itemmeta": true,
+      "woocommerce_tax_rates": true,
+      "woocommerce_tax_rate_locations": true,
+      "woocommerce_shipping_zones": true,
+      "woocommerce_shipping_zone_locations": true,
+      "woocommerce_shipping_zone_methods": true,
+      "woocommerce_payment_tokens": true,
+      "woocommerce_payment_tokenmeta": true
+    }
+  },
+  "active_plugins": [
+    {
+      "plugin": "woocommerce/woocommerce.php",
+      "name": "WooCommerce",
+      "version": "3.0.0-rc.1",
+      "version_latest": "2.6.14",
+      "url": "https://woocommerce.com/",
+      "author_name": "Automattic",
+      "author_url": "https://woocommerce.com",
+      "network_activated": false
+    }
+  ],
+  "theme": {
+    "name": "Twenty Sixteen",
+    "version": "1.3",
+    "version_latest": "1.3",
+    "author_url": "https://wordpress.org/",
+    "is_child_theme": false,
+    "has_woocommerce_support": true,
+    "has_woocommerce_file": false,
+    "has_outdated_templates": false,
+    "overrides": [],
+    "parent_name": "",
+    "parent_version": "",
+    "parent_version_latest": "",
+    "parent_author_url": ""
+  },
+  "settings": {
+    "api_enabled": true,
+    "force_ssl": false,
+    "currency": "USD",
+    "currency_symbol": "&#36;",
+    "currency_position": "left",
+    "thousand_separator": ",",
+    "decimal_separator": ".",
+    "number_of_decimals": 2,
+    "geolocation_enabled": false,
+    "taxonomies": {
+      "external": "external",
+      "grouped": "grouped",
+      "simple": "simple",
+      "variable": "variable"
+    }
+  },
+  "security": {
+    "secure_connection": true,
+    "hide_errors": true
+  },
+  "pages": [
+    {
+      "page_name": "Shop base",
+      "page_id": "4",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "",
+      "shortcode_required": false,
+      "shortcode_present": false
+    },
+    {
+      "page_name": "Cart",
+      "page_id": "5",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "[woocommerce_cart]",
+      "shortcode_required": true,
+      "shortcode_present": true
+    },
+    {
+      "page_name": "Checkout",
+      "page_id": "6",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "[woocommerce_checkout]",
+      "shortcode_required": true,
+      "shortcode_present": true
+    },
+    {
+      "page_name": "My account",
+      "page_id": "7",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "[woocommerce_my_account]",
+      "shortcode_required": true,
+      "shortcode_present": true
+    }
+  ]
+}
+

System status tools

+

The system status tools API allows you to view and run tools from system status.

+

System status tool properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the tool. read-only
namestringTool name. read-only
actionstringWhat running the tool will do. read-only
descriptionstringTool description. read-only
successbooleanDid the tool run successfully? read-only write-only
messagestringTool return message. read-only write-only
confirmbooleanConfirm execution of the tool. Default is false. write-only
+

Retrieve a tool from system status

+

This API lets you retrieve and view a specific tool from system status by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/system_status/tools/<id>
+
+
+
curl https://example.com/wp-json/wc/v3/system_status/tools/clear_transients \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("system_status/tools/clear_transients")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('system_status/tools/clear_transients')); ?>
+
print(wcapi.get("system_status/tools/clear_transients").json())
+
woocommerce.get("system_status/tools/clear_transients").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "clear_transients",
+  "name": "WC transients",
+  "action": "Clear transients",
+  "description": "This tool will clear the product/shop transients cache.",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_transients"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+      }
+    ]
+  }
+}
+

List all tools from system status

+

This API helps you to view all tools from system status.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/system_status/tools
+
+
+
curl https://example.com/wp-json/wc/v3/system_status/tools \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("system_status/tools")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('system_status/tools')); ?>
+
print(wcapi.get("system_status/tools").json())
+
woocommerce.get("system_status/tools").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "clear_transients",
+    "name": "WC transients",
+    "action": "Clear transients",
+    "description": "This tool will clear the product/shop transients cache.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_transients"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "clear_expired_transients",
+    "name": "Expired transients",
+    "action": "Clear expired transients",
+    "description": "This tool will clear ALL expired transients from WordPress.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_expired_transients"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "delete_orphaned_variations",
+    "name": "Orphaned variations",
+    "action": "Delete orphaned variations",
+    "description": "This tool will delete all variations which have no parent.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/delete_orphaned_variations"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "recount_terms",
+    "name": "Term counts",
+    "action": "Recount terms",
+    "description": "This tool will recount product terms - useful when changing your settings in a way which hides products from the catalog.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/recount_terms"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "reset_roles",
+    "name": "Capabilities",
+    "action": "Reset capabilities",
+    "description": "This tool will reset the admin, customer and shop_manager roles to default. Use this if your users cannot access all of the WooCommerce admin pages.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/reset_roles"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "clear_sessions",
+    "name": "Customer sessions",
+    "action": "Clear all sessions",
+    "description": "<strong class=\"red\">Note:</strong> This tool will delete all customer session data from the database, including any current live carts.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_sessions"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "install_pages",
+    "name": "Install WooCommerce pages",
+    "action": "Install pages",
+    "description": "<strong class=\"red\">Note:</strong> This tool will install all the missing WooCommerce pages. Pages already defined and set up will not be replaced.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/install_pages"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "delete_taxes",
+    "name": "Delete all WooCommerce tax rates",
+    "action": "Delete ALL tax rates",
+    "description": "<strong class=\"red\">Note:</strong> This option will delete ALL of your tax rates, use with caution.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/delete_taxes"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "reset_tracking",
+    "name": "Reset usage tracking settings",
+    "action": "Reset usage tracking settings",
+    "description": "This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools/reset_tracking"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+        }
+      ]
+    }
+  }
+]
+

Run a tool from system status

+

This API lets you run a tool from system status.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v3/system_status/tools/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v3/system_status/tools/clear_transients \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "confirm": true
+}'
+
const data = {
+  confirm: true
+};
+
+WooCommerce.put("system_status/tools/clear_transients", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'confirm' => true
+];
+
+print_r($woocommerce->put('system_status/tools/clear_transients', $data));
+?>
+
data = {
+    "confirm": True
+}
+
+print(wcapi.put("system_status/tools/clear_transients", data).json())
+
data = {
+  confirm: true
+}
+
+woocommerce.put("system_status/tools/clear_transients", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "clear_transients",
+  "name": "WC transients",
+  "action": "Clear transients",
+  "description": "This tool will clear the product/shop transients cache.",
+  "success": true,
+  "message": "Product transients cleared",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_transients"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+      }
+    ]
+  }
+}
+

Data

+

The data API allows you to view all types of data available.

+

List all data

+

This API lets you retrieve and view a simple list of available data endpoints.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data
+
+
+
curl https://example.com/wp-json/wc/v3/data \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('data')); ?>
+
print(wcapi.get("data").json())
+
woocommerce.get("data").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "slug": "continents",
+        "description": "List of supported continents, countries, and states.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/continents"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "countries",
+        "description": "List of supported states in a given country.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/countries"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data"
+                }
+            ]
+        }
+    },
+    {
+        "slug": "currencies",
+        "description": "List of supported currencies.",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data"
+                }
+            ]
+        }
+    }
+]
+

Data properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringData resource ID. read-only
descriptionstringData resource description. read-only
+

List all continents

+

This API helps you to view all the continents.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/continents
+
+
+
curl https://example.com/wp-json/wc/v3/data/continents \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/continents")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/continents'));
+?>
+
print(wcapi.get("data/continents").json())
+
woocommerce.get("data/continents").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "code": "AF",
+        "name": "Africa",
+        "countries": [
+            {
+                "code": "AO",
+                "name": "Angola",
+                "states": [
+                    {
+                        "code": "BGO",
+                        "name": "Bengo"
+                    },
+                    {
+                        "code": "BLU",
+                        "name": "Benguela"
+                    },
+                    {
+                        "code": "BIE",
+                        "name": "Bié"
+                    },
+                    {
+                        "code": "CAB",
+                        "name": "Cabinda"
+                    },
+                    {
+                        "code": "CNN",
+                        "name": "Cunene"
+                    },
+                    {
+                        "code": "HUA",
+                        "name": "Huambo"
+                    },
+                    {
+                        "code": "HUI",
+                        "name": "Huíla"
+                    },
+                    {
+                        "code": "CCU",
+                        "name": "Kuando Kubango"
+                    },
+                    {
+                        "code": "CNO",
+                        "name": "Kwanza-Norte"
+                    },
+                    {
+                        "code": "CUS",
+                        "name": "Kwanza-Sul"
+                    },
+                    {
+                        "code": "LUA",
+                        "name": "Luanda"
+                    },
+                    {
+                        "code": "LNO",
+                        "name": "Lunda-Norte"
+                    },
+                    {
+                        "code": "LSU",
+                        "name": "Lunda-Sul"
+                    },
+                    {
+                        "code": "MAL",
+                        "name": "Malanje"
+                    },
+                    {
+                        "code": "MOX",
+                        "name": "Moxico"
+                    },
+                    {
+                        "code": "NAM",
+                        "name": "Namibe"
+                    },
+                    {
+                        "code": "UIG",
+                        "name": "Uíge"
+                    },
+                    {
+                        "code": "ZAI",
+                        "name": "Zaire"
+                    }
+                ]
+            },
+            {
+                "code": "BF",
+                "name": "Burkina Faso",
+                "states": []
+            },
+            {
+                "code": "BI",
+                "name": "Burundi",
+                "states": []
+            }
+        ],
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/continents/af"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/continents"
+                }
+            ]
+        }
+  }
+]
+

Continents properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestring2 character continent code. read-only
namestringFull name of continent. read-only
countriesarrayList of countries on this continent. See Continents - Countries properties read-only
+
Continents - Countries properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringISO3166 alpha-2 country code. read-only
currency_codestringDefault ISO4127 alpha-3 currency code for the country. read-only
currency_posstringCurrency symbol position for this country. read-only
decimal_sepstringDecimal separator for displayed prices for this country. read-only
dimension_unitstringThe unit lengths are defined in for this country. read-only
namestringFull name of country. read-only
num_decimalsintegerNumber of decimal points shown in displayed prices for this country. read-only
statesarrayList of states in this country. See Continents - Countries - States properties read-only
thousand_sepstringThousands separator for displayed prices in this country. read-only
weight_unitstringThe unit weights are defined in for this country. read-only
+
Continents - Countries - States properties
+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringState code. read-only
namestringFull name of state. read-only
+

Retrieve continent data

+

This API lets you retrieve and view a continent data.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/continents/<location>
+
+
+
curl https://example.com/wp-json/wc/v3/data/continents/eu \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/continents/eu")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/continents/eu'));
+?>
+
print(wcapi.get("data/continents/eu").json())
+
woocommerce.get("data/continents/eu").parsed_response
+
+
+

JSON response example:

+
+
{
+    "code": "EU",
+    "name": "Europe",
+    "countries": [
+        {
+            "code": "AD",
+            "name": "Andorra",
+            "states": []
+        },
+        {
+            "code": "AL",
+            "name": "Albania",
+            "states": []
+        },
+        {
+            "code": "AT",
+            "name": "Austria",
+            "states": []
+        },
+        {
+            "code": "AX",
+            "name": "&#197;land Islands",
+            "states": []
+        },
+        {
+            "code": "BA",
+            "name": "Bosnia and Herzegovina",
+            "states": []
+        },
+        {
+            "code": "BE",
+            "name": "Belgium",
+            "currency_code": "EUR",
+            "currency_pos": "left",
+            "decimal_sep": ",",
+            "dimension_unit": "cm",
+            "num_decimals": 2,
+            "thousand_sep": " ",
+            "weight_unit": "kg",
+            "states": []
+        },
+        {
+            "code": "BG",
+            "name": "Bulgaria",
+            "states": [
+                {
+                    "code": "BG-01",
+                    "name": "Blagoevgrad"
+                },
+                {
+                    "code": "BG-02",
+                    "name": "Burgas"
+                },
+                {
+                    "code": "BG-08",
+                    "name": "Dobrich"
+                },
+                {
+                    "code": "BG-07",
+                    "name": "Gabrovo"
+                },
+                {
+                    "code": "BG-26",
+                    "name": "Haskovo"
+                },
+                {
+                    "code": "BG-09",
+                    "name": "Kardzhali"
+                },
+                {
+                    "code": "BG-10",
+                    "name": "Kyustendil"
+                },
+                {
+                    "code": "BG-11",
+                    "name": "Lovech"
+                },
+                {
+                    "code": "BG-12",
+                    "name": "Montana"
+                },
+                {
+                    "code": "BG-13",
+                    "name": "Pazardzhik"
+                },
+                {
+                    "code": "BG-14",
+                    "name": "Pernik"
+                },
+                {
+                    "code": "BG-15",
+                    "name": "Pleven"
+                },
+                {
+                    "code": "BG-16",
+                    "name": "Plovdiv"
+                },
+                {
+                    "code": "BG-17",
+                    "name": "Razgrad"
+                },
+                {
+                    "code": "BG-18",
+                    "name": "Ruse"
+                },
+                {
+                    "code": "BG-27",
+                    "name": "Shumen"
+                },
+                {
+                    "code": "BG-19",
+                    "name": "Silistra"
+                },
+                {
+                    "code": "BG-20",
+                    "name": "Sliven"
+                },
+                {
+                    "code": "BG-21",
+                    "name": "Smolyan"
+                },
+                {
+                    "code": "BG-23",
+                    "name": "Sofia"
+                },
+                {
+                    "code": "BG-22",
+                    "name": "Sofia-Grad"
+                },
+                {
+                    "code": "BG-24",
+                    "name": "Stara Zagora"
+                },
+                {
+                    "code": "BG-25",
+                    "name": "Targovishte"
+                },
+                {
+                    "code": "BG-03",
+                    "name": "Varna"
+                },
+                {
+                    "code": "BG-04",
+                    "name": "Veliko Tarnovo"
+                },
+                {
+                    "code": "BG-05",
+                    "name": "Vidin"
+                },
+                {
+                    "code": "BG-06",
+                    "name": "Vratsa"
+                },
+                {
+                    "code": "BG-28",
+                    "name": "Yambol"
+                }
+            ]
+        }
+    ],
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/continents/eu"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/continents"
+            }
+        ]
+    }
+}
+

Continent properties

+

See list of continents properties.

+

List all countries

+

This API helps you to view all the countries.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/countries
+
+
+
curl https://example.com/wp-json/wc/v3/data/countries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/countries")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/countries'));
+?>
+
print(wcapi.get("data/countries").json())
+
woocommerce.get("data/countries").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "code": "US",
+        "name": "United States (US)",
+        "states": [
+            {
+                "code": "AL",
+                "name": "Alabama"
+            },
+            {
+                "code": "AK",
+                "name": "Alaska"
+            },
+            {
+                "code": "AZ",
+                "name": "Arizona"
+            },
+            {
+                "code": "AR",
+                "name": "Arkansas"
+            },
+            {
+                "code": "CA",
+                "name": "California"
+            },
+            {
+                "code": "CO",
+                "name": "Colorado"
+            },
+            {
+                "code": "CT",
+                "name": "Connecticut"
+            },
+            {
+                "code": "DE",
+                "name": "Delaware"
+            },
+            {
+                "code": "DC",
+                "name": "District Of Columbia"
+            },
+            {
+                "code": "FL",
+                "name": "Florida"
+            },
+            {
+                "code": "GA",
+                "name": "Georgia"
+            },
+            {
+                "code": "HI",
+                "name": "Hawaii"
+            },
+            {
+                "code": "ID",
+                "name": "Idaho"
+            },
+            {
+                "code": "IL",
+                "name": "Illinois"
+            },
+            {
+                "code": "IN",
+                "name": "Indiana"
+            },
+            {
+                "code": "IA",
+                "name": "Iowa"
+            },
+            {
+                "code": "KS",
+                "name": "Kansas"
+            },
+            {
+                "code": "KY",
+                "name": "Kentucky"
+            },
+            {
+                "code": "LA",
+                "name": "Louisiana"
+            },
+            {
+                "code": "ME",
+                "name": "Maine"
+            },
+            {
+                "code": "MD",
+                "name": "Maryland"
+            },
+            {
+                "code": "MA",
+                "name": "Massachusetts"
+            },
+            {
+                "code": "MI",
+                "name": "Michigan"
+            },
+            {
+                "code": "MN",
+                "name": "Minnesota"
+            },
+            {
+                "code": "MS",
+                "name": "Mississippi"
+            },
+            {
+                "code": "MO",
+                "name": "Missouri"
+            },
+            {
+                "code": "MT",
+                "name": "Montana"
+            },
+            {
+                "code": "NE",
+                "name": "Nebraska"
+            },
+            {
+                "code": "NV",
+                "name": "Nevada"
+            },
+            {
+                "code": "NH",
+                "name": "New Hampshire"
+            },
+            {
+                "code": "NJ",
+                "name": "New Jersey"
+            },
+            {
+                "code": "NM",
+                "name": "New Mexico"
+            },
+            {
+                "code": "NY",
+                "name": "New York"
+            },
+            {
+                "code": "NC",
+                "name": "North Carolina"
+            },
+            {
+                "code": "ND",
+                "name": "North Dakota"
+            },
+            {
+                "code": "OH",
+                "name": "Ohio"
+            },
+            {
+                "code": "OK",
+                "name": "Oklahoma"
+            },
+            {
+                "code": "OR",
+                "name": "Oregon"
+            },
+            {
+                "code": "PA",
+                "name": "Pennsylvania"
+            },
+            {
+                "code": "RI",
+                "name": "Rhode Island"
+            },
+            {
+                "code": "SC",
+                "name": "South Carolina"
+            },
+            {
+                "code": "SD",
+                "name": "South Dakota"
+            },
+            {
+                "code": "TN",
+                "name": "Tennessee"
+            },
+            {
+                "code": "TX",
+                "name": "Texas"
+            },
+            {
+                "code": "UT",
+                "name": "Utah"
+            },
+            {
+                "code": "VT",
+                "name": "Vermont"
+            },
+            {
+                "code": "VA",
+                "name": "Virginia"
+            },
+            {
+                "code": "WA",
+                "name": "Washington"
+            },
+            {
+                "code": "WV",
+                "name": "West Virginia"
+            },
+            {
+                "code": "WI",
+                "name": "Wisconsin"
+            },
+            {
+                "code": "WY",
+                "name": "Wyoming"
+            },
+            {
+                "code": "AA",
+                "name": "Armed Forces (AA)"
+            },
+            {
+                "code": "AE",
+                "name": "Armed Forces (AE)"
+            },
+            {
+                "code": "AP",
+                "name": "Armed Forces (AP)"
+            }
+        ],
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/countries/us"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/countries"
+                }
+            ]
+        }
+    }
+]
+

Countries properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringISO3166 alpha-2 country code. read-only
namestringFull name of country. read-only
statesarrayList of states in this country. See Countries - States properties read-only
+
Countries - States properties
+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringState code. read-only
namestringFull name of state. read-only
+

Retrieve country data

+

This API lets you retrieve and view a country data.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/countries/<location>
+
+
+
curl https://example.com/wp-json/wc/v3/data/countries/br \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/countries/br")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/countries/br'));
+?>
+
print(wcapi.get("data/countries/br").json())
+
woocommerce.get("data/countries/br").parsed_response
+
+
+

JSON response example:

+
+
{
+    "code": "BR",
+    "name": "Brazil",
+    "states": [
+        {
+            "code": "AC",
+            "name": "Acre"
+        },
+        {
+            "code": "AL",
+            "name": "Alagoas"
+        },
+        {
+            "code": "AP",
+            "name": "Amap&aacute;"
+        },
+        {
+            "code": "AM",
+            "name": "Amazonas"
+        },
+        {
+            "code": "BA",
+            "name": "Bahia"
+        },
+        {
+            "code": "CE",
+            "name": "Cear&aacute;"
+        },
+        {
+            "code": "DF",
+            "name": "Distrito Federal"
+        },
+        {
+            "code": "ES",
+            "name": "Esp&iacute;rito Santo"
+        },
+        {
+            "code": "GO",
+            "name": "Goi&aacute;s"
+        },
+        {
+            "code": "MA",
+            "name": "Maranh&atilde;o"
+        },
+        {
+            "code": "MT",
+            "name": "Mato Grosso"
+        },
+        {
+            "code": "MS",
+            "name": "Mato Grosso do Sul"
+        },
+        {
+            "code": "MG",
+            "name": "Minas Gerais"
+        },
+        {
+            "code": "PA",
+            "name": "Par&aacute;"
+        },
+        {
+            "code": "PB",
+            "name": "Para&iacute;ba"
+        },
+        {
+            "code": "PR",
+            "name": "Paran&aacute;"
+        },
+        {
+            "code": "PE",
+            "name": "Pernambuco"
+        },
+        {
+            "code": "PI",
+            "name": "Piau&iacute;"
+        },
+        {
+            "code": "RJ",
+            "name": "Rio de Janeiro"
+        },
+        {
+            "code": "RN",
+            "name": "Rio Grande do Norte"
+        },
+        {
+            "code": "RS",
+            "name": "Rio Grande do Sul"
+        },
+        {
+            "code": "RO",
+            "name": "Rond&ocirc;nia"
+        },
+        {
+            "code": "RR",
+            "name": "Roraima"
+        },
+        {
+            "code": "SC",
+            "name": "Santa Catarina"
+        },
+        {
+            "code": "SP",
+            "name": "S&atilde;o Paulo"
+        },
+        {
+            "code": "SE",
+            "name": "Sergipe"
+        },
+        {
+            "code": "TO",
+            "name": "Tocantins"
+        }
+    ],
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/countries/br"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/countries"
+            }
+        ]
+    }
+}
+

Country properties

+

See list of countries properties.

+

List all currencies

+

This API helps you to view all the currencies.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/currencies
+
+
+
curl https://example.com/wp-json/wc/v3/data/currencies \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/currencies")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/currencies'));
+?>
+
print(wcapi.get("data/currencies").json())
+
woocommerce.get("data/currencies").parsed_response
+
+
+

JSON response example:

+
+
[
+    {
+        "code": "BTC",
+        "name": "Bitcoin",
+        "symbol": "&#3647;",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies/BTC"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies"
+                }
+            ]
+        }
+    },
+    {
+        "code": "EUR",
+        "name": "Euro",
+        "symbol": "&euro;",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies/EUR"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies"
+                }
+            ]
+        }
+    },
+    {
+        "code": "USD",
+        "name": "United States (US) dollar",
+        "symbol": "&#36;",
+        "_links": {
+            "self": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies/USD"
+                }
+            ],
+            "collection": [
+                {
+                    "href": "https://example.com/wp-json/wc/v3/data/currencies"
+                }
+            ]
+        }
+    }
+]
+

Currencies properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringISO4217 currency code. read-only
namestringFull name of currency. read-only
symbolstringCurrency symbol. read-only
+

Retrieve currency data

+

This API lets you retrieve and view a currency data.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/currencies/<currency>
+
+
+
curl https://example.com/wp-json/wc/v3/data/currencies/brl \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/currencies/brl")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/currencies/brl'));
+?>
+
print(wcapi.get("data/currencies/brl").json())
+
woocommerce.get("data/currencies/brl").parsed_response
+
+
+

JSON response example:

+
+
{
+    "code": "BRL",
+    "name": "Brazilian real",
+    "symbol": "&#82;&#36;",
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/currencies/BRL"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/currencies"
+            }
+        ]
+    }
+}
+

Currency properties

+

See list of currencies properties.

+

Retrieve current currency

+

This API lets you retrieve and view store's current currency data.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v3/data/currencies/current
+
+
+
curl https://example.com/wp-json/wc/v3/data/currencies/current \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("data/currencies/current")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+print_r($woocommerce->get('data/currencies/current'));
+?>
+
print(wcapi.get("data/currencies/current").json())
+
woocommerce.get("data/currencies/current").parsed_response
+
+
+

JSON response example:

+
+
{
+    "code": "USD",
+    "name": "United States (US) dollar",
+    "symbol": "&#36;",
+    "_links": {
+        "self": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/currencies/USD"
+            }
+        ],
+        "collection": [
+            {
+                "href": "https://example.com/wp-json/wc/v3/data/currencies"
+            }
+        ]
+    }
+}
+

Currency properties

+

See list of currencies properties.

+ +
+
+
+ cURL + Node.js + PHP + Python + Ruby +
+
+
+ + + + diff --git a/javascripts/all-c5541673.js b/javascripts/all-c5541673.js new file mode 100644 index 00000000..9eca788d --- /dev/null +++ b/javascripts/all-c5541673.js @@ -0,0 +1,131 @@ +!function(){if("ontouchstart"in window){var e,t,n,r,i,o,s={};e=function(e,t){return Math.abs(e[0]-t[0])>5||Math.abs(e[1]-t[1])>5},t=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY],this.threshold=!1},n=function(t){if(this.threshold)return!1;this.threshold=e(this.startXY,[t.touches[0].clientX,t.touches[0].clientY])},r=function(t){if(!this.threshold&&!e(this.startXY,[t.changedTouches[0].clientX,t.changedTouches[0].clientY])){var n=t.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),r.simulated=!0,t.target.dispatchEvent(r)}},i=function(e){var t=Date.now(),n=t-s.time,r=e.clientX,i=e.clientY,a=[Math.abs(s.x-r),Math.abs(s.y-i)],u=o(e.target,"A")||e.target,c=u.nodeName,l="A"===c,f=window.navigator.standalone&&l&&e.target.getAttribute("href");if(s.time=t,s.x=r,s.y=i,(!e.simulated&&(n<500||n<1500&&a[0]<50&&a[1]<50)||f)&&(e.preventDefault(),e.stopPropagation(),!f))return!1;f&&(window.location=u.getAttribute("href")),u&&u.classList&&(u.classList.add("energize-focus"),window.setTimeout(function(){u.classList.remove("energize-focus")},150))},o=function(e,t){for(var n=e;n!==document.body;){if(!n||n.nodeName===t)return n;n=n.parentNode}return null},document.addEventListener("touchstart",t,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",r,!1),document.addEventListener("click",i,!0)}}(),/*! + * jQuery JavaScript Library v3.2.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2017-03-20T18:59Z + */ +function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t){t=t||ne;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function r(e){var t=!!e&&"length"in e&&e.length,n=ge.type(e);return"function"!==n&&!ge.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function i(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function o(e,t,n){return ge.isFunction(t)?ge.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?ge.grep(e,function(e){return e===t!==n}):"string"!=typeof t?ge.grep(e,function(e){return ae.call(t,e)>-1!==n}):Ce.test(t)?ge.filter(t,e,n):(t=ge.filter(t,e),ge.grep(e,function(e){return ae.call(t,e)>-1!==n&&1===e.nodeType}))}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t={};return ge.each(e.match(Le)||[],function(e,n){t[n]=!0}),t}function u(e){return e}function c(e){throw e}function l(e,t,n,r){var i;try{e&&ge.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&ge.isFunction(i=e.then)?i.call(e,t,n):t.apply(undefined,[e].slice(r))}catch(e){n.apply(undefined,[e])}}function f(){ne.removeEventListener("DOMContentLoaded",f),e.removeEventListener("load",f),ge.ready()}function d(){this.expando=ge.expando+d.uid++}function p(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:He.test(e)?JSON.parse(e):e)}function h(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(Ie,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=p(n)}catch(e){}Pe.set(e,t,n)}else n=undefined;return n}function g(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return ge.css(e,t,"")},u=a(),c=n&&n[3]||(ge.cssNumber[t]?"":"px"),l=(ge.cssNumber[t]||"px"!==c&&+u)&&_e.exec(ge.css(e,t));if(l&&l[3]!==c){c=c||l[3],n=n||[],l=+u||1;do{o=o||".5",l/=o,ge.style(e,t,l+c)}while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function m(e){var t,n=e.ownerDocument,r=e.nodeName,i=ze[r];return i||(t=n.body.appendChild(n.createElement(r)),i=ge.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ze[r]=i,i)}function v(e,t){for(var n,r,i=[],o=0,s=e.length;o-1)i&&i.push(o);else if(c=ge.contains(o.ownerDocument,o),s=y(f.appendChild(o),"script"),c&&x(s),n)for(l=0;o=s[l++];)Ue.test(o.type||"")&&n.push(o);return f}function w(){return!0}function T(){return!1}function S(){try{return ne.activeElement}catch(e){}}function E(e,t,n,r,i,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=undefined);for(a in t)E(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=undefined):null==i&&("string"==typeof n?(i=r,r=undefined):(i=r,r=n,n=undefined)),!1===i)i=T;else if(!i)return e;return 1===o&&(s=i,i=function(e){return ge().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=ge.guid++)),e.each(function(){ge.event.add(this,t,i,r,n)})}function C(e,t){return i(e,"table")&&i(11!==t.nodeType?t:t.firstChild,"tr")?ge(">tbody",e)[0]||e:e}function k(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function N(e){var t=rt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function j(e,t){var n,r,i,o,s,a,u,c;if(1===t.nodeType){if($e.hasData(e)&&(o=$e.access(e),s=$e.set(t,o),c=o.events)){delete s.handle,s.events={};for(i in c)for(n=0,r=c[i].length;n1&&"string"==typeof h&&!pe.checkClone&&nt.test(h))return e.each(function(n){var o=e.eq(n);g&&(t[0]=h.call(this,n,o.html())),L(o,t,r,i)});if(d&&(o=b(t,e[0].ownerDocument,!1,e,i),s=o.firstChild,1===o.childNodes.length&&(o=s),s||i)){for(a=ge.map(y(o,"script"),k),u=a.length;f=0&&nS.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[_]=!0,e}function i(e){var t=q.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)S.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ee(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function f(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;i-1&&(r[c]=!(s[c]=f))}}else x=v(x===s?x.splice(h,x.length):x),o?o(null,s,x,u):K.apply(s,x)})}function x(e){for(var t,n,r,i=e.length,o=S.relative[e[0].type],s=o||S.relative[" "],a=o?1:0,u=h(function(e){return e===t},s,!0),c=h(function(e){return ee(t,e)>-1},s,!0),l=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):c(e,n,r));return t=null,i}];a1&&g(l),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,a0,o=e.length>0,s=function(r,s,a,u,c){var l,f,d,p=0,h="0",g=r&&[],m=[],y=A,x=r||o&&S.find.TAG("*",c),b=W+=null==y?1:Math.random()||.1,w=x.length;for(c&&(A=s===q||s||c);h!==w&&null!=(l=x[h]);h++){if(o&&l){for(f=0,s||l.ownerDocument===q||(O(l),a=!$);d=e[f++];)if(d(l,s||q,a)){u.push(l);break}c&&(W=b)}i&&((l=!d&&l)&&p--,r&&g.push(l))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,m,s,a);if(r){if(p>0)for(;h--;)g[h]||m[h]||(m[h]=J.call(u));m=v(m)}K.apply(u,m),c&&!r&&m.length>0&&p+n.length>1&&t.uniqueSort(u)}return c&&(W=b,A=y),g};return i?r(s):s}var w,T,S,E,C,k,N,j,A,L,D,O,q,F,$,P,H,I,R,_="sizzle"+1*new Date,M=e.document,W=0,B=0,z=n(),V=n(),X=n(),U=function(e,t){return e===t&&(D=!0),0},Q={}.hasOwnProperty,Y=[],J=Y.pop,G=Y.push,K=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,xe=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),be=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},we=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Te=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Se=function(){O()},Ee=h(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{K.apply(Y=Z.call(M.childNodes),M.childNodes),Y[M.childNodes.length].nodeType}catch(e){K={apply:Y.length?function(e,t){G.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}T=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},O=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:M;return r!==q&&9===r.nodeType&&r.documentElement?(q=r,F=q.documentElement,$=!C(q),M!==q&&(n=q.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Se,!1):n.attachEvent&&n.attachEvent("onunload",Se)),T.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=i(function(e){return e.appendChild(q.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=me.test(q.getElementsByClassName),T.getById=i(function(e){return F.appendChild(e).id=_,!q.getElementsByName||!q.getElementsByName(_).length}),T.getById?(S.filter.ID=function(e){var t=e.replace(xe,be);return function(e){return e.getAttribute("id")===t}},S.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&$){var n=t.getElementById(e);return n?[n]:[]}}):(S.filter.ID=function(e){var t=e.replace(xe,be);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},S.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&$){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),S.find.TAG=T.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):T.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},S.find.CLASS=T.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&$)return t.getElementsByClassName(e)},H=[],P=[],(T.qsa=me.test(q.querySelectorAll))&&(i(function(e){F.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+_+"-]").length||P.push("~="),e.querySelectorAll(":checked").length||P.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||P.push(".#.+[+~]")}),i(function(e){e.innerHTML="";var t=q.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&P.push(":enabled",":disabled"),F.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(T.matchesSelector=me.test(I=F.matches||F.webkitMatchesSelector||F.mozMatchesSelector||F.oMatchesSelector||F.msMatchesSelector))&&i(function(e){T.disconnectedMatch=I.call(e,"*"),I.call(e,"[s!='']:x"),H.push("!=",oe)}),P=P.length&&new RegExp(P.join("|")),H=H.length&&new RegExp(H.join("|")),t=me.test(F.compareDocumentPosition),R=t||me.test(F.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!T.sortDetached&&t.compareDocumentPosition(e)===n?e===q||e.ownerDocument===M&&R(M,e)?-1:t===q||t.ownerDocument===M&&R(M,t)?1:L?ee(L,e)-ee(L,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===q?-1:t===q?1:i?-1:o?1:L?ee(L,e)-ee(L,t):0;if(i===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===M?-1:u[r]===M?1:0},q):q},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==q&&O(e),n=n.replace(le,"='$1']"),T.matchesSelector&&$&&!X[n+" "]&&(!H||!H.test(n))&&(!P||!P.test(n)))try{var r=I.call(e,n);if(r||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,q,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==q&&O(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==q&&O(e);var n=S.attrHandle[t.toLowerCase()],r=n&&Q.call(S.attrHandle,t.toLowerCase())?n(e,t,!$):undefined;return r!==undefined?r:T.attributes||!$?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(we,Te)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!T.detectDuplicates,L=!T.sortStable&&e.slice(0),e.sort(U),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return L=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},S=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xe,be),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,be),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xe,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,d,p,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(d=m,f=d[_]||(d[_]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),c=l[e]||[],p=c[0]===W&&c[1],x=p&&c[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){l[e]=[W,p,x];break}}else if(y&&(d=t,f=d[_]||(d[_]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),c=l[e]||[],p=c[0]===W&&c[1],x=p),!1===x)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(y&&(f=d[_]||(d[_]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),l[e]=[W,x]),d!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=S.pseudos[e]||S.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[_]?o(n):o.length>1?(i=[e,e,"",n],S.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)r=ee(e,i[s]),e[r]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=N(e.replace(ae,"$1"));return i[_]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(xe,be),function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xe,be).toLowerCase(),function(t){var n;do{if(n=$?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===F},focus:function(e){return e===q.activeElement&&(!q.hasFocus||q.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!S.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(s=o[0]).type&&9===t.nodeType&&$&&S.relative[o[1].type]){if(!(t=(S.find.ID(s.matches[0].replace(xe,be),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(s=o[i],!S.relative[a=s.type]);)if((u=S.find[a])&&(r=u(s.matches[0].replace(xe,be),ye.test(o[0].type)&&f(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&p(o)))return K.apply(n,r),n;break}}return(c||N(e,l))(r,t,!$,n,!t||ye.test(e)&&f(t.parentNode)||t),n},T.sortStable=_.split("").sort(U).join("")===_,T.detectDuplicates=!!D,O(),T.sortDetached=i(function(e){return 1&e.compareDocumentPosition(q.createElement("fieldset"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);ge.find=be,ge.expr=be.selectors,ge.expr[":"]=ge.expr.pseudos,ge.uniqueSort=ge.unique=be.uniqueSort,ge.text=be.getText,ge.isXMLDoc=be.isXML,ge.contains=be.contains,ge.escapeSelector=be.escape;var we=function(e,t,n){for(var r=[],i=n!==undefined;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&ge(e).is(n))break;r.push(e)}return r},Te=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Se=ge.expr.match.needsContext,Ee=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ce=/^.[^:#\[\.,]*$/;ge.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ge.find.matchesSelector(r,e)?[r]:[]:ge.find.matches(e,ge.grep(t,function(e){return 1===e.nodeType}))},ge.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ge(e).filter(function(){for(t=0;t1?ge.uniqueSort(n):n},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&Se.test(e)?ge(e):e||[],!1).length}});var ke,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ge.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||ke,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ne.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ge?t[0]:t,ge.merge(this,ge.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ne,!0)),Ee.test(r[1])&&ge.isPlainObject(t))for(r in t)ge.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=ne.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ge.isFunction(e)?n.ready!==undefined?n.ready(e):e(ge):ge.makeArray(e,this)}).prototype=ge.fn,ke=ge(ne);var je=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};ge.fn.extend({has:function(e){var t=ge(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&ge.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?ge.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?ae.call(ge(e),this[0]):ae.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ge.uniqueSort(ge.merge(this.get(),ge(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ge.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return we(e,"parentNode")},parentsUntil:function(e,t,n){return we(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return we(e,"nextSibling")},prevAll:function(e){return we(e,"previousSibling")},nextUntil:function(e,t,n){return we(e,"nextSibling",n)},prevUntil:function(e,t,n){return we(e,"previousSibling",n)},siblings:function(e){return Te((e.parentNode||{}).firstChild,e)},children:function(e){return Te(e.firstChild)},contents:function(e){return i(e,"iframe")?e.contentDocument:(i(e,"template")&&(e=e.content||e),ge.merge([],e.childNodes))}},function(e,t){ge.fn[e]=function(n,r){var i=ge.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ge.filter(r,i)),this.length>1&&(Ae[e]||ge.uniqueSort(i),je.test(e)&&i.reverse()),this.pushStack(i)}});var Le=/[^\x20\t\r\n\f]+/g;ge.Callbacks=function(e){e="string"==typeof e?a(e):ge.extend({},e);var t,n,r,i,o=[],s=[],u=-1,c=function(){for(i=i||e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)o.splice(n,1),n<=u&&u--}),this},has:function(e){return e?ge.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},ge.extend({Deferred:function(t){var n=[["notify","progress",ge.Callbacks("memory"),ge.Callbacks("memory"),2],["resolve","done",ge.Callbacks("once memory"),ge.Callbacks("once memory"),0,"resolved"],["reject","fail",ge.Callbacks("once memory"),ge.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return ge.Deferred(function(t){ge.each(n,function(n,r){var i=ge.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&ge.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var a=this,l=arguments,f=function(){var e,f;if(!(t=s&&(r!==c&&(a=undefined,l=[e]),n.rejectWith(a,l))}};t?d():(ge.Deferred.getStackHook&&(d.stackTrace=ge.Deferred.getStackHook()),e.setTimeout(d))}}var s=0;return ge.Deferred(function(e){n[0][3].add(o(0,e,ge.isFunction(i)?i:u,e.notifyWith)),n[1][3].add(o(0,e,ge.isFunction(t)?t:u)),n[2][3].add(o(0,e,ge.isFunction(r)?r:c))}).promise()},promise:function(e){return null!=e?ge.extend(e,i):i}},o={};return ge.each(n,function(e,t){var s=t[2],a=t[5];i[t[1]]=s.add,a&&s.add(function(){r=a},n[3-e][2].disable,n[0][2].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?undefined:this,arguments),this},o[t[0]+"With"]=s.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=ie.call(arguments),o=ge.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?ie.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(l(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||ge.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)l(i[n],s(n),o.reject);return o.promise()}});var De=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ge.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&De.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},ge.readyException=function(t){e.setTimeout(function(){throw t})};var Oe=ge.Deferred();ge.fn.ready=function(e){return Oe.then(e)["catch"](function(e){ge.readyException(e)}),this},ge.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ge.readyWait:ge.isReady)||(ge.isReady=!0,!0!==e&&--ge.readyWait>0||Oe.resolveWith(ne,[ge]))}}),ge.ready.then=Oe.then,"complete"===ne.readyState||"loading"!==ne.readyState&&!ne.documentElement.doScroll?e.setTimeout(ge.ready):(ne.addEventListener("DOMContentLoaded",f),e.addEventListener("load",f));var qe=function(e,t,n,r,i,o,s){var a=0,u=e.length,c=null==n;if("object"===ge.type(n)){i=!0;for(a in n)qe(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,ge.isFunction(r)||(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(ge(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){Pe.remove(this,e)})}}),ge.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=$e.get(e,t),n&&(!r||Array.isArray(n)?r=$e.access(e,t,ge.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ge.queue(e,t),r=n.length,i=n.shift(),o=ge._queueHooks(e,t),s=function(){ge.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return $e.get(e,n)||$e.access(e,n,{empty:ge.Callbacks("once memory").add(function(){$e.remove(e,[t+"queue",n])})})}}),ge.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Ue=/^$|\/(?:java|ecma)script/i,Qe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Qe.optgroup=Qe.option,Qe.tbody=Qe.tfoot=Qe.colgroup=Qe.caption=Qe.thead,Qe.th=Qe.td;var Ye=/<|&#?\w+;/;!function(){var e=ne.createDocumentFragment(),t=e.appendChild(ne.createElement("div")),n=ne.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),pe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",pe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Je=ne.documentElement,Ge=/^key/,Ke=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ze=/^([^.]*)(?:\.(.+)|)/;ge.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,c,l,f,d,p,h,g,m=$e.get(e);if(m)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&ge.find.matchesSelector(Je,i), +n.guid||(n.guid=ge.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(t){return void 0!==ge&&ge.event.triggered!==t.type?ge.event.dispatch.apply(e,arguments):undefined}),t=(t||"").match(Le)||[""],c=t.length;c--;)a=Ze.exec(t[c])||[],p=g=a[1],h=(a[2]||"").split(".").sort(),p&&(f=ge.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=ge.event.special[p]||{},l=ge.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ge.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||(d=u[p]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,s)||e.addEventListener&&e.addEventListener(p,s)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,l):d.push(l),ge.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,c,l,f,d,p,h,g,m=$e.hasData(e)&&$e.get(e);if(m&&(u=m.events)){for(t=(t||"").match(Le)||[""],c=t.length;c--;)if(a=Ze.exec(t[c])||[],p=g=a[1],h=(a[2]||"").split(".").sort(),p){for(f=ge.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)l=d[o],!i&&g!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(o,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(e,l));s&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||ge.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)ge.event.remove(e,p+t[c],n,r,!0);ge.isEmptyObject(u)&&$e.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=ge.event.fix(e),u=new Array(arguments.length),c=($e.get(this,"events")||{})[a.type]||[],l=ge.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n-1:ge.find(i,this,null,[c]).length),s[i]&&o.push(r);o.length&&a.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,tt=/\s*$/g;ge.extend({htmlPrefilter:function(e){return e.replace(et,"<$1>")},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=ge.contains(e.ownerDocument,e);if(!(pe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ge.isXMLDoc(e)))for(s=y(a),o=y(e),r=0,i=o.length;r0&&x(s,!u&&y(e,"script")),a},cleanData:function(e){for(var t,n,r,i=ge.event.special,o=0;(n=e[o])!==undefined;o++)if(Fe(n)){if(t=n[$e.expando]){if(t.events)for(r in t.events)i[r]?ge.event.remove(n,r):ge.removeEvent(n,r,t.handle);n[$e.expando]=undefined}n[Pe.expando]&&(n[Pe.expando]=undefined)}}}),ge.fn.extend({detach:function(e){return D(this,e,!0)},remove:function(e){return D(this,e)},text:function(e){return qe(this,function(e){return e===undefined?ge.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return L(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){C(this,e).appendChild(e)}})},prepend:function(){return L(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=C(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return L(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return L(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ge.cleanData(y(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ge.clone(this,e,t)})},html:function(e){return qe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!tt.test(e)&&!Qe[(Xe.exec(e)||["",""])[1].toLowerCase()]){e=ge.htmlPrefilter(e);try{for(;n1)}}),ge.Tween=R,R.prototype={constructor:R,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ge.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ge.cssNumber[n]?"":"px")},cur:function(){var e=R.propHooks[this.prop];return e&&e.get?e.get(this):R.propHooks._default.get(this)},run:function(e){var t,n=R.propHooks[this.prop];return this.options.duration?this.pos=t=ge.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):R.propHooks._default.set(this),this}},R.prototype.init.prototype=R.prototype,R.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ge.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){ge.fx.step[e.prop]?ge.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[ge.cssProps[e.prop]]&&!ge.cssHooks[e.prop]?e.elem[e.prop]=e.now:ge.style(e.elem,e.prop,e.now+e.unit)}}},R.propHooks.scrollTop=R.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ge.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ge.fx=R.prototype.init,ge.fx.step={};var ht,gt,mt=/^(?:toggle|show|hide)$/,vt=/queueHooks$/;ge.Animation=ge.extend(X,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return g(n.elem,e,_e.exec(t),n),n}]},tweener:function(e,t){ge.isFunction(e)?(t=e,e=["*"]):e=e.match(Le);for(var n,r=0,i=e.length;r1)},removeAttr:function(e){return this.each(function(){ge.removeAttr(this,e)})}}),ge.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ge.prop(e,t,n):(1===o&&ge.isXMLDoc(e)||(i=ge.attrHooks[t.toLowerCase()]||(ge.expr.match.bool.test(t)?yt:undefined)),n!==undefined?null===n?void ge.removeAttr(e,t):i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=ge.find.attr(e,t),null==r?undefined:r))},attrHooks:{type:{set:function(e,t){if(!pe.radioValue&&"radio"===t&&i(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Le);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),yt={set:function(e,t,n){return!1===t?ge.removeAttr(e,n):e.setAttribute(n,n),n}},ge.each(ge.expr.match.bool.source.match(/\w+/g),function(e,t){var n=xt[t]||ge.find.attr;xt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=xt[s],xt[s]=i,i=null!=n(e,t,r)?s:null,xt[s]=o),i}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;ge.fn.extend({prop:function(e,t){return qe(this,ge.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ge.propFix[e]||e]})}}),ge.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ge.isXMLDoc(e)||(t=ge.propFix[t]||t,i=ge.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ge.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),pe.optSelected||(ge.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ge.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ge.propFix[this.toLowerCase()]=this}),ge.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,u=0;if(ge.isFunction(e))return this.each(function(t){ge(this).addClass(e.call(this,t,Q(this)))});if("string"==typeof e&&e)for(t=e.match(Le)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&" "+U(i)+" "){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a=U(r),i!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,u=0;if(ge.isFunction(e))return this.each(function(t){ge(this).removeClass(e.call(this,t,Q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Le)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&" "+U(i)+" "){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");a=U(r),i!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ge.isFunction(e)?this.each(function(n){ge(this).toggleClass(e.call(this,n,Q(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=ge(this),o=e.match(Le)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else e!==undefined&&"boolean"!==n||(t=Q(this),t&&$e.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":$e.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+U(Q(n))+" ").indexOf(t)>-1)return!0;return!1}});var Tt=/\r/g;ge.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=ge.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,ge(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=ge.map(i,function(e){return null==e?"":e+""})),(t=ge.valHooks[this.type]||ge.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return(t=ge.valHooks[i.type]||ge.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace(Tt,""):null==n?"":n)}}}),ge.extend({valHooks:{option:{get:function(e){var t=ge.find.attr(e,"value");return null!=t?t:U(ge.text(e))}},select:{get:function(e){var t,n,r,o=e.options,s=e.selectedIndex,a="select-one"===e.type,u=a?null:[],c=a?s+1:o.length;for(r=s<0?c:a?s:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ge.each(["radio","checkbox"],function(){ge.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=ge.inArray(ge(e).val(),t)>-1}},pe.checkOn||(ge.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var St=/^(?:focusinfocus|focusoutblur)$/;ge.extend(ge.event,{trigger:function(t,n,r,i){var o,s,a,u,c,l,f,d=[r||ne],p=le.call(t,"type")?t.type:t,h=le.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||ne,3!==r.nodeType&&8!==r.nodeType&&!St.test(p+ge.event.triggered)&&(p.indexOf(".")>-1&&(h=p.split("."),p=h.shift(),h.sort()),c=p.indexOf(":")<0&&"on"+p,t=t[ge.expando]?t:new ge.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:ge.makeArray(n,[t]),f=ge.event.special[p]||{},i||!f.trigger||!1!==f.trigger.apply(r,n))){if(!i&&!f.noBubble&&!ge.isWindow(r)){for(u=f.delegateType||p,St.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(r.ownerDocument||ne)&&d.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)t.type=o>1?u:f.bindType||p,l=($e.get(s,"events")||{})[t.type]&&$e.get(s,"handle"),l&&l.apply(s,n),(l=c&&s[c])&&l.apply&&Fe(s)&&(t.result=l.apply(s,n),!1===t.result&&t.preventDefault());return t.type=p,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),n)||!Fe(r)||c&&ge.isFunction(r[p])&&!ge.isWindow(r)&&(a=r[c],a&&(r[c]=null),ge.event.triggered=p,r[p](),ge.event.triggered=undefined,a&&(r[c]=a)),t.result}},simulate:function(e,t,n){var r=ge.extend(new ge.Event,n,{type:e,isSimulated:!0});ge.event.trigger(r,null,t)}}),ge.fn.extend({trigger:function(e,t){return this.each(function(){ge.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ge.event.trigger(e,t,n,!0)}}),ge.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){ge.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ge.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),pe.focusin="onfocusin"in e,pe.focusin||ge.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ge.event.simulate(t,e.target,ge.event.fix(e))};ge.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=$e.access(r,t);i||r.addEventListener(e,n,!0),$e.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=$e.access(r,t)-1;i?$e.access(r,t,i):(r.removeEventListener(e,n,!0),$e.remove(r,t))}}});var Et=e.location,Ct=ge.now(),kt=/\?/;ge.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=undefined}return n&&!n.getElementsByTagName("parsererror").length||ge.error("Invalid XML: "+t),n};var Nt=/\[\]$/,jt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;ge.param=function(e,t){var n,r=[],i=function(e,t){var n=ge.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!ge.isPlainObject(e))ge.each(e,function(){i(this.name,this.value)});else for(n in e)Y(n,e[n],t,i);return r.join("&")},ge.fn.extend({serialize:function(){return ge.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ge.prop(this,"elements");return e?ge.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ge(this).is(":disabled")&&Lt.test(this.nodeName)&&!At.test(e)&&(this.checked||!Ve.test(e))}).map(function(e,t){var n=ge(this).val();return null==n?null:Array.isArray(n)?ge.map(n,function(e){return{name:t.name,value:e.replace(jt,"\r\n")}}):{name:t.name,value:n.replace(jt,"\r\n")}}).get()}});var Dt=/%20/g,Ot=/#.*$/,qt=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,$t=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Pt=/^(?:GET|HEAD)$/,Ht=/^\/\//,It={},Rt={},_t="*/".concat("*"),Mt=ne.createElement("a");Mt.href=Et.href,ge.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:$t.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ge.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?K(K(e,ge.ajaxSettings),t):K(ge.ajaxSettings,e)},ajaxPrefilter:J(It),ajaxTransport:J(Rt),ajax:function(t,n){function r(t,n,r,a){var c,d,p,b,w,T=n;l||(l=!0,u&&e.clearTimeout(u),i=undefined,s=a||"",S.readyState=t>0?4:0,c=t>=200&&t<300||304===t,r&&(b=Z(h,S,r)),b=ee(h,b,S,c),c?(h.ifModified&&(w=S.getResponseHeader("Last-Modified"),w&&(ge.lastModified[o]=w),(w=S.getResponseHeader("etag"))&&(ge.etag[o]=w)),204===t||"HEAD"===h.type?T="nocontent":304===t?T="notmodified":(T=b.state,d=b.data,p=b.error,c=!p)):(p=T,!t&&T||(T="error",t<0&&(t=0))),S.status=t,S.statusText=(n||T)+"",c?v.resolveWith(g,[d,T,S]):v.rejectWith(g,[S,T,p]),S.statusCode(x),x=undefined,f&&m.trigger(c?"ajaxSuccess":"ajaxError",[S,h,c?d:p]),y.fireWith(g,[S,T]),f&&(m.trigger("ajaxComplete",[S,h]),--ge.active||ge.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=undefined),n=n||{};var i,o,s,a,u,c,l,f,d,p,h=ge.ajaxSetup({},n),g=h.context||h,m=h.context&&(g.nodeType||g.jquery)?ge(g):ge.event,v=ge.Deferred(),y=ge.Callbacks("once memory"),x=h.statusCode||{},b={},w={},T="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=Ft.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?s:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)S.always(e[S.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(v.promise(S),h.url=((t||h.url||Et.href)+"").replace(Ht,Et.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Le)||[""],null==h.crossDomain){c=ne.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Mt.protocol+"//"+Mt.host!=c.protocol+"//"+c.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ge.param(h.data,h.traditional)),G(It,h,n,S),l)return S;f=ge.event&&h.global,f&&0==ge.active++&&ge.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Pt.test(h.type),o=h.url.replace(Ot,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Dt,"+")):(p=h.url.slice(o.length),h.data&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(qt,"$1"),p=(kt.test(o)?"&":"?")+"_="+Ct+++p),h.url=o+p),h.ifModified&&(ge.lastModified[o]&&S.setRequestHeader("If-Modified-Since",ge.lastModified[o]),ge.etag[o]&&S.setRequestHeader("If-None-Match",ge.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&S.setRequestHeader("Content-Type",h.contentType),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+_t+"; q=0.01":""):h.accepts["*"]);for(d in h.headers)S.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(g,S,h)||l))return S.abort();if(T="abort",y.add(h.complete),S.done(h.success),S.fail(h.error),i=G(Rt,h,n,S)){if(S.readyState=1,f&&m.trigger("ajaxSend",[S,h]),l)return S;h.async&&h.timeout>0&&(u=e.setTimeout(function(){S.abort("timeout")},h.timeout));try{l=!1,i.send(b,r)}catch(e){if(l)throw e;r(-1,e)}}else r(-1,"No Transport");return S},getJSON:function(e,t,n){return ge.get(e,t,n,"json")},getScript:function(e,t){return ge.get(e,undefined,t,"script")}}),ge.each(["get","post"],function(e,t){ge[t]=function(e,n,r,i){return ge.isFunction(n)&&(i=i||r,r=n,n=undefined),ge.ajax(ge.extend({url:e,type:t,dataType:i,data:n,success:r},ge.isPlainObject(e)&&e))}}),ge._evalUrl=function(e){return ge.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},ge.fn.extend({wrapAll:function(e){var t;return this[0]&&(ge.isFunction(e)&&(e=e.call(this[0])),t=ge(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ge.isFunction(e)?this.each(function(t){ge(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ge(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ge.isFunction(e);return this.each(function(n){ge(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ge(this).replaceWith(this.childNodes)}),this}}),ge.expr.pseudos.hidden=function(e){return!ge.expr.pseudos.visible(e)},ge.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ge.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Bt=ge.ajaxSettings.xhr();pe.cors=!!Bt&&"withCredentials"in Bt,pe.ajax=Bt=!!Bt,ge.ajaxTransport(function(t){var n,r;if(pe.cors||Bt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(s in i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Wt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),a.onabort!==undefined?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),ge.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ge.ajaxSetup({accepts:{ +script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ge.globalEval(e),e}}}),ge.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ge.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=ge(" + + + + + + + + + NAV + + + + +
+
+
+

Introduction

+

With v2.1, WooCommerce includes a REST API that allows store data to be accessed in either JSON or XML format. The current version is read-only (with a single exception for updating the status of an order), but future versions will allow updating, creating, and deleting resources.

+

Requirements

+

You must be using WooCommerce 2.1 and the REST API must be enabled under WooCommerce > Settings. You must enable pretty permalinks (default permalinks will not work).

+

Schema

+

The API is accessible via this endpoint:

+ +

https://www.example.com/wc-api/v1/

+ +

You may access the API over either HTTP or HTTPS. HTTPS is recommended where possible, and the API index will declare if the site supports SSL or not.

+

Version

+

The current version is v1 and takes a first-order position in endpoint URLs. This will only change for major releases.

+

Responses

+

The default response format is JSON. You can change this to XML by setting the HTTP ACCEPT header to either application/xml or text/xml. Successful requests will return a 200 OK HTTP status. Note that XML responses are slightly different in structure.

+ +

Some general information about responses:

+ +
    +
  • Dates are returned in RFC3339 format in UTC timezone: YYYY-MM-DDTHH:MM:SSZ

  • +
  • Resource IDs are returned as integers.

  • +
  • Any decimal monetary amount, such as prices or totals, are returned as strings with two decimal places. The decimal separator (typically either . or ,) is controlled by the site and is included in the API index. This is by design, in order to make localization of API data easier for the client. You may need to account for this in your implemetation if you will be doing calculations with the returned data (e.g. convert string amounts with commas as the decimal place before performing any calculations)

  • +
  • Other amounts, such as item counts, are returned as integers.

  • +
  • Blank fields are generally included as null instead of being blank strings or omitted.

  • +
+

Authentication

+

There are two ways to authenticate with the API, depending on whether the site supports SSL or not. Remember that the Index endpoint will indicate if the site supports SSL or not.

+

Over HTTPS

+

You may use HTTP Basic Auth by providing the API Consumer Key as the username and the API Consumer Secret as the password:

+
$ curl https://www.example.com/wc-api/v1/orders \
+    -u consumer_key:consumer_secret
+
+

Occasionally some servers may not properly parse the Authorization header (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In WooCommerce 2.1.7+, you may provide the consumer key/secret as query string parameters:

+
$ curl https://www.example.com/wc-api/v1/orders?consumer_key=123&consumer_secret=abc
+

Over HTTP

+

You must use OAuth 1.0a "one-legged" authentication to ensure API credentials cannot be intercepted. Typically you may use any standard OAuth 1.0a library in your language of choice to handle the authentication, or generate the necessary parameters by following these instructions.

+

Generating an OAuth signature

+

1) Set the HTTP method for the request:

+ +

GET

+ +

2) Set your base request URI -- this is the full request URI without query string parameters -- and URL encode according to RFC 3986:

+
http://www.example.com/wc-api/v1/orders
+
+

when encoded:

+
http%3A%2F%2Fwww.example.com%2Fwc-api%2Fv1%2Forders
+
+

3) Collect and normalize your query string parameters. This includes all oauth_* parameters except for the signature. Parameters should be normalized by URL encoding according to RFC 3986 (rawurlencode in PHP) and percent(%) characters should be double-encoded (e.g. % becomes %25.

+ +

4) Sort the parameters in byte-order (uksort( $params, 'strcmp' ) in PHP)

+ +

5) Join each parameter with an encoded equals sign (%3D):

+ +

oauth_signature_method%3DHMAC-SHA1

+ +

6) Join each parameter key/value with an encoded ampersand (%26):

+ +

oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1

+ +

7) Form the string to sign by joining the HTTP method, encoded base request URI, and encoded parameter string with an unencoded ampersand symbol (&):

+ +

GET&http%3A%2F%2Fwww.example.com%2Fwc-api%2Fv1%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1

+ +

8) Generate the signature using the string to key and your consumer secret key

+ +

If you are having trouble generating a correct signature, you'll want to review your string to sign for errors with encoding. The authentication source can also be helpful in understanding how to properly generate the signature.

+

OAuth Tips

+
    +
  • The OAuth parameters must be added as query string parameters and not include in the Authorization header.

  • +
  • The require parameters are: oauth_consumer_key, oauth_timestamp, oauth_nonce, oauth_signature, and oauth_signature_method. oauth_version is not required and must be omitted.

  • +
  • HMAC-SHA1 or HMAC-SHA256 are the only accepted hash algorithms.

  • +
  • The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key. Read more suggestions on generating a nonce on the Twitter API forums.

  • +
  • The OAuth timestamp should be the unix timestamp at the time of the request. The API will deny any requests that include a timestamp that is outside of a 15 minute window to prevent replay attacks.

  • +
  • You must use the store URL provided by the index when forming the base string used for the signature, as this is what the server will use. (e.g. if the store URL includes a www sub-domain, you should use it for requests)

  • +
  • Some OAuth libraries add an ampersand to the provided secret key before generating the signature. This does not adhere to the OAuth spec and the ampersand should be removed prior to generating the signature.

  • +
  • You may test your generated signature using LinkedIn's OAuth test console -- leave the member token/secret blank.

  • +
  • Twitter has great instructions on generating a signature with OAuth 1.0a, but remember tokens are not used with this implementation.

  • +
  • Note that the request body is not signed as per the OAuth spec, see Google's OAuth 1.0 extension for details on why.

  • +
+

Parameters

+

API endpoints may take optional parameters which can be passed as an HTTP query string parameter:

+ +

GET /orders?status=completed

+ +

All endpoints accept a filter parameter that scopes individual filters using brackets, like date filtering:

+ +

GET /orders?filter[created_at_min]=2013-11-01

+ +

Multiple filter parameters can be included and intermixed with other parameters:

+ +

GET /orders?status=completed&filter[created_at_min]=2013-11-01&filter[created_at_max]=2013-11-30

+ +

You can do a keyword search using the q filter parameter:

+ +

GET /products?filter[q]=search-keyword

+ +

Resource meta is excluded by default, but can be included with the meta filter parameter:

+ +

GET /orders?filter[meta]=true

+ +

Protected meta (meta whose key is prefixed with an underscore) is not included in the response. The reports endpoint does not support meta.

+ +

You may limit the fields returned in the response using the fields parameter:

+ +

GET /orders?fields=id

+ +

To include multiple fields, separate them with commas:

+ +

GET /orders?fields=id,status

+ +

You can specify sub-fields using dot-notation:

+ +

GET /orders?fields=id,status,payment_details.method_title

+ +

Sub-fields can't be limited for resources that have multiple structs, like an order's line items. For example, this will return just the line items, but each line item will have the full set of information, not just the product ID:

+ +

GET /orders?fields=line_items.product_id

+ +

Some general guidelines when using parameters:

+ +
    +
  • Dates should be provided in RFC3339 format in UTC timezone: YYYY-MM-DDTHH:MM:SSZ. You may omit the time and timezone if desired.

  • +
  • When using the q filter for searching, search terms should be URL-encoded as they will be decoded internally with urldecode

  • +
+

Errors

+

Occasionally you might encounter errors when accessing the API. There are four possible types:

+ +
    +
  • Invalid requests, such as using an unsupported HTTP method will result in 400 Bad Request:
  • +
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_unsupported_method",
+      "message" : "Unsupported request method"
+    }
+  ]
+}
+
+
    +
  • Authentication or permission errors, such as incorrect API keys will result in 401 Unauthorized:
  • +
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_authentication_error",
+      "message" : "Consumer Key is invalid"
+    }
+  ]
+}
+
+
    +
  • Requests to resources that don't exist or are missing required parameters will result in 404 Not Found:
  • +
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_invalid_order",
+      "message" : "Invalid order"
+    }
+  ]
+}
+
+
    +
  • Requests that cannot be processed due to a server error will result in 500 Internal Server Error:
  • +
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_invalid_handler",
+      "message" : "The handler for the route is invalid"
+    }
+  ]
+}
+
+

Errors return both an appropriate HTTP status code and response object which contains a code and message attribute. If an endpoint has any custom errors, they are documented with that endpoint.

+

HTTP Verbs

+

The API uses the appropriate HTTP verb for each action:

+ +
    +
  • HEAD - Can be used for any endpoint to return just the HTTP header information
  • +
  • GET - Used for retrieving resources
  • +
  • PUT - Used for updating resources, currently only supported for the orders/#{id} endpoint.
  • +
+ +

In future version of the API, POST and DELETE will be supported.

+

Pagination

+

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specifed with the ?filter[limit] parameter:

+ +

GET /orders?filter[limit]=15

+ +

You can specify further pages with the ?page parameter:

+ +

GET /orders?page=2

+ +

You may also specify the offset from the first resource using the ?filter[offset] parameter:

+ +

GET /orders?filter[offset]=5

+ +

Page number is 1-based and ommiting the ?page parameter will return the first page.

+ +

The total number of resources and pages are always included in the X-WC-Total and X-WC-TotalPages HTTP headers.

+ +

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

+
Link: <https://www.example.com/wc-api/v1/products?page=2>; rel="next",
+<https://www.example.com/wc-api/v1/products?page=3>; rel="last"`
+
+

Linebreak included for readability

+ +

The possible rel values are:

+ +
    +
  • next - Shows the URL of the immediate next page of results
  • +
  • last - Shows the URL of the last page of results
  • +
  • first - Shows the URL of the first page of results
  • +
  • prev - Shows the URL of the immediate previous page of results
  • +
+

JSON-P Support

+

The API supports JSON-P by default. You can specify the callback using the ?_jsonp parameter for GET requests to have the response wrapped in a JSON function:

+
GET /orders/count?_jsonp=ordersCount
+
+ordersCount({"count":8})
+
+

If the site administrator has chosen to disable it, you will receive a400 Bad Request error:

+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_jsonp_disabled",
+      "message" : "JSONP support is disabled on this site"
+    }
+  ]
+}
+
+

If your callback contains invalid characters, you will receive a 400 Bad Request error:

+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_jsonp_callback_invalid",
+      "message" : "The JSONP callback function is invalid"
+    }
+  ]
+}
+

Endpoints

+

The API supports 5 primary resources, each with a related set of endpoints.

+

Index

+

The API index provides information about the endpoints available for the site, as well as store-specific information. No authentication is required to access the API index, however if the REST API is disabled, you will receive a 404 Not Found error:

+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_disabled",
+      "message" : "The WooCommerce API is disabled on this site"
+    }
+  ]
+}
+

Store Properties

+
    +
  • routes: a list of available endpoints for the site keyed by relative URL. Each endpoint specifies the HTTP methods supported as well as the canonical URL.
  • +
  • dimension_unit: the unit set for product dimensions. Valid units are cm, m, cm, mm, in, and yd
  • +
  • tax_included: true if prices include tax, false otherwise
  • +
  • ssl_enabled: true if SSL is enabled for the site, false otherwise
  • +
  • timezone: the site's timezone
  • +
  • currency_format: the currency symbol, HTML encoded
  • +
  • weight_unit: the unit set for product weights. Valid units are kg, g, lbs, oz
  • +
  • description: the site's description
  • +
  • name: the name of the site
  • +
  • URL: the site's URL
  • +
  • permalinks_enabled: whether pretty permalinks are enabled on the site, if this is false, the API will not function correctly
  • +
  • wc_version: the active WooCommerce version
  • +
+

GET /

+

Retrieve a set of store information:

+
{
+  "store" : {
+    "routes" : {
+      "/customers" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/customers"
+        }
+      },
+      "/coupons/count" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/coupons/count"
+        }
+      },
+      "/orders/count" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/orders/count"
+        }
+      },
+      "/products/<id>/reviews" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/coupons/code/<code>" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/orders/<id>/notes" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/customers/count" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/customers/count"
+        }
+      },
+      "/customers/<id>" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/reports" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/reports"
+        }
+      },
+      "/reports/sales" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/reports/sales"
+        }
+      },
+      "/products/count" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/products/count"
+        }
+      },
+      "/coupons/<id>" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/"
+        }
+      },
+      "/products" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/products"
+        }
+      },
+      "/orders/<id>" : {
+        "supports" : [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH"
+        ],
+        "accepts_data" : true
+      },
+      "/customers/<id>/orders" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/products/<id>" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/orders" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/orders"
+        }
+      },
+      "/coupons" : {
+        "supports" : [
+          "HEAD",
+          "GET"
+        ],
+        "meta" : {
+          "self" : "https://www.example.com/wc-api/v1/coupons"
+        }
+      }
+    },
+    "meta" : {
+      "dimension_unit" : "in",
+      "tax_included" : false,
+      "ssl_enabled" : true,
+      "timezone" : "America/New_York",
+      "currency_format" : "&#36;",
+      "weight_unit" : "oz",
+      "links" : {
+        "help" : "http://docs.woocommerce.com/document/woocommerce-rest-api/"
+      },
+      "currency" : "USD",
+      "permalinks_enabled" : true,
+
+    },
+    "description" : "WooCommerce All the Things!",
+    "name" : "WooCommerce",
+    "URL" : "http://www.example.com"
+  }
+}
+

Coupons

Coupon Properties

+
    +
  • expiry_date: the date the coupon is expired
  • +
  • individual_use: true if the coupon may only be used individually, false otherwise
  • +
  • exclude_product_category_ids: a list of product category IDs that this coupon cannot be applied to
  • +
  • amount: the amount of the coupon
  • +
  • code: the coupon's code that is entered at the cart/checkout page to apply the discount
  • +
+ +

@TODO

+

GET /coupons

+

Retrieve a list of coupons:

+
"coupons" : [
+    {
+      "expiry_date" : "2013-11-22T00:00:00Z",
+      "individual_use" : false,
+      "exclude_product_category_ids" : [],
+      "amount" : "5.00",
+      "code" : "test123",
+      "product_category_ids" : [
+        22
+      ],
+      "updated_at" : "2013-11-23T21:08:10Z",
+      "limit_usage_to_x_items" : 0,
+      "product_ids" : [
+        73
+      ],
+      "exclude_sale_items" : false,
+      "type" : "fixed_cart",
+      "apply_before_tax" : false,
+      "minimum_amount" : "0.00",
+      "id" : 137,
+      "exclude_product_ids" : [],
+      "usage_limit" : null,
+      "usage_count" : 0,
+      "created_at" : "2013-11-18T15:38:53Z",
+      "usage_limit_per_user" : null,
+      "enable_free_shipping" : false,
+      "customer_emails" : []
+    }
+  ]
+}
+

GET /coupons/count

+

Retrieve a count of all coupons:

+
{
+  "count" : 3
+}
+

GET /coupons/#{id}

GET /coupons/code/{code}

+

Retrieve a single coupon specified by it's ID or code.

+ +

Note that coupon codes may contain spaces, dashes and underscores and should be URL-encoded.

+
{
+  "coupon" : {
+    "expiry_date" : "2013-11-22T00:00:00Z",
+    "individual_use" : false,
+    "exclude_product_category_ids" : [],
+    "amount" : "5.00",
+    "code" : "test123",
+    "product_category_ids" : [
+      22
+    ],
+    "updated_at" : "2013-11-23T21:08:10Z",
+    "limit_usage_to_x_items" : 0,
+    "product_ids" : [
+      73
+    ],
+    "exclude_sale_items" : false,
+    "type" : "fixed_cart",
+    "apply_before_tax" : false,
+    "minimum_amount" : "0.00",
+    "id" : 137,
+    "exclude_product_ids" : [],
+    "usage_limit" : null,
+    "usage_count" : 0,
+    "created_at" : "2013-11-18T15:38:53Z",
+    "usage_limit_per_user" : null,
+    "enable_free_shipping" : false,
+    "customer_emails" : []
+  }
+}
+

Customers

+

All endpoints (except for customer orders) support date filtering via created_at_min and created_at_max as ?filter[] parameters. e.g. ?filter[created_at_min]=2013-12-01

+

Customer Properties

+

@TODO

+

GET /customers

+

Retrieve a list of customers:

+
{
+  "customers" : [
+    {
+      "id" : 4,
+      "last_order_date" : "2013-12-10T18:58:00Z",
+      "avatar_url" : "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "total_spent" : "0.00",
+      "created_at" : "2013-12-10T18:58:07Z",
+      "orders_count" : 0,
+      "billing_address" : {
+        "phone" : "215-523-4132",
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "email" : "thedon@mailinator.com",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "shipping_address" : {
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "first_name" : "Don",
+      "username" : "thedon",
+      "last_name" : "Draper",
+      "last_order_id" : "113",
+      "email" : "thedon@mailinator.com"
+    }
+  ]
+}
+

GET /customers/count

+

Retrieve a count of all customers:

+
{
+  "count" : 18
+}
+

GET /customers/#{id}

+

Retrieve a single customer specified by their ID:

+
{
+  "customer" : {
+    "id" : 4,
+    "last_order_date" : "2013-12-10T18:58:00Z",
+    "avatar_url" : "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "total_spent" : "0.00",
+    "created_at" : "2013-12-10T18:58:07Z",
+    "orders_count" : 0,
+    "billing_address" : {
+      "phone" : "215-523-4132",
+      "city" : "New York",
+      "country" : "US",
+      "address_1" : "512 First Avenue",
+      "last_name" : "Draper",
+      "company" : "SDCP",
+      "postcode" : "12534",
+      "email" : "thedon@mailinator.com",
+      "address_2" : "",
+      "state" : "NY",
+      "first_name" : "Don"
+    },
+    "shipping_address" : {
+      "city" : "New York",
+      "country" : "US",
+      "address_1" : "512 First Avenue",
+      "last_name" : "Draper",
+      "company" : "SDCP",
+      "postcode" : "12534",
+      "address_2" : "",
+      "state" : "NY",
+      "first_name" : "Don"
+    },
+    "first_name" : "Don",
+    "username" : "thedon",
+    "last_name" : "Draper",
+    "last_order_id" : "113",
+    "email" : "thedon@mailinator.com"
+  }
+}
+

GET /customers/#{id}/orders

+

Retrieve a list of orders for a customer specified by their ID:

+
{
+  "orders" : [
+    {
+      "completed_at" : "2013-12-10T18:59:30Z",
+      "tax_lines" : [],
+      "status" : "processing",
+      "total" : "20.00",
+      "cart_discount" : "0.00",
+      "customer_ip" : "127.0.0.1",
+      "total_discount" : "0.00",
+      "updated_at" : "2013-12-10T18:59:30Z",
+      "currency" : "USD",
+      "total_shipping" : "0.00",
+      "customer_user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
+      "line_items" : [
+        {
+          "product_id" : 31,
+          "quantity" : 1,
+          "id" : 7,
+          "subtotal" : "20.00",
+          "tax_class" : null,
+          "sku" : "",
+          "total" : "20.00",
+          "name" : "Ninja Silhouette",
+          "total_tax" : "0.00"
+        }
+      ],
+      "customer_id" : "4",
+      "total_tax" : "0.00",
+      "order_number" : "#113",
+      "shipping_methods" : "Free Shipping",
+      "shipping_address" : {
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "payment_details" : {
+        "method_title" : "Cheque Payment",
+        "method_id" : "cheque",
+        "paid" : false
+      },
+      "id" : 113,
+      "shipping_tax" : "0.00",
+      "cart_tax" : "0.00",
+      "fee_lines" : [],
+      "total_line_items_quantity" : 1,
+      "shipping_lines" : [
+        {
+          "method_title" : "Free Shipping",
+          "id" : 8,
+          "method_id" : "free_shipping",
+          "total" : "0.00"
+        }
+      ],
+      "customer" : {
+        "id" : 4,
+        "last_order_date" : "2013-12-10T18:58:00Z",
+        "avatar_url" : "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "total_spent" : "0.00",
+        "created_at" : "2013-12-10T18:58:07Z",
+        "orders_count" : 0,
+        "billing_address" : {
+          "phone" : "215-523-4132",
+          "city" : "New York",
+          "country" : "US",
+          "address_1" : "512 First Avenue",
+          "last_name" : "Draper",
+          "company" : "SDCP",
+          "postcode" : "12534",
+          "email" : "thedon@mailinator.com",
+          "address_2" : "",
+          "state" : "NY",
+          "first_name" : "Don"
+        },
+        "shipping_address" : {
+          "city" : "New York",
+          "country" : "US",
+          "address_1" : "512 First Avenue",
+          "last_name" : "Draper",
+          "company" : "SDCP",
+          "postcode" : "12534",
+          "address_2" : "",
+          "state" : "NY",
+          "first_name" : "Don"
+        },
+        "first_name" : "Don",
+        "username" : "thedon",
+        "last_name" : "Draper",
+        "last_order_id" : "113",
+        "email" : "thedon@mailinator.com"
+      },
+      "note" : "",
+      "coupon_lines" : [],
+      "order_discount" : "0.00",
+      "created_at" : "2013-12-10T18:58:00Z",
+      "view_order_url" : "https://www.example.com/my-account/view-order/113",
+      "billing_address" : {
+        "phone" : "215-523-4132",
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "email" : "thedon@mailinator.com",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      }
+    }
+  ]
+}
+

Orders

+

All endpoints (except for order notes) support the full set of date filters (created_at_min, created_at_max, updated_at_min, updated_at_max) as ?filter[] parameters. e.g. ?filter[created_at_min]=2013-12-01

+

Order Properties

+

@TODO

+

GET /orders

+

Retrieve a list of orders

+ +

You can use the ?status? parameter to limit the orders returned to a specific order status. The default WooCommerce order statuses are pending, on-hold, processing, completed, refunded, failed, and cancelled. Custom order statuses are supported.

+
{
+  "orders" : [
+    {
+      "completed_at" : "2013-12-10T18:59:30Z",
+      "tax_lines" : [],
+      "status" : "processing",
+      "total" : "20.00",
+      "cart_discount" : "0.00",
+      "customer_ip" : "127.0.0.1",
+      "total_discount" : "0.00",
+      "updated_at" : "2013-12-10T18:59:30Z",
+      "currency" : "USD",
+      "total_shipping" : "0.00",
+      "customer_user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
+      "line_items" : [
+        {
+          "product_id" : 31,
+          "quantity" : 1,
+          "id" : 7,
+          "subtotal" : "20.00",
+          "tax_class" : null,
+          "sku" : "",
+          "total" : "20.00",
+          "name" : "Ninja Silhouette",
+          "total_tax" : "0.00"
+        }
+      ],
+      "customer_id" : "4",
+      "total_tax" : "0.00",
+      "order_number" : "#113",
+      "shipping_methods" : "Free Shipping",
+      "shipping_address" : {
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "payment_details" : {
+        "method_title" : "Cheque Payment",
+        "method_id" : "cheque",
+        "paid" : false
+      },
+      "id" : 113,
+      "shipping_tax" : "0.00",
+      "cart_tax" : "0.00",
+      "fee_lines" : [],
+      "total_line_items_quantity" : 1,
+      "shipping_lines" : [
+        {
+          "method_title" : "Free Shipping",
+          "id" : 8,
+          "method_id" : "free_shipping",
+          "total" : "0.00"
+        }
+      ],
+      "customer" : {
+        "id" : 4,
+        "last_order_date" : "2013-12-10T18:58:00Z",
+        "avatar_url" : "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "total_spent" : "0.00",
+        "created_at" : "2013-12-10T18:58:07Z",
+        "orders_count" : 0,
+        "billing_address" : {
+          "phone" : "215-523-4132",
+          "city" : "New York",
+          "country" : "US",
+          "address_1" : "512 First Avenue",
+          "last_name" : "Draper",
+          "company" : "SDCP",
+          "postcode" : "12534",
+          "email" : "thedon@mailinator.com",
+          "address_2" : "",
+          "state" : "NY",
+          "first_name" : "Don"
+        },
+        "shipping_address" : {
+          "city" : "New York",
+          "country" : "US",
+          "address_1" : "512 First Avenue",
+          "last_name" : "Draper",
+          "company" : "SDCP",
+          "postcode" : "12534",
+          "address_2" : "",
+          "state" : "NY",
+          "first_name" : "Don"
+        },
+        "first_name" : "Don",
+        "username" : "thedon",
+        "last_name" : "Draper",
+        "last_order_id" : "113",
+        "email" : "thedon@mailinator.com"
+      },
+      "note" : "",
+      "coupon_lines" : [],
+      "order_discount" : "0.00",
+      "created_at" : "2013-12-10T18:58:00Z",
+      "view_order_url" : "https://www.example.com/my-account/view-order/113",
+      "billing_address" : {
+        "phone" : "215-523-4132",
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "email" : "thedon@mailinator.com",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      }
+    }
+  ]
+}
+

GET /orders/count

+

Retrieve a count of all orders:

+
{
+  "count" : 27
+}
+

GET /orders/#{id}

+

Retrieve a single order specified by it's ID:

+
{
+  "order" : {
+    "completed_at" : "2013-12-10T18:59:30Z",
+    "tax_lines" : [],
+    "status" : "processing",
+    "total" : "20.00",
+    "cart_discount" : "0.00",
+    "customer_ip" : "127.0.0.1",
+    "total_discount" : "0.00",
+    "updated_at" : "2013-12-10T18:59:30Z",
+    "currency" : "USD",
+    "total_shipping" : "0.00",
+    "customer_user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
+    "line_items" : [
+      {
+        "product_id" : 31,
+        "quantity" : 1,
+        "id" : 7,
+        "subtotal" : "20.00",
+        "tax_class" : null,
+        "sku" : "",
+        "total" : "20.00",
+        "name" : "Ninja Silhouette",
+        "total_tax" : "0.00"
+      }
+    ],
+    "customer_id" : "4",
+    "total_tax" : "0.00",
+    "order_number" : "#113",
+    "shipping_methods" : "Free Shipping",
+    "shipping_address" : {
+      "city" : "New York",
+      "country" : "US",
+      "address_1" : "512 First Avenue",
+      "last_name" : "Draper",
+      "company" : "SDCP",
+      "postcode" : "12534",
+      "address_2" : "",
+      "state" : "NY",
+      "first_name" : "Don"
+    },
+    "payment_details" : {
+      "method_title" : "Cheque Payment",
+      "method_id" : "cheque",
+      "paid" : false
+    },
+    "id" : 113,
+    "shipping_tax" : "0.00",
+    "cart_tax" : "0.00",
+    "fee_lines" : [],
+    "total_line_items_quantity" : 1,
+    "shipping_lines" : [
+      {
+        "method_title" : "Free Shipping",
+        "id" : 8,
+        "method_id" : "free_shipping",
+        "total" : "0.00"
+      }
+    ],
+    "customer" : {
+      "id" : 4,
+      "last_order_date" : "2013-12-10T18:58:00Z",
+      "avatar_url" : "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "total_spent" : "0.00",
+      "created_at" : "2013-12-10T18:58:07Z",
+      "orders_count" : 0,
+      "billing_address" : {
+        "phone" : "215-523-4132",
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "email" : "thedon@mailinator.com",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "shipping_address" : {
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "first_name" : "Don",
+      "username" : "thedon",
+      "last_name" : "Draper",
+      "last_order_id" : "113",
+      "email" : "thedon@mailinator.com"
+    },
+    "note" : "",
+    "coupon_lines" : [],
+    "order_discount" : "0.00",
+    "created_at" : "2013-12-10T18:58:00Z",
+    "view_order_url" : "https://www.example.com/my-account/view-order/113",
+    "billing_address" : {
+      "phone" : "215-523-4132",
+      "city" : "New York",
+      "country" : "US",
+      "address_1" : "512 First Avenue",
+      "last_name" : "Draper",
+      "company" : "SDCP",
+      "postcode" : "12534",
+      "email" : "thedon@mailinator.com",
+      "address_2" : "",
+      "state" : "NY",
+      "first_name" : "Don"
+    }
+  }
+}
+

PUT /orders/#{id}?status={status}

+

Update the status for an order specified by it's ID

+ +

The request body should be JSON:

+
{
+    "status":"completed"
+}
+
+

If successful, the updated order is returned:

+
{
+  "order" : {
+    "completed_at" : "2013-12-10T18:59:30Z",
+    "tax_lines" : [],
+    "status" : "completed",
+    "total" : "20.00",
+    "cart_discount" : "0.00",
+    "customer_ip" : "127.0.0.1",
+    "total_discount" : "0.00",
+    "updated_at" : "2013-12-10T18:59:30Z",
+    "currency" : "USD",
+    "total_shipping" : "0.00",
+    "customer_user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
+    "line_items" : [
+      {
+        "product_id" : 31,
+        "quantity" : 1,
+        "id" : 7,
+        "subtotal" : "20.00",
+        "tax_class" : null,
+        "sku" : "",
+        "total" : "20.00",
+        "name" : "Ninja Silhouette",
+        "total_tax" : "0.00"
+      }
+    ],
+    "customer_id" : "4",
+    "total_tax" : "0.00",
+    "order_number" : "#113",
+    "shipping_methods" : "Free Shipping",
+    "shipping_address" : {
+      "city" : "New York",
+      "country" : "US",
+      "address_1" : "512 First Avenue",
+      "last_name" : "Draper",
+      "company" : "SDCP",
+      "postcode" : "12534",
+      "address_2" : "",
+      "state" : "NY",
+      "first_name" : "Don"
+    },
+    "payment_details" : {
+      "method_title" : "Cheque Payment",
+      "method_id" : "cheque",
+      "paid" : false
+    },
+    "id" : 113,
+    "shipping_tax" : "0.00",
+    "cart_tax" : "0.00",
+    "fee_lines" : [],
+    "total_line_items_quantity" : 1,
+    "shipping_lines" : [
+      {
+        "method_title" : "Free Shipping",
+        "id" : 8,
+        "method_id" : "free_shipping",
+        "total" : "0.00"
+      }
+    ],
+    "customer" : {
+      "id" : 4,
+      "last_order_date" : "2013-12-10T18:58:00Z",
+      "avatar_url" : "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "total_spent" : "0.00",
+      "created_at" : "2013-12-10T18:58:07Z",
+      "orders_count" : 0,
+      "billing_address" : {
+        "phone" : "215-523-4132",
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "email" : "thedon@mailinator.com",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "shipping_address" : {
+        "city" : "New York",
+        "country" : "US",
+        "address_1" : "512 First Avenue",
+        "last_name" : "Draper",
+        "company" : "SDCP",
+        "postcode" : "12534",
+        "address_2" : "",
+        "state" : "NY",
+        "first_name" : "Don"
+      },
+      "first_name" : "Don",
+      "username" : "thedon",
+      "last_name" : "Draper",
+      "last_order_id" : "113",
+      "email" : "thedon@mailinator.com"
+    },
+    "note" : "",
+    "coupon_lines" : [],
+    "order_discount" : "0.00",
+    "created_at" : "2013-12-10T18:58:00Z",
+    "view_order_url" : "https://www.example.com/my-account/view-order/113",
+    "billing_address" : {
+      "phone" : "215-523-4132",
+      "city" : "New York",
+      "country" : "US",
+      "address_1" : "512 First Avenue",
+      "last_name" : "Draper",
+      "company" : "SDCP",
+      "postcode" : "12534",
+      "email" : "thedon@mailinator.com",
+      "address_2" : "",
+      "state" : "NY",
+      "first_name" : "Don"
+    }
+  }
+}
+

GET /orders/#{id}/notes

+

Retrieve a list of notes for an order specified by it's ID:

+
{
+  "order_notes" : [
+    {
+      "note" : "Order status changed from processing to completed.",
+      "id" : "47",
+      "created_at" : "2013-12-10T20:08:06Z",
+      "customer_note" : false
+    },
+    {
+      "note" : "Order status changed from on-hold to processing.",
+      "id" : "46",
+      "created_at" : "2013-12-10T18:59:30Z",
+      "customer_note" : false
+    },
+    {
+      "note" : "Awaiting cheque payment Order status changed from pending to on-hold.",
+      "id" : "45",
+      "created_at" : "2013-12-10T18:58:23Z",
+      "customer_note" : false
+    }
+  ]
+}
+

Products

+

All endpoints (except for reviews) support the full set of date filters (created_at_min, created_at_max, updated_at_min, updated_at_max) as ?filter[] parameters. e.g. ?filter[created_at_min]=2013-12-01

+

Product Properties

+

@TODO

+

GET /products

+

Retrieve a list of products

+ +

You can use the ?type parameter to specify that only certain product types should be returned. The default WooCommerce product types are: simple, variable, grouped, and external. Custom product types are supported.

+
{
+  "products" : [
+    {
+      "related_ids" : [
+        87,
+        93,
+        96,
+        93,
+        83
+      ],
+      "variations" : [],
+      "categories" : [
+        "Music",
+        "Singles"
+      ],
+      "shipping_required" : true,
+      "id" : 99,
+      "parent" : [],
+      "regular_price" : "3.00",
+      "weight" : null,
+      "total_sales" : 0,
+      "sku" : "",
+      "rating_count" : 2,
+      "managing_stock" : false,
+      "title" : "Woo Single #2",
+      "backordered" : false,
+      "on_sale" : true,
+      "status" : "publish",
+      "download_limit" : 0,
+      "taxable" : false,
+      "reviews_allowed" : true,
+      "description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "purchaseable" : true,
+      "sale_price" : "2.00",
+      "type" : "simple",
+      "permalink" : "https://www.example.com/product/woo-single-2/",
+      "catalog_visibility" : "visible",
+      "download_expiry" : 0,
+      "dimensions" : {
+        "length" : "",
+        "height" : "",
+        "unit" : "in",
+        "width" : ""
+      },
+      "cross_sell_ids" : [],
+      "price" : "2.00",
+      "updated_at" : "2013-06-07T11:38:12Z",
+      "attributes" : [],
+      "shipping_class" : "",
+      "virtual" : false,
+      "downloadable" : false,
+      "upsell_ids" : [],
+      "created_at" : "2013-06-07T11:38:12Z",
+      "tax_class" : "",
+      "tags" : [],
+      "price_html" : "<del><span class=\"amount\">&#36;3</span></del> <ins><span class=\"amount\">&#36;2</span></ins>",
+      "in_stock" : true,
+      "sold_individually" : false,
+      "short_description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "downloads" : [],
+      "tax_status" : "taxable",
+      "average_rating" : "4.50",
+      "download_type" : "",
+      "shipping_taxable" : true,
+      "purchase_note" : "",
+      "shipping_class_id" : null,
+      "visible" : true,
+      "backorders_allowed" : false,
+      "images" : [
+        {
+          "position" : 0,
+          "id" : 100,
+          "created_at" : "2013-06-07T11:37:51Z",
+          "src" : "https://www.example.com/wp-content/uploads/2013/06/cd_6_angle.jpg",
+          "title" : "cd_6_angle",
+          "alt" : "",
+          "updated_at" : "2013-06-07T11:37:51Z"
+        },
+        {
+          "position" : 1,
+          "id" : 101,
+          "created_at" : "2013-06-07T11:38:03Z",
+          "src" : "https://www.example.com/wp-content/uploads/2013/06/cd_6_flat.jpg",
+          "title" : "cd_6_flat",
+          "alt" : "",
+          "updated_at" : "2013-06-07T11:38:03Z"
+        }
+      ],
+      "stock_quantity" : 0,
+      "featured" : false
+    }
+  ]
+}
+

GET /products/count

+

Retrieve a count of all products

+ +

You can use the ?type parameter to specify that only certain product types should be returned. The default WooCommerce product types are: simple, variable, grouped, and external. Custom product types are supported.

+
{
+  "count" : 23
+}
+

GET /products/#{id}

+

Retrieve a product specified by it's ID

+ +

Simple, Grouped, and External products will return a blank array for the variations property:

+
{
+  "product" : {
+    "related_ids" : [
+      93,
+      90,
+      93,
+      87,
+      83
+    ],
+    "variations" : [],
+    "categories" : [
+      "Music",
+      "Singles"
+    ],
+    "shipping_required" : true,
+    "id" : 99,
+    "parent" : [],
+    "regular_price" : "3.00",
+    "weight" : null,
+    "total_sales" : 0,
+    "sku" : "",
+    "rating_count" : 2,
+    "managing_stock" : false,
+    "title" : "Woo Single #2",
+    "backordered" : false,
+    "on_sale" : true,
+    "status" : "publish",
+    "download_limit" : 0,
+    "taxable" : false,
+    "reviews_allowed" : true,
+    "description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "purchaseable" : true,
+    "sale_price" : "2.00",
+    "type" : "simple",
+    "permalink" : "https://www.example.com/product/woo-single-2/",
+    "catalog_visibility" : "visible",
+    "download_expiry" : 0,
+    "dimensions" : {
+      "length" : "",
+      "height" : "",
+      "unit" : "in",
+      "width" : ""
+    },
+    "cross_sell_ids" : [],
+    "price" : "2.00",
+    "updated_at" : "2013-06-07T11:38:12Z",
+    "attributes" : [],
+    "shipping_class" : "",
+    "virtual" : false,
+    "downloadable" : false,
+    "upsell_ids" : [],
+    "created_at" : "2013-06-07T11:38:12Z",
+    "tax_class" : "",
+    "tags" : [],
+    "price_html" : "<del><span class=\"amount\">&#36;3</span></del> <ins><span class=\"amount\">&#36;2</span></ins>",
+    "in_stock" : true,
+    "sold_individually" : false,
+    "short_description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "downloads" : [],
+    "tax_status" : "taxable",
+    "average_rating" : "4.50",
+    "download_type" : "",
+    "shipping_taxable" : true,
+    "purchase_note" : "",
+    "shipping_class_id" : null,
+    "visible" : true,
+    "backorders_allowed" : false,
+    "images" : [
+      {
+        "position" : 0,
+        "id" : 100,
+        "created_at" : "2013-06-07T11:37:51Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/cd_6_angle.jpg",
+        "title" : "cd_6_angle",
+        "alt" : "",
+        "updated_at" : "2013-06-07T11:37:51Z"
+      },
+      {
+        "position" : 1,
+        "id" : 101,
+        "created_at" : "2013-06-07T11:38:03Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/cd_6_flat.jpg",
+        "title" : "cd_6_flat",
+        "alt" : "",
+        "updated_at" : "2013-06-07T11:38:03Z"
+      }
+    ],
+    "stock_quantity" : 0,
+    "featured" : false
+  }
+}
+
+

Variable products will return individual variations in the variations property:

+
{
+  "product" : {
+    "related_ids" : [
+      50,
+      60,
+      53,
+      19,
+      15
+    ],
+    "variations" : [
+      {
+        "attributes" : [
+          {
+            "option" : "black",
+            "name" : "Color"
+          }
+        ],
+        "weight" : null,
+        "sku" : "",
+        "backordered" : false,
+        "shipping_class" : "",
+        "image" : [
+          {
+            "position" : 0,
+            "id" : 43,
+            "created_at" : "2013-06-07T10:59:40Z",
+            "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_7_front.jpg",
+            "title" : "hoodie_7_front",
+            "alt" : "",
+            "updated_at" : "2013-06-07T10:59:40Z"
+          }
+        ],
+        "updated_at" : "2013-06-07T11:00:28Z",
+        "downloads" : [],
+        "downloadable" : false,
+        "regular_price" : "35.00",
+        "permalink" : "https://www.example.com/product/ship-your-idea-2/?attribute_pa_color=black",
+        "stock_quantity" : 0,
+        "shipping_class_id" : null,
+        "taxable" : false,
+        "tax_status" : "taxable",
+        "download_expiry" : 0,
+        "id" : 41,
+        "virtual" : false,
+        "on_sale" : false,
+        "download_limit" : 0,
+        "in_stock" : true,
+        "sale_price" : null,
+        "created_at" : "2013-06-07T11:00:28Z",
+        "price" : "35.00",
+        "visible" : true,
+        "dimensions" : {
+          "length" : "",
+          "height" : "",
+          "unit" : "in",
+          "width" : ""
+        },
+        "tax_class" : "",
+        "purchaseable" : true
+      },
+      {
+        "attributes" : [
+          {
+            "option" : "blue",
+            "name" : "Color"
+          }
+        ],
+        "weight" : null,
+        "sku" : "",
+        "backordered" : false,
+        "shipping_class" : "",
+        "image" : [
+          {
+            "position" : 0,
+            "id" : 46,
+            "created_at" : "2013-06-07T11:00:01Z",
+            "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_1_front.jpg",
+            "title" : "hoodie_1_front",
+            "alt" : "",
+            "updated_at" : "2013-06-07T11:00:01Z"
+          }
+        ],
+        "updated_at" : "2013-06-07T11:00:28Z",
+        "downloads" : [],
+        "downloadable" : false,
+        "regular_price" : "35.00",
+        "permalink" : "https://www.example.com/product/ship-your-idea-2/?attribute_pa_color=blue",
+        "stock_quantity" : 0,
+        "shipping_class_id" : null,
+        "taxable" : false,
+        "tax_status" : "taxable",
+        "download_expiry" : 0,
+        "id" : 42,
+        "virtual" : false,
+        "on_sale" : true,
+        "download_limit" : 0,
+        "in_stock" : true,
+        "sale_price" : "30.00",
+        "created_at" : "2013-06-07T11:00:28Z",
+        "price" : "30.00",
+        "visible" : true,
+        "dimensions" : {
+          "length" : "",
+          "height" : "",
+          "unit" : "in",
+          "width" : ""
+        },
+        "tax_class" : "",
+        "purchaseable" : true
+      }
+    ],
+    "categories" : [
+      "Clothing",
+      "Hoodies"
+    ],
+    "shipping_required" : true,
+    "id" : 40,
+    "parent" : [],
+    "regular_price" : "0.00",
+    "weight" : null,
+    "total_sales" : 1,
+    "sku" : "",
+    "rating_count" : 3,
+    "managing_stock" : false,
+    "title" : "Ship Your Idea",
+    "backordered" : false,
+    "on_sale" : true,
+    "status" : "publish",
+    "download_limit" : 0,
+    "taxable" : false,
+    "reviews_allowed" : true,
+    "description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "purchaseable" : true,
+    "sale_price" : null,
+    "type" : "variable",
+    "permalink" : "https://www.example.com/product/ship-your-idea-2/",
+    "catalog_visibility" : "visible",
+    "download_expiry" : 0,
+    "dimensions" : {
+      "length" : "",
+      "height" : "",
+      "unit" : "in",
+      "width" : ""
+    },
+    "cross_sell_ids" : [
+      22
+    ],
+    "price" : "30.00",
+    "updated_at" : "2013-06-07T11:00:28Z",
+    "attributes" : [
+      {
+        "position" : "0",
+        "visible" : false,
+        "variation" : true,
+        "options" : [
+          "Black",
+          "Blue"
+        ],
+        "name" : "Color"
+      }
+    ],
+    "shipping_class" : "",
+    "virtual" : false,
+    "downloadable" : false,
+    "upsell_ids" : [],
+    "created_at" : "2013-06-07T11:00:28Z",
+    "tax_class" : "",
+    "tags" : [],
+    "price_html" : "<span class=\"from\">From: </span><del><span class=\"amount\">&#36;35</span></del> <ins><span class=\"amount\">&#36;30</span></ins>",
+    "in_stock" : true,
+    "sold_individually" : false,
+    "short_description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "downloads" : [],
+    "tax_status" : "taxable",
+    "average_rating" : "4.00",
+    "download_type" : "",
+    "shipping_taxable" : true,
+    "purchase_note" : "",
+    "shipping_class_id" : null,
+    "visible" : true,
+    "backorders_allowed" : false,
+    "images" : [
+      {
+        "position" : 0,
+        "id" : 43,
+        "created_at" : "2013-06-07T10:59:40Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_7_front.jpg",
+        "title" : "hoodie_7_front",
+        "alt" : "",
+        "updated_at" : "2013-06-07T10:59:40Z"
+      },
+      {
+        "position" : 1,
+        "id" : 44,
+        "created_at" : "2013-06-07T10:59:54Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_7_back.jpg",
+        "title" : "hoodie_7_back",
+        "alt" : "",
+        "updated_at" : "2013-06-07T10:59:54Z"
+      },
+      {
+        "position" : 2,
+        "id" : 45,
+        "created_at" : "2013-06-07T11:00:00Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_1_back.jpg",
+        "title" : "hoodie_1_back",
+        "alt" : "",
+        "updated_at" : "2013-06-07T11:00:00Z"
+      },
+      {
+        "position" : 3,
+        "id" : 46,
+        "created_at" : "2013-06-07T11:00:01Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_1_front.jpg",
+        "title" : "hoodie_1_front",
+        "alt" : "",
+        "updated_at" : "2013-06-07T11:00:01Z"
+      }
+    ],
+    "stock_quantity" : 0,
+    "featured" : false
+  }
+}
+
+

Individual product variations will return a slightly different format than a regular product, with the parent variable product data in the parent attribute:

+
{
+  "product" : {
+    "related_ids" : [
+      60,
+      50,
+      53,
+      47,
+      19
+    ],
+    "variations" : [],
+    "categories" : [
+      "Clothing",
+      "Hoodies"
+    ],
+    "shipping_required" : true,
+    "id" : 41,
+    "parent" : {
+      "related_ids" : [
+        56,
+        19,
+        34,
+        60,
+        19
+      ],
+      "variations" : [],
+      "categories" : [
+        "Clothing",
+        "Hoodies"
+      ],
+      "shipping_required" : true,
+      "id" : 40,
+      "parent" : [],
+      "regular_price" : "0.00",
+      "weight" : null,
+      "total_sales" : 1,
+      "sku" : "",
+      "rating_count" : 3,
+      "managing_stock" : false,
+      "title" : "Ship Your Idea",
+      "backordered" : false,
+      "on_sale" : true,
+      "status" : "publish",
+      "download_limit" : 0,
+      "taxable" : false,
+      "reviews_allowed" : true,
+      "description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "purchaseable" : true,
+      "sale_price" : null,
+      "type" : "variable",
+      "permalink" : "https://www.example.com/product/ship-your-idea-2/",
+      "catalog_visibility" : "visible",
+      "download_expiry" : 0,
+      "dimensions" : {
+        "length" : "",
+        "height" : "",
+        "unit" : "in",
+        "width" : ""
+      },
+      "cross_sell_ids" : [
+        22
+      ],
+      "price" : "30.00",
+      "updated_at" : "2013-06-07T11:00:28Z",
+      "attributes" : [
+        {
+          "position" : "0",
+          "visible" : false,
+          "variation" : true,
+          "options" : [
+            "Black",
+            "Blue"
+          ],
+          "name" : "Color"
+        }
+      ],
+      "shipping_class" : "",
+      "virtual" : false,
+      "downloadable" : false,
+      "upsell_ids" : [],
+      "created_at" : "2013-06-07T11:00:28Z",
+      "tax_class" : "",
+      "tags" : [],
+      "price_html" : "<span class=\"from\">From: </span><del><span class=\"amount\">&#36;35</span></del> <ins><span class=\"amount\">&#36;30</span></ins>",
+      "in_stock" : true,
+      "sold_individually" : false,
+      "short_description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "downloads" : [],
+      "tax_status" : "taxable",
+      "average_rating" : "4.00",
+      "download_type" : "",
+      "shipping_taxable" : true,
+      "purchase_note" : "",
+      "shipping_class_id" : null,
+      "visible" : true,
+      "backorders_allowed" : false,
+      "images" : [
+        {
+          "position" : 0,
+          "id" : 43,
+          "created_at" : "2013-06-07T10:59:40Z",
+          "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_7_front.jpg",
+          "title" : "hoodie_7_front",
+          "alt" : "",
+          "updated_at" : "2013-06-07T10:59:40Z"
+        },
+        {
+          "position" : 1,
+          "id" : 44,
+          "created_at" : "2013-06-07T10:59:54Z",
+          "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_7_back.jpg",
+          "title" : "hoodie_7_back",
+          "alt" : "",
+          "updated_at" : "2013-06-07T10:59:54Z"
+        },
+        {
+          "position" : 2,
+          "id" : 45,
+          "created_at" : "2013-06-07T11:00:00Z",
+          "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_1_back.jpg",
+          "title" : "hoodie_1_back",
+          "alt" : "",
+          "updated_at" : "2013-06-07T11:00:00Z"
+        },
+        {
+          "position" : 3,
+          "id" : 46,
+          "created_at" : "2013-06-07T11:00:01Z",
+          "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_1_front.jpg",
+          "title" : "hoodie_1_front",
+          "alt" : "",
+          "updated_at" : "2013-06-07T11:00:01Z"
+        }
+      ],
+      "stock_quantity" : 0,
+      "featured" : false
+    },
+    "regular_price" : "35.00",
+    "weight" : null,
+    "total_sales" : 1,
+    "sku" : "",
+    "rating_count" : 3,
+    "managing_stock" : false,
+    "title" : "Ship Your Idea",
+    "backordered" : false,
+    "on_sale" : false,
+    "status" : "publish",
+    "download_limit" : 0,
+    "taxable" : false,
+    "reviews_allowed" : true,
+    "description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "purchaseable" : true,
+    "sale_price" : null,
+    "type" : "variation",
+    "permalink" : "https://www.example.com/product/ship-your-idea-2/?attribute_pa_color=black",
+    "catalog_visibility" : "visible",
+    "download_expiry" : 0,
+    "dimensions" : {
+      "length" : "",
+      "height" : "",
+      "unit" : "in",
+      "width" : ""
+    },
+    "cross_sell_ids" : [
+      22
+    ],
+    "price" : "35.00",
+    "updated_at" : "2013-06-07T11:00:28Z",
+    "attributes" : [
+      {
+        "option" : "black",
+        "name" : "Color"
+      }
+    ],
+    "shipping_class" : "",
+    "virtual" : false,
+    "downloadable" : false,
+    "upsell_ids" : [],
+    "created_at" : "2013-06-07T11:00:28Z",
+    "tax_class" : "",
+    "tags" : [],
+    "price_html" : "<span class=\"amount\">&#36;35</span>",
+    "in_stock" : true,
+    "sold_individually" : false,
+    "short_description" : "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "downloads" : [],
+    "tax_status" : "taxable",
+    "average_rating" : "4.00",
+    "download_type" : "",
+    "shipping_taxable" : true,
+    "purchase_note" : "",
+    "shipping_class_id" : null,
+    "visible" : true,
+    "backorders_allowed" : false,
+    "images" : [
+      {
+        "position" : 0,
+        "id" : 43,
+        "created_at" : "2013-06-07T10:59:40Z",
+        "src" : "https://www.example.com/wp-content/uploads/2013/06/hoodie_7_front.jpg",
+        "title" : "hoodie_7_front",
+        "alt" : "",
+        "updated_at" : "2013-06-07T10:59:40Z"
+      }
+    ],
+    "stock_quantity" : 0,
+    "featured" : false
+  }
+}
+

GET /products/#{id}/reviews

+

Retrieve a list of reviews for a product specified by it's ID:

+
{
+  "product_reviews" : [
+    {
+      "review" : "Ship it!",
+      "rating" : "3",
+      "id" : "13",
+      "created_at" : "2013-06-07T15:53:31Z",
+      "verified" : false,
+      "reviewer_name" : "Maria",
+      "reviewer_email" : "maria@example.com"
+    },
+    {
+      "review" : "This hoodie gets me lots of looks while out in public, I got the blue one and it's awesome. Not sure if people are looking at my hoodie only, or also at my rocking bod.",
+      "rating" : "5",
+      "id" : "12",
+      "created_at" : "2013-06-07T13:24:52Z",
+      "verified" : false,
+      "reviewer_name" : "Ryan",
+      "reviewer_email" : "ryan@example.com"
+    },
+    {
+      "review" : "Another great quality product that anyone who see's me wearing has asked where to purchase one of their own.",
+      "rating" : "4",
+      "id" : "11",
+      "created_at" : "2013-06-07T13:03:29Z",
+      "verified" : false,
+      "reviewer_name" : "Stuart",
+      "reviewer_email" : "stuart@example.com"
+    }
+  ]
+}
+

Reports

Report Properties

+

@TODO

+

GET /reports

+

Retrieve a simple list of available reports:

+
{
+  "reports" : [
+    "sales"
+  ]
+}
+

GET /reports/sales

+

Retrieve a sales report

+ +

You can specify either the period for which to retrieve sales or specify a start/end date. The supported periods are: week, month, last_month, and year. If you use an invalid period, week is used. If you don't specify a period, the current day is used.

+ +

GET /reports/sales?filter[period]=month will return sales for the current month

+ +

To return sales for a specific start/end date, set the date_min and date_max filter parameter:

+ +

GET /reports/sales?filter[date_min]=2013-12-01&filter[date_max]=2013-12-09 will return sales between December 1st and December 9th, inclusive.

+ +

If you don't specify an end date, the current date will be used.

+
{
+  "sales" : {
+    "total_shipping" : "0.00",
+    "total_orders" : 3,
+    "total_sales" : "87.00",
+    "totals_grouped_by" : "day",
+    "total_discount" : "0.00",
+    "totals" : {
+      "2013-12-02" : {
+        "orders" : 2,
+        "shipping" : "0.00",
+        "sales" : "67.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 4
+      },
+      "2013-12-08" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-01" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-07" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-06" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-05" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-04" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-10" : {
+        "orders" : 1,
+        "shipping" : "0.00",
+        "sales" : "20.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 1
+      },
+      "2013-12-03" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      },
+      "2013-12-09" : {
+        "orders" : 0,
+        "shipping" : "0.00",
+        "sales" : "0.00",
+        "tax" : "0.00",
+        "discount" : "0.00",
+        "items" : 0
+      }
+    },
+    "total_items" : 5,
+    "total_customers" : 1,
+    "average_sales" : "8.70",
+    "total_tax" : "0.00"
+  }
+}
+

Troubleshooting

+
    +
  • Nginx - Older configurations of Nginx can cause issues with the API, see this issue for details
  • +
+

Tools

+ +

Learn More

+ + +
+
+
+ cURL +
+
+
+ +
+ This documentation is for the WooCommerce API v1 which is now deprecated. Please use the latest REST API version. +
+ + + diff --git a/v2.html b/v2.html new file mode 100644 index 00000000..2d94166a --- /dev/null +++ b/v2.html @@ -0,0 +1,8881 @@ + + + + + + + + WooCommerce REST API Documentation v2 + + + + + + + + + + + + + + + + + + + NAV + + + +
+ +
+ cURL + Node.js + Python + PHP + Ruby +
+ + +
+
+
+
+

Introduction

+

Introduced in WooCommerce 2.1, the REST API allows store data to be created, read, updated, and deleted using the JSON format.

+

Requirements

+

You must be using WooCommerce 2.1 or newer and the REST API must be enabled under WooCommerce > Settings. You must enable pretty permalinks, as default permalinks will not work.

+ + +

Version

+

The current API version is v3 which takes a first-order position in endpoints.

+ +

Check the API versions present in every version of WooCommerce:

+ + + + + + + + + + + + + + + + + + + +
API VersionWooCommerce
v12.1.x, 2.2.x, 2.3.x and 2.4.x
v22.2.x, 2.3.x and 2.4.x
v32.4.x
+ +

The v1 and v2 will be removed in future versions.

+

Differences between v1 and v2 versions

+
    +
  • v1 supports XML response format, v2 only supports JSON.
  • +
  • v1 does not support creating or updating (with the exception of order status) any resources, v2 supports full create/read/update/delete for all endpoints.
  • +
  • v1 does not include order item meta, v2 includes full order item meta (with an optional filter parameter to include protected order item meta)
  • +
  • v1 does not include any endpoints for listing a customer's available downloads, v2 includes the GET /customer/{id}/downloads endpoint.
  • +
  • v1 includes an endpoint for listing notes for an order, v2 includes full create/read/update/delete endpoints.
  • +
  • v1 does not include any endpoints for listing product categories, v2 includes two endpoints for product categories (GET /products/categories and GET /products/categories/{id}).
  • +
  • v1 does not include any endpoints for getting valid order statuses, v2 includes an endpoint for listing valid order statuses (GET /orders/statuses).
  • +
  • v2 supports the core features added in WooCommerce 2.2, primarily order refunds (via the /orders/refunds endpoint) and Webhooks (via the /webhooks).
  • +
+

Differences between v3 and old versions

+
    +
  • v3 implement full basic authentication (conforms to the Basic auth spec)).
  • +
  • v3 fixes the OAuth implementation to be compliant with the Oauth 1.0a specs.
  • +
  • v3 include a new endpoint to get all product orders.
  • +
  • v3 have new endpoints to allow bulk actions as edition and creation of products, orders, customers and coupons.
  • +
  • v3 introduce new product attribute endpoints (GET, POST, PUT and DELETE).
  • +
  • v3 deprecated the product/sku/<id> endpoint (because a SKU can be generated with any character, besides that there is a filter callend filter[sku]).
  • +
  • v3 include category thumbnails on the requests for product/categories.
  • +
  • v3 uses our option to auto generate passwords for new customers.
  • +
+

API Docs for each version

+ +

Schema

+

The API is accessible via this endpoint:

+ +

https://www.your-store.com/wc-api/v2

+ +

You may access the API over either HTTP or HTTPS. HTTPS is recommended where possible, as authentication is simpler. The API index will declare if the site supports SSL or not.

+

Requests/Responses

+

The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

+ +

Some general information about responses:

+ +
    +
  • Dates are returned in RFC3339 format in UTC timezone: YYYY-MM-DDTHH:MM:SSZ

  • +
  • Resource IDs are returned as integers.

  • +
  • Any decimal monetary amount, such as prices or totals, are returned as strings with two decimal places. The decimal separator (typically either . or ,) is controlled by the site and is included in the API index. This is by design, in order to make localization of API data easier for the client. You may need to account for this in your implemetation if you will be doing calculations with the returned data (e.g. convert string amounts with commas as the decimal place before performing any calculations)

  • +
  • Other amounts, such as item counts, are returned as integers.

  • +
  • Blank fields are generally included as null instead of being blank strings or omitted.

  • +
+

Authentication

+

There are two aways to authenticate with the API, depending on whether the site supports SSL or not. Remember that the Index endpoint will indicate if the site supports SSL or not.

+

Over HTTPS

+

You may use HTTP Basic Auth by providing the API Consumer Key as the username and the API Consumer Secret as the password.

+ +
+

HTTP Basic Auth example

+
+
curl https://www.example.com/wc-api/v2/orders \
+    -u consumer_key:consumer_secret
+
+

Occasionally some servers may not properly parse the Authorization header (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters.

+ +
+

Example for servers that not properly parse the Authorization header:

+
+
curl https://www.example.com/wc-api/v2/orders?consumer_key=123&consumer_secret=abc
+

Over HTTP

+

You must use OAuth 1.0a "one-legged" authentication to ensure API credentials cannot be intercepted. Typically you may use any standard OAuth 1.0a library in your language of choice to handle the authentication, or generate the necessary parameters by following these instructions.

+

Generating an OAuth signature

+

1) Set the HTTP method for the request:

+ +

GET

+ +

2) Set your base request URI -- this is the full request URI without query string parameters -- and URL encode according to RFC 3986:

+ +

http://www.example.com/wc-api/v1/orders

+ +

when encoded:

+ +

http%3A%2F%2Fwww.example.com%2Fwc-api%2Fv1%2Forders

+ +

3) Collect and normalize your query string parameters. This includes all oauth_* parameters except for the signature. Parameters should be normalized by URL encoding according to RFC 3986 (rawurlencode in PHP) and percent(%) characters should be double-encoded (e.g. % becomes %25.

+ +

4) Sort the parameters in byte-order (uksort( $params, 'strcmp' ) in PHP)

+ +

5) Join each parameter with an encoded equals sign (%3D):

+ +

oauth_signature_method%3DHMAC-SHA1

+ +

6) Join each parameter key/value with an encoded ampersand (%26):

+ +

oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1

+ +

7) Form the string to sign by joining the HTTP method, encoded base request URI, and encoded parameter string with an unencoded ampersand symbol (&):

+ +

GET&http%3A%2F%2Fwww.example.com%2Fwc-api%2Fv1%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1

+ +

8) Generate the signature using the string to key and your consumer secret key

+ +

If you are having trouble generating a correct signature, you'll want to review your string to sign for errors with encoding. The authentication source can also be helpful in understanding how to properly generate the signature.

+

OAuth Tips

+
    +
  • The OAuth parameters may be added as query string parameters or included in the Authorization header.
  • +
  • Note there is no reliable cross-platform way to get the raw request headers in WordPress, so query string should be more reliable in some cases.
  • +
  • The required parameters are: oauth_consumer_key, oauth_timestamp, oauth_nonce, oauth_signature, and oauth_signature_method. oauth_version is not required and should be omitted.
  • +
  • The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key.
  • +
  • The OAuth timestamp should be the unix timestamp at the time of the request. The REST API will deny any requests that include a timestamp outside of a 15 minute window to prevent replay attacks.
  • +
  • You must use the store URL provided by the index when forming the base string used for the signature, as this is what the server will use. (e.g. if the store URL includes a www sub-domain, you should use it for requests)
  • +
  • Note that the request body is not signed as per the OAuth spec.
  • +
  • If including parameters in your request, it saves a lot of trouble if you can order your items alphabetically.
  • +
  • Authorization header is supported starting WooCommerce 3.0.
  • +
+

Parameters

+

All endpoints accept optional parameters which can be passed as an HTTP query string parameter, e.g. GET /orders?status=completed. There are common parameters and endpoint-specific parameters which are documented along with that endpoint.

+

Filter Parameter

+

All endpoints accept a filter parameter that scopes individual filters using brackets, like date filtering:

+ +

GET /orders?filter[created_at_min]=2013-11-01

+ +

Multiple filter parameters can be included and intermixed with other parameters:

+ +

GET /orders?status=completed&filter[created_at_min]=2013-11-01&filter[created_at_max]=2013-11-30

+ +

Note that the following filters are supported for all endpoints except the reports endpoint, which has it's own set of filters that are documented along with that endpoint.

+

Available Filters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilterDescription
created_at_mingiven a date, only resources created after the provided date will be returned
created_at_maxgiven a date, only resources created before the provided date will be returned
updated_at_mingiven a date, only resources updated after the provided date will be returned
updated_at_maxgiven a date, only resources updated before the provided date will be returned
qperforms a keyword search and returns resources that match, e.g. GET /products?filter[q]=search-keyword. Note that search terms should be URL-encoded as they will be decoded internally with urldecode
ordercontrols the ordering of the resources returned, accepted values are ASC (default) or DESC
orderbycontrols the field that is used for ordering the resources returned. Accepts the same arguments as WP_Query. Defaults to date. You can order by meta_value but you must provide orderby_meta_key
orderby_meta_keythe meta key to order returned resources by when using orderby=meta_value. For example, you could order products by price using GET /products?filter[orderby]=meta_value_num&filter[orderby_meta_key]=_price
post_statuslimits resources to only those with the specified post status. Most useful for returning unpublished products, e.g. GET /products?filter[post_status]=draft
metaresource meta is excluded by default, but it can be included by setting meta=true, e.g. GET /orders?filter[meta]=true. Protected meta (meta whose key is prefixed with an underscore) is not included in the response
paginationexplained below
+ +

Note that Dates should be provided in RFC3339 format in UTC timezone: YYYY-MM-DDTHH:MM:SSZ. You may omit the time and timezone if desired.

+

Fields Parameter

+

You may limit the fields returned in the response using the fields parameter:

+ +

GET /orders?fields=id

+ +

To include multiple fields, separate them with commas:

+ +

GET /orders?fields=id,status

+ +

You can specify sub-fields using dot-notation:

+ +

GET /orders?fields=id,status,payment_details.method_title

+ +

Sub-fields can't be limited for resources that have multiple structs, like an order's line items. For example, this will return just the line items, but each line item will have the full set of information, not just the product ID:

+ +

GET /orders?fields=line_items.product_id

+

Pagination

+

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specifed with the ?filter[limit] parameter:

+ +

GET /orders?filter[limit]=15

+ +

You can specify further pages with the ?page parameter:

+ +

GET /orders?page=2

+ +

You may also specify the offset from the first resource using the ?filter[offset] parameter:

+ +

GET /orders?filter[offset]=5

+ +

Page number is 1-based and ommiting the ?page parameter will return the first page.

+ +

The total number of resources and pages are always included in the X-WC-Total and X-WC-TotalPages HTTP headers.

+ +

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

+
Link: <https://www.example.com/wc-api/v1/products?page=2>; rel="next",
+<https://www.example.com/wc-api/v1/products?page=3>; rel="last"`
+
+

Linebreak included for readability

+ +

The possible rel values are:

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
nextShows the URL of the immediate next page of results
lastShows the URL of the last page of results
firstShows the URL of the first page of results
prevShows the URL of the immediate previous page of results
+

Errors

+

Occasionally you might encounter errors when accessing the API. There are four possible types:

+ +
    +
  • Invalid requests, such as using an unsupported HTTP method will result in 400 Bad Request.
  • +
  • Authentication or permission errors, such as incorrect API keys will result in 401 Unauthorized.
  • +
  • Requests to resources that don't exist or are missing required parameters will result in 404 Not Found.
  • +
  • Requests that cannot be processed due to a server error will result in 500 Internal Server Error.
  • +
+ +
+

400 Bad Request example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_unsupported_method",
+      "message" : "Unsupported request method"
+    }
+  ]
+}
+
+
+

401 Unauthorized example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_authentication_error",
+      "message" : "Consumer Key is invalid"
+    }
+  ]
+}
+
+
+

404 Not Found example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_invalid_order",
+      "message" : "Invalid order"
+    }
+  ]
+}
+
+
+

500 Internal Server Error example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_invalid_handler",
+      "message" : "The handler for the route is invalid"
+    }
+  ]
+}
+
+

Errors return both an appropriate HTTP status code and response object which contains a code and message attribute. If an endpoint has any custom errors, they are documented with that endpoint.

+

HTTP Verbs

+

The API uses the appropriate HTTP verb for each action:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
VerbeDescription
HEADCan be used for any endpoint to return just the HTTP header information
GETUsed for retrieving resources
PUTUsed for updating resources
POSTUsed for creating resources
DELETEUsed for deleting resources
+

JSONP Support

+

The API supports JSONP by default. JSONP responses uses the application/javascript content-type. You can specify the callback using the ?_jsonp parameter for GET requests to have the response wrapped in a JSON function:

+ +
+
+ GET +
/wc-api/v2/orders/count?_jsonp=ordersCount
+
+
+
curl https://example.com/wc-api/v2/orders/count?_jsonp=ordersCount \
+    -u consumer_key:consumer_secret
+
+
+

Response:

+
+
\**\ordersCount({"count":8})
+
+
+

If the site administrator has chosen to disable it, you will receive a 400 Bad Request error:

+
+
{
+  "errors": [
+    {
+      "code": "woocommerce_api_jsonp_disabled",
+      "message": "JSONP support is disabled on this site"
+    }
+  ]
+}
+
+
+

If your callback contains invalid characters, you will receive a 400 Bad Request error:

+
+
{
+  "errors": [
+    {
+      "code": "woocommerce_api_jsonp_callback_invalid",
+      "message": "The JSONP callback function is invalid"
+    }
+  ]
+}
+

Webhooks

+

Webhooks are an experimental feature in the v2 REST API. They must be managed using the REST API endpoints as a UI is not yet available. The WC_Webhook class manages all data storage/retrieval from the custom post type, as well as enqueuing a webhook's actions and processing/delivering/logging the webhook. On woocommerce_init, active webhooks are loaded and their associated hooks are added.

+ +

Each webhook has:

+ +
    +
  • status: active (delivers payload), paused (delivery paused by admin), disabled (delivery paused by failure)
  • +
  • topic: determines which resource events the webhook is triggered for
  • +
  • delivery URL: URL where the payload is delivered, must be HTTP or HTTPS
  • +
  • secret: an optional secret key that is used to generate a HMAC-SHA256 hash of the request body so the receiver can verify authenticity of the webhook
  • +
  • hooks: an array of hook names that are added and bound to the webhook for processing
  • +
+

Topics

+

The topic is a combination resource (e.g. order) and event (e.g. created) and maps to one or more hook names (e.g. woocommerce_checkout_order_processed). Webhooks can be created using the topic name and the appropriate hooks are automatically added.

+ +

Core topics are:

+ +
    +
  • coupon.created, coupon.updated, coupon.deleted
  • +
  • customer.created, customer.updated, customer.deleted
  • +
  • order.created, order.updated, order.deleted
  • +
  • product.created, product.updated, product.deleted
  • +
+ +

Custom topics can also be used which map to a single hook name, so for example you could add a webhook with topic action.woocommerce_add_to_cart that is triggered on that event. Custom topics pass the first hook argument to the payload, so in this example the cart_item_key would be included in the payload.

+

Delivery/Payload

+

Delivery is done using wp_remote_post() (HTTP POST) and processed in the background by default using wp-cron. A few custom headers are added to the request to help the receiver process the webhook:

+ +
    +
  • X-WC-Webhook-Topic - e.g. order.updated
  • +
  • X-WC-Webhook-Resource - e.g. order
  • +
  • X-WC-Webhook-Event - e.g. updated
  • +
  • X-WC-Webhook-Signature - a base64 encoded HMAC-SHA256 hash of the payload
  • +
  • X-WC-Webhook-ID - webhook's post ID
  • +
  • X-WC-Delivery-ID - delivery log ID (a comment)
  • +
+ +

The payload is JSON encoded and for API resources (coupons,customers,orders,products), the response is exactly the same as if requested via the REST API.

+

Logging

+

Requests/responses are logged as comments on the webhook custom post type. Each delivery log includes:

+ +
    +
  • Request duration
  • +
  • Request URL, method, headers, and body
  • +
  • Response Code, message, headers, and body
  • +
+ +

Only the 25 most recent delivery logs are kept in order to reduce comment table bloat.

+ +

After 5 consecutive failed deliveries (as defined by a non HTTP 2xx response code), the webhook is disabled and must be edited via the REST API to re-enable.

+ +

Delivery logs can be fetched through the REST API endpoint or in code using WC_Webhook::get_delivery_logs()

+

Endpoints

+

See the webhook resource section.

+

Troubleshooting

+
    +
  • Nginx - Older configurations of Nginx can cause issues with the API, see this issue for details
  • +
+

Official Libraries

+ +
// Install:
+// npm install --save woocommerce-api
+
+// Setup:
+var WooCommerceAPI = require('woocommerce-api');
+
+var WooCommerce = new WooCommerceAPI({
+  url: 'http://example.com', // Your store URL
+  consumerKey: 'consumer_key', // Your consumer key
+  consumerSecret: 'consumer_secret', // Your consumer secret
+  version: 'v2' // WooCommerce API version
+});
+
# Install:
+# pip install woocommerce
+
+# Setup:
+from woocommerce import API
+
+wcapi = API(
+    url="http://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    version="v2"
+)
+
<?php
+// Install:
+// composer require "woothemes/woocommerce-api:2.*"
+
+// Setup:
+include_once('vendor/autoload.php');
+
+$woocommerce = new WC_API_Client(
+    'http://example.com/',
+    'consumer_key',
+    'consumer_secret'
+);
+?>
+
# Install:
+# gem install woocommerce_api
+
+# Setup:
+require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "http://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    version: "v2"
+  }
+)
+
+ +

Tools

+ +

Index

+

The API index provides information about the endpoints available for the site, as well as store-specific information. No authentication is required to access the API index, however if the REST API is disabled, you will receive a 404 Not Found error.

+ +
+

404 Not Found response:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_disabled",
+      "message" : "The WooCommerce API is disabled on this site"
+    }
+  ]
+}
+

Index Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringThe name of the site - get_option( 'blogname' )
descriptionstringThe site's description - get_option( 'blogdescription' )
URLstringThe site's URL - get_option( 'siteurl' )
wc_versionstringThe active WooCommerce version
routesarrayA list of available endpoints for the site keyed by relative URL. Each endpoint specifies the HTTP methods supported as well as the canonical URL
metaarrayA list of WooCommerce settings used in the API. See Meta Properties
+

Meta Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
currencystringCurrency ISO Code, e.g. GBP
currency_formatstringCurrency symbol, HTML encoded, e.g. £
currency_positionstringCurrency position, available the following options: right, left, right_space and left_space
decimal_separatorstringDecimal separator, e.g ,
dimension_unitstringThe unit set for product dimensions. Valid units are cm, m, cm, mm, in, and yd
generate_passwordbooleanShows if the API is able to auto generate passwords for new customers
linksarrayAPI help links list
permalinks_enabledbooleanWhether pretty permalinks are enabled on the site, if this is false, the API will not function correctly
price_num_decimalsintegerNumber of decimals
ssl_enabledbooleanTrue if SSL is enabled for the site, false otherwise
tax_includedbooleanTrue if prices include tax, false otherwise
thousand_separatorstringThousands separator, e.g .
timezonestringThe site's timezone
weight_unitstringThe unit set for product weights. Valid units are kg, g, lbs, oz
+

View Index List

+

Retrieve a set of store information.

+

HTTP Request

+
+
+ GET +
/wc-api/v2
+
+
+
curl https://example.com/wc-api/v2 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("").json())
+
<?php print_r($woocommerce->index->get()); ?>
+
woocommerce.get("").parsed_response
+
+
+

JSON response example:

+
+
{
+    "store": {
+        "URL": "http://example.com",
+        "description": "",
+        "meta": {
+            "currency": "USD",
+            "currency_format": "&#36;",
+            "currency_position": "left_space",
+            "decimal_separator": ",",
+            "dimension_unit": "in",
+            "generate_password": false,
+            "links": {
+                "help": "http://woocommerce.github.io/woocommerce-rest-api-docs/"
+            },
+            "permalinks_enabled": true,
+            "price_num_decimals": 2,
+            "ssl_enabled": true,
+            "tax_included": false,
+            "thousand_separator": ".",
+            "timezone": "America/Sao_Paulo",
+            "weight_unit": "lbs"
+        },
+        "name": "WooCommerce Dev",
+        "routes": {
+            "/": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/coupons": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/coupons"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/coupons/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/coupons/bulk": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/coupons/bulk"
+                },
+                "supports": [
+                    "POST",
+                    "PUT",
+                    "PATCH"
+                ]
+            },
+            "/coupons/code/<code>": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/coupons/count": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/coupons/count"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/customers": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/customers"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/customers/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/customers/<id>/downloads": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/customers/<id>/orders": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/customers/bulk": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/customers/bulk"
+                },
+                "supports": [
+                    "POST",
+                    "PUT",
+                    "PATCH"
+                ]
+            },
+            "/customers/count": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/customers/count"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/customers/email/<email>": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/orders": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/orders"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/orders/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/orders/<order_id>/notes": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/orders/<order_id>/notes/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/orders/<order_id>/refunds": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/orders/<order_id>/refunds/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/orders/bulk": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/orders/bulk"
+                },
+                "supports": [
+                    "POST",
+                    "PUT",
+                    "PATCH"
+                ]
+            },
+            "/orders/count": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/orders/count"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/orders/statuses": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/orders/statuses"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/products": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/products"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/products/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/products/<id>/orders": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/products/<id>/reviews": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/products/attributes": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/products/attributes"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/products/attributes/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/products/bulk": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/products/bulk"
+                },
+                "supports": [
+                    "POST",
+                    "PUT",
+                    "PATCH"
+                ]
+            },
+            "/products/categories": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/products/categories"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/products/categories/<id>": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/products/count": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/products/count"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/products/sku/<sku>": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/reports": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/reports"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/reports/sales": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/reports/sales"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/reports/sales/top_sellers": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/reports/sales/top_sellers"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/webhooks": {
+                "accepts_data": true,
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/webhooks"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST"
+                ]
+            },
+            "/webhooks/<id>": {
+                "accepts_data": true,
+                "supports": [
+                    "HEAD",
+                    "GET",
+                    "POST",
+                    "PUT",
+                    "PATCH",
+                    "DELETE"
+                ]
+            },
+            "/webhooks/<webhook_id>/deliveries": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/webhooks/<webhook_id>/deliveries/<id>": {
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            },
+            "/webhooks/count": {
+                "meta": {
+                    "self": "http://example.com/wc-api/v2/webhooks/count"
+                },
+                "supports": [
+                    "HEAD",
+                    "GET"
+                ]
+            }
+        },
+        "wc_version": "2.3.13"
+    }
+}
+

Coupons

+

This section lists all API that can be used to create, edit or otherwise manipulate coupons.

+

Coupon Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCoupon ID (post ID) read-only
codestringCoupon code, always lowercase mandatory
typestringCoupon type, valid core types are: fixed_cart, percent, fixed_product and percent_product. Default is fixed_cart
created_atstringUTC DateTime when the coupon was created read-only
updated_atstringUTC DateTime when the coupon was last updated read-only
amountstringThe amount of discount
individual_usebooleanWhether coupon can only be used individually
product_idsarrayArray of product ID's the coupon can be used on
exclude_product_idsarrayArray of product ID's the coupon cannot be used on
usage_limitintegerHow many times the coupon can be used
usage_limit_per_userintegerHow many times the coupon can be user per customer
limit_usage_to_x_itemsintegerMax number of items in the cart the coupon can be applied to
usage_countintegerNumber of times the coupon has been used already read-only
expiry_datestringUTC DateTime`when the coupon expires
enable_free_shippingbooleanIs the coupon for free shipping
product_category_idsarrayArray of category ID's the coupon applies to
exclude_product_category_idsarrayArray of category ID's the coupon does not apply to
exclude_sale_itemsbooleanExclude sale items from the coupon
minimum_amountstringMinimum order amount that needs to be in the cart before coupon applies
maximum_amountstringMaximum order amount allowed when using the coupon
customer_emailsarrayArray of email addresses that can use this coupon
descriptionstringCoupon description
+

Create A Coupon

+

This API helps you to create a new coupon.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/coupons
+
+
+
curl -X POST https://example.com/wc-api/v2/coupons \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "coupon": {
+    "code": "new-coupon",
+    "type": "percent",
+    "amount": "10",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": "",
+    "usage_limit_per_user": "",
+    "limit_usage_to_x_items": "",
+    "expiry_date": "",
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}'
+
var data = {
+  coupon: {
+    code: 'new-coupon',
+    type: 'percent',
+    amount: '10',
+    individual_use: true,
+    product_ids: [],
+    exclude_product_ids: [],
+    usage_limit: '',
+    usage_limit_per_user: '',
+    limit_usage_to_x_items: '',
+    expiry_date: '',
+    enable_free_shipping: false,
+    product_category_ids: [],
+    exclude_product_category_ids: [],
+    exclude_sale_items: true,
+    minimum_amount: '100.00',
+    maximum_amount: '0.00',
+    customer_emails: [],
+    description: ''
+  }
+};
+
+WooCommerce.post('coupons', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "coupon": {
+        "code": "new-coupon",
+        "type": "percent",
+        "amount": "10",
+        "individual_use": True,
+        "product_ids": [],
+        "exclude_product_ids": [],
+        "usage_limit": "",
+        "usage_limit_per_user": "",
+        "limit_usage_to_x_items": "",
+        "expiry_date": "",
+        "enable_free_shipping": False,
+        "product_category_ids": [],
+        "exclude_product_category_ids": [],
+        "exclude_sale_items": True,
+        "minimum_amount": "100.00",
+        "maximum_amount": "0.00",
+        "customer_emails": [],
+        "description": ""
+    }
+}
+
+print(wcapi.post("coupons", data).json())
+
<?php
+$data = array(
+    'coupon' => array(
+        'code' => 'new-coupon',
+        'type' => 'percent',
+        'amount' => '10',
+        'individual_use' => true,
+        'product_ids' => array(),
+        'exclude_product_ids' => array(),
+        'usage_limit' => '',
+        'usage_limit_per_user' => '',
+        'limit_usage_to_x_items' => '',
+        'expiry_date' => '',
+        'enable_free_shipping' => false,
+        'product_category_ids' => array(),
+        'exclude_product_category_ids' => array(),
+        'exclude_sale_items' => true,
+        'minimum_amount' => '100.00',
+        'maximum_amount' => '0.00',
+        'customer_emails' => array(),
+        'description' => ''
+    )
+);
+
+print_r($woocommerce->coupons->create($data));
+?>
+
data = {
+  coupon: {
+    code: "new-coupon",
+    type: "percent",
+    amount: "10",
+    individual_use: true,
+    product_ids: [],
+    exclude_product_ids: [],
+    usage_limit: "",
+    usage_limit_per_user: "",
+    limit_usage_to_x_items: "",
+    expiry_date: "",
+    enable_free_shipping: false,
+    product_category_ids: [],
+    exclude_product_category_ids: [],
+    exclude_sale_items: true,
+    minimum_amount: "100.00",
+    maximum_amount: "0.00",
+    customer_emails: [],
+    description: ""
+  }
+}
+
+woocommerce.post("coupons", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupon": {
+    "id": 529,
+    "code": "new-coupon",
+    "type": "percent",
+    "created_at": "2015-01-20T19:05:27Z",
+    "updated_at": "2015-01-20T19:05:27Z",
+    "amount": "10.00",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "usage_count": 0,
+    "expiry_date": null,
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}
+

View A Coupon

+

This API lets you retrieve and view a specific coupon by ID or code.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/coupons/<id>
+
+
+ +
+
+ GET +
/wc-api/v2/coupons/code/<code>
+
+
+
curl https://example.com/wc-api/v2/coupons/529 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('coupons/529', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("coupons/529").json())
+
<?php print_r($woocommerce->coupons->get(529)); ?>
+
woocommerce.get("coupons/529").parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupon": {
+    "id": 529,
+    "code": "new-coupon",
+    "type": "percent",
+    "created_at": "2015-01-20T19:05:27Z",
+    "updated_at": "2015-01-20T19:05:27Z",
+    "amount": "10.00",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "usage_count": 0,
+    "expiry_date": null,
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}
+

View List Of Coupons

+

This API helps you to view all the coupons.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/coupons
+
+
+
curl https://example.com/wc-api/v2/coupons \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('coupons', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("coupons").json())
+
<?php print_r($woocommerce->coupons->get()); ?>
+
woocommerce.get("coupons").parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupons": [
+    {
+      "id": 529,
+      "code": "new-coupon",
+      "type": "percent",
+      "created_at": "2015-01-20T19:05:27Z",
+      "updated_at": "2015-01-20T19:05:27Z",
+      "amount": "10.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": null,
+      "enable_free_shipping": false,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": ""
+    },
+    {
+      "id": 527,
+      "code": "free-shipping",
+      "type": "fixed_cart",
+      "created_at": "2015-01-20T18:35:59Z",
+      "updated_at": "2015-01-20T18:35:59Z",
+      "amount": "0.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": null,
+      "enable_free_shipping": true,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "50.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": ""
+    },
+    {
+      "id": 526,
+      "code": "christmas-promo",
+      "type": "percent",
+      "created_at": "2015-01-20T18:10:58Z",
+      "updated_at": "2015-01-20T18:10:58Z",
+      "amount": "10.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": 1,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": "2014-12-25T00:00:00Z",
+      "enable_free_shipping": false,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "200.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": "Discount for Christmas for orders over $ 200"
+    }
+  ]
+}
+

Update A Coupon

+

This API lets you make changes to a coupon.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/coupons/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/coupons/529 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "coupon": {
+    "amount": "5"
+  }
+}'
+
var data = {
+  coupon: {
+    amount: '5'
+  }
+};
+
+WooCommerce.put('coupons/529', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "coupon": {
+        "amount": "5"
+    }
+}
+
+print(wcapi.put("coupons/529", data).json())
+
<?php
+$data = array(
+    'coupon' => array(
+        'amount' => '5'
+    )
+);
+
+print_r($woocommerce->coupons->update(529, $data));
+?>
+
data {
+  coupon: {
+    amount: "5"
+  }
+}
+
+woocommerce.put("coupons/529", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupon": {
+    "id": 529,
+    "code": "new-coupon",
+    "type": "percent",
+    "created_at": "2015-01-20T19:05:27Z",
+    "updated_at": "2015-01-20T19:10:33Z",
+    "amount": "5.00",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "usage_count": 0,
+    "expiry_date": null,
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}
+

Delete A Coupon

+

This API helps you delete a coupon.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/coupons/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/coupons/529/?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('coupons/529/?force=true', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("coupons/529", params={"force": True}).json())
+
<?php print_r($woocommerce->coupons->delete(529, true)); ?>
+
woocommerce.delete("coupons/529, force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted coupon"
+}
+

Parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the coupon, defaults to false. Note that permanently deleting the coupon will return HTTP 200 rather than HTTP 202.
+

View Coupons Count

+

This API lets you retrieve a count of all coupons.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/coupons/count
+
+
+
curl https://example.com/wc-api/v2/coupons/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('coupons/count', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("coupons/count").json())
+
<?php print_r($woocommerce->coupons->get_count()); ?>
+
woocommerce.get("coupons/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 3
+}
+

Customers

+

This section lists all API that can be used to create, edit or otherwise manipulate customers.

+

Customers Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCustomer ID (user ID) read-only
created_atstringUTC DateTime when the customer was created read-only
emailstringCustomer email address mandatory
first_namestringCustomer first name
last_namestringCustomer last name
usernamestringCustomer username, can be generated automatically from the customer's email addrees if the option woocommerce_registration_generate_username is equal to yes cannot be changed
passwordstringCustomer password, can be generated automatically with wp_generate_password() if the "Automatically generate customer password" option is enabled, check the index meta for generate_password write-only
last_order_idintegerLast order ID read-only
last_order_datestringUTC DateTime of the customer last order read-only
orders_countintegerQuantity of orders that the customer have read-only
total_spentintegerTotal amount spent read-only
avatar_urlstringGravatar URL
billing_addressarrayList of Billing Address fields. See Billing Address Properties
shipping_addressarrayList of Shipping Address fields. See Shipping Address Properties
+

Billing Address Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name
last_namestringLast name
companystringCompany name
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name
statestringISO code or name of the state, province or district
postcodestringPostal code
countrystringISO code of the country
emailstringEmail address
phonestringPhone
+

Shipping Address Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name
last_namestringLast name
companystringCompany name
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name
statestringISO code or name of the state, province or district
postcodestringPostal code
countrystringISO code of the country
+

Create A Customer

+

This API helps you to create a new customer.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/customers
+
+
+
curl -X POST https://example.com/wc-api/v2/customers \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "customer": {
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}'
+
var data = {
+  customer: {
+    email: 'john.doe@example.com',
+    first_name: 'John',
+    last_name: 'Doe',
+    username: 'john.doe',
+    billing_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      company: '',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US',
+      email: 'john.doe@example.com',
+      phone: '(555) 555-5555'
+    },
+    shipping_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      company: '',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US'
+    }
+  }
+};
+
+WooCommerce.post('customers', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "customer": {
+        "email": "john.doe@example.com",
+        "first_name": "John",
+        "last_name": "Doe",
+        "username": "john.doe",
+        "billing_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "company": "",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US",
+            "email": "john.doe@example.com",
+            "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "company": "",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US"
+        }
+    }
+}
+
+print(wcapi.post("customers", data).json())
+
<?php
+$data = array(
+    'customer' => array(
+        'email' => 'john.doe@example.com',
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'username' => 'john.doe',
+        'billing_address' => array(
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'company' => '',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US',
+            'email' => 'john.doe@example.com',
+            'phone' => '(555) 555-5555'
+        ),
+        'shipping_address' => array(
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'company' => '',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US'
+        )
+    )
+);
+
+print_r($woocommerce->customers->create($data));
+?>
+
data = {
+  customer: {
+    email: "john.doe@example.com",
+    first_name: "John",
+    last_name: "Doe",
+    username: "john.doe",
+    billing_address: {
+      first_name: "John",
+      last_name: "Doe",
+      company: "",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US",
+      email: "john.doe@example.com",
+      phone: "(555) 555-5555"
+    },
+    shipping_address: {
+      first_name: "John",
+      last_name: "Doe",
+      company: "",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US"
+    }
+  }
+}
+
+woocommerce.post("customers", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "customer": {
+    "id": 2,
+    "created_at": "2015-01-05T18:34:19Z",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order_id": null,
+    "last_order_date": null,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}
+

View A Customer

+

This API lets you retrieve and view a specific customer by ID or email.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/customers/<id>
+
+
+ +
+
+ GET +
/wc-api/v2/customers/email/<email>
+
+
+
curl https://example.com/wc-api/v2/customers/2 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/2', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("customers/2").json())
+
<?php print_r($woocommerce->customers->get(2)); ?>
+
woocommerce.get("customers/2").parsed_response
+
+
+

JSON response example:

+
+
{
+  "customer": {
+    "id": 2,
+    "created_at": "2015-01-05T18:34:19Z",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order_id": null,
+    "last_order_date": null,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}
+

View List Of Customers

+

This API helps you to view all the customers.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/customers
+
+
+
curl https://example.com/wc-api/v2/customers \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("customers").json())
+
<?php print_r($woocommerce->customers->get()); ?>
+
woocommerce.get("customers").parsed_response
+
+
+

JSON response example:

+
+
{
+  "customers": [
+    {
+      "id": 2,
+      "created_at": "2015-01-05T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe",
+      "last_order_id": 123,
+      "last_order_date": "2015-01-14T16:47:30Z",
+      "orders_count": 10,
+      "total_spent": "1034.58",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "id": 3,
+      "created_at": "2015-01-10T14:25:39Z",
+      "email": "joao.silva@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva",
+      "last_order_id": 120,
+      "last_order_date": "2015-01-10T14:26:30Z",
+      "orders_count": 1,
+      "total_spent": "429.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
rolestringCustomers by status. eg: customer or subscriber
+

Update A Customer

+

This API lets you make changes to a customer.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/customers/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/customers/2 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "customer": {
+    "first_name": "James",
+    "billing_address": {
+      "first_name": "James"
+    },
+    "shipping_address": {
+      "first_name": "James"
+    }
+  }
+}'
+
var data = {
+  customer: {
+    first_name: 'James',
+    billing_address: {
+      first_name: 'James'
+    },
+    shipping_address: {
+      first_name: 'James'
+    }
+  }
+};
+
+WooCommerce.put('customers/2', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "customer": {
+        "first_name": "James",
+        "billing_address": {
+            "first_name": "James"
+        },
+        "shipping_address": {
+            "first_name": "James"
+        }
+    }
+}
+
+print(wcapi.put("customers/2", data).json())
+
<?php
+$data = array(
+    'customer' => array(
+        'first_name' => 'James',
+        'billing_address' => array(
+            'first_name' => 'James'
+        ),
+        'shipping_address' => array(
+            'first_name' => 'James'
+        )
+    )
+);
+
+print_r($woocommerce->customers->update(2, $data));
+?>
+
data = {
+  customer: {
+    first_name: "James",
+    billing_address: {
+      first_name: "James"
+    },
+    shipping_address: {
+      first_name: "James"
+    }
+  }
+}
+
+woocommerce.put("customers/2", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "customer": {
+    "id": 2,
+    "created_at": "2015-01-05T18:34:19Z",
+    "email": "john.doe@example.com",
+    "first_name": "James",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order_id": null,
+    "last_order_date": null,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}
+

Delete A Customer

+

This API helps you delete a customer.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/customers/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/customers/2 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('customers/2', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("customers/2").json())
+
<?php print_r($woocommerce->customers->delete(2)); ?>
+
woocommerce.delete("customers/2").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted customer"
+}
+

View Customer Orders

+

This API lets you retrieve the customers orders.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/customers/<id>/orders
+
+
+
curl https://example.com/wc-api/v2/customers/2/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/2/orders', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("customers/2/orders").json())
+
<?php print_r($woocommerce->customers->get_orders(2)); ?>
+
woocommerce.get("customers/2/orders").parsed_response
+
+
+

JSON response example:

+
+
{
+  "orders": [
+    {
+      "id": 531,
+      "order_number": 531,
+      "created_at": "2015-01-21T12:02:13Z",
+      "updated_at": "2015-01-21T12:02:13Z",
+      "completed_at": "2015-01-21T12:02:13Z",
+      "status": "on-hold",
+      "currency": "USD",
+      "total": "30.00",
+      "subtotal": "20.00",
+      "total_line_items_quantity": 1,
+      "total_tax": "0.00",
+      "total_shipping": "10.00",
+      "cart_tax": "0.00",
+      "shipping_tax": "0.00",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": false
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/531",
+      "line_items": [
+        {
+          "id": 417,
+          "subtotal": "20.00",
+          "subtotal_tax": "0.00",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "price": "20.00",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Premium Quality",
+          "product_id": 19,
+          "sku": "",
+          "meta": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 418,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "531",
+        "last_order_date": "2015-01-21T12:02:13Z",
+        "orders_count": 1,
+        "total_spent": "0.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    }
+  ]
+}
+
+ +

View Customer Downloads

+

This API lets you retrieve the customers downloads.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/customers/<id>/downloads
+
+
+
curl https://example.com/wc-api/v2/customers/2/downloads \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/2/downloads', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("customers/2/downloads").json())
+
<?php print_r($woocommerce->customers->get_downloads(2)); ?>
+
woocommerce.get("customers/2/downloads").parsed_response
+
+
+

JSON response example:

+
+
{
+  "downloads": [
+    {
+      "download_url": "https://example.com/?download_file=96&order=wc_order_9999999999999&email=john.doe@example.com&key=99999999999999999999999999999999",
+      "download_id": "99999999999999999999999999999999",
+      "product_id": 96,
+      "download_name": "Woo Album #4 &ndash; Woo Album",
+      "order_id": 532,
+      "order_key": "wc_order_9999999999999",
+      "downloads_remaining": "5",
+      "access_expires": null,
+      "file": {
+        "name": "Woo Album",
+        "file": "http://example.com/wp-content/uploads/woocommerce_uploads/2015/01/album.zip"
+      }
+    }
+  ]
+}
+

Customer Downloads Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
download_urlstringDownload file URL
download_idstringDownload ID
product_idintegerDownloadable product ID
download_namestringDownloadable file name
order_idintegerOrder ID
order_keystringOrder Key
downloads_remainingstringAmount of downloads remaining. An empty string means that is "Unlimited"
access_expiresstringUTC DateTime when the download access expires. null means "Never"
filearrayList for downloadable files, each one have a name (file name) and file (file URL) attribute
+

View Customers Count

+

This API lets you retrieve a count of all customers.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/customers/count
+
+
+
curl https://example.com/wc-api/v2/customers/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/count', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("customers/count").json())
+
<?php print_r($woocommerce->customers->get_count()); ?>
+
woocommerce.get("customers/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 10
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
rolestringCustomers by status. eg: customer or subscriber
+

Orders

+

This section lists all API that can be used to create, edit or otherwise manipulate orders.

+

Orders Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerOrder ID (post ID) read-only
order_numberintegerOrder number read-only
created_atstringUTC DateTime when the order was created read-only
updated_atstringUTC DateTime when the order was last updated read-only
completed_atstringUTC DateTime when the order was last completed read-only
statusstringOrder status. By default are available the status: pending, processing, on-hold, completed, cancelled, refunded and failed. See View List of Order Statuses
currencystringCurrency in ISO format, e.g USD
totalstringOrder total read-only
subtotalstringOrder subtotal read-only
total_line_items_quantityintegerTotal of order items read-only
total_taxstringOrder tax total read-only
total_shippingstringOrder shipping total read-only
cart_taxstringOrder cart tax read-only
shipping_taxstringOrder shipping tax read-only
total_discountstringOrder total discount read-only
shipping_methodsstringText list of the shipping methods used in the order read-only
payment_detailsarrayList of payment details. See Payment Details Properties
billing_addressarrayList of customer billing address. See Customer Billing Address Properties
shipping_addressarrayList of customer shipping address. See Customer Shipping Address Properties
notestringCustomer order notes
customer_ipstringCustomer IP address read-only
customer_user_agentstringCustomer User-Agent read-only
customer_idintegerCustomer ID (user ID) required
view_order_urlstringURL to view the order in frontend read-only
line_itemsarrayList of order line items. See Line Items Properties
shipping_linesarrayList of shipping line items. See Shipping Lines Properties
tax_linesarrayList of tax line items. See Tax Lines Properties read-only
fee_linesarrayList of fee line items. See Fee Lines Properites
coupon_linesarrayList of cupon line items. See Coupon Lines Properties
customerarrayCustomer data. See Customer Properties
+

Payment Details Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
method_idstringPayment method ID required
method_titlestringPayment method title required
paidbooleanShows/define if the order is paid using this payment method. Use true to complate the payment.
transaction_idstringTransaction ID, an optional field to set the transacion ID when complate one payment (to set this you need set the paid as true too)
+

Line Items Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerLine item ID read-only
subtotalstringLine item subtotal
subtotal_taxstringLine item tax subtotal
totalstringLine item total
total_taxstringLine item tax total
pricestringProduct price read-only
quantityintegerQuantity
tax_classstringProduct tax class read-only
namestringProduct name read-only
product_idintegerProduct ID required
skustringProduct SKU read-only
metaarrayList of product meta items. See Products Meta Items Properties
variationsarrayList of product variation attributes. e.g: "variation": {"pa_color": "Black", "pa_size": "XGG"} (Use pa_ prefix when is a product attribute) write-only
+

Products Meta Items Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
keystringMeta item key
labelstringMeta item label
valuestringMeta item value
+

Shipping Lines Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerShipping line ID read-only
method_idstringShipping method ID required
method_titlestringShipping method title required
totalstringTotal amount
+

Tax Lines Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTax rate line ID read-only
rate_idintegerTax rate ID read-only
codestringTax rate code read-only
titlestringTax rate title/name read-only
totalstringTax rate total read-only
compoundbooleanShows if is or not a compound rate. Compound tax rates are applied on top of other tax rates. read-only
+

Fee Lines Properites

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerFee line ID read-only
titlestringShipping method title required
taxablebooleanShows/define if the fee is taxable write-only
tax_classstringTax class, requered in write-mode if the fee is taxable
totalstringTotal amount
total_taxstringTax total
+

Coupon Lines Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCoupon line ID read-only
codestringCoupon code required
amountstringTotal amount required
+

Create An Order

+

This API helps you to create a new order.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/orders
+
+
+ +
+

Example of create a paid order:

+
+
curl -X POST https://example.com/wc-api/v2/orders \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order": {
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "customer_id": 2,
+    "line_items": [
+      {
+        "product_id": 546,
+        "quantity": 2
+      },
+      {
+        "product_id": 613,
+        "quantity": 1,
+        "variations": {
+          "pa_color": "Black"
+        }
+      }
+    ],
+    "shipping_lines": [
+      {
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ]
+  }
+}'
+
var data = {
+  order: {
+    payment_details: {
+      method_id: 'bacs',
+      method_title: 'Direct Bank Transfer',
+      paid: true
+    },
+    billing_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US',
+      email: 'john.doe@example.com',
+      phone: '(555) 555-5555'
+    },
+    shipping_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US'
+    },
+    customer_id: 2,
+    line_items: [
+      {
+        product_id: 546,
+        quantity: 2
+      },
+      {
+        product_id: 613,
+        quantity: 1,
+        variations: {
+          pa_color: 'Black'
+        }
+      }
+    ],
+    shipping_lines: [
+      {
+        method_id: 'flat_rate',
+        method_title: 'Flat Rate',
+        total: '10.00'
+      }
+    ]
+  }
+};
+
+WooCommerce.post('orders', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "order": {
+        "payment_details": {
+            "method_id": "bacs",
+            "method_title": "Direct Bank Transfer",
+            "paid": True
+        },
+        "billing_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US",
+            "email": "john.doe@example.com",
+            "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US"
+        },
+        "customer_id": 2,
+        "line_items": [
+            {
+                "product_id": 546,
+                "quantity": 2
+            },
+            {
+                "product_id": 613,
+                "quantity": 1,
+                "variations": {
+                    "pa_color": "Black"
+                }
+            }
+        ],
+        "shipping_lines": [
+            {
+                "method_id": "flat_rate",
+                "method_title": "Flat Rate",
+                "total": "10.00"
+            }
+        ]
+    }
+}
+
+print(wcapi.post("orders", data).json())
+
<?php
+$data = array(
+    'order' => array(
+        'payment_details' => array(
+            'method_id' => 'bacs',
+            'method_title' => 'Direct Bank Transfer',
+            'paid' => true
+        ),
+        'billing_address' => array(
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US',
+            'email' => 'john.doe@example.com',
+            'phone' => '(555) 555-5555'
+        ),
+        'shipping_address' => array(
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US'
+        ),
+        'customer_id' => 2,
+        'line_items' => array(
+            array(
+                'product_id' => 546,
+                'quantity' => 2
+            ),
+            array(
+                'product_id' => 613,
+                'quantity' => 1,
+                'variations' => array(
+                    'pa_color' => 'Black'
+                )
+            )
+        ),
+        'shipping_lines' => array(
+            array(
+                'method_id' => 'flat_rate',
+                'method_title' => 'Flat Rate',
+                'total' => '10.00'
+            )
+        )
+    )
+);
+
+print_r($woocommerce->orders->create($data));
+?>
+
data = {
+  order: {
+    payment_details: {
+      method_id: "bacs",
+      method_title: "Direct Bank Transfer",
+      paid: true
+    },
+    billing_address: {
+      first_name: "John",
+      last_name: "Doe",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US",
+      email: "john.doe@example.com",
+      phone: "(555) 555-5555"
+    },
+    shipping_address: {
+      first_name: "John",
+      last_name: "Doe",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US"
+    },
+    customer_id: 2,
+    line_items: [
+        {
+          product_id: 546,
+          quantity: 2
+        },
+        {
+          product_id: 613,
+          quantity: 1,
+          variations: {
+            pa_color: "Black"
+          }
+        }
+    ],
+    shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "10.00"
+        }
+    ]
+  }
+}
+
+woocommerce.post("orders", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order": {
+    "id": 645,
+    "order_number": 645,
+    "created_at": "2015-01-26T20:00:21Z",
+    "updated_at": "2015-01-26T20:00:21Z",
+    "completed_at": "2015-01-26T20:00:21Z",
+    "status": "processing",
+    "currency": "USD",
+    "total": "79.87",
+    "subtotal": "63.97",
+    "total_line_items_quantity": 3,
+    "total_tax": "5.90",
+    "total_shipping": "10.00",
+    "cart_tax": "5.40",
+    "shipping_tax": "0.50",
+    "total_discount": "0.00",
+    "shipping_methods": "Flat Rate",
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "note": "",
+    "customer_ip": "127.0.0.1",
+    "customer_user_agent": "WordPress/4.1; http://example.com",
+    "customer_id": 2,
+    "view_order_url": "https://example.com/my-account/view-order/645",
+    "line_items": [
+      {
+        "id": 504,
+        "subtotal": "43.98",
+        "subtotal_tax": "4.40",
+        "total": "43.98",
+        "total_tax": "4.40",
+        "price": "21.99",
+        "quantity": 2,
+        "tax_class": "reduced-rate",
+        "name": "Premium Quality",
+        "product_id": 546,
+        "sku": "",
+        "meta": []
+      },
+      {
+        "id": 505,
+        "subtotal": "19.99",
+        "subtotal_tax": "1.00",
+        "total": "19.99",
+        "total_tax": "1.00",
+        "price": "19.99",
+        "quantity": 1,
+        "tax_class": null,
+        "name": "Ship Your Idea",
+        "product_id": 613,
+        "sku": "",
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 506,
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 507,
+        "rate_id": "5",
+        "code": "US-CA-TAX-1",
+        "title": "Tax",
+        "total": "4.40",
+        "compound": false
+      },
+      {
+        "id": 508,
+        "rate_id": "4",
+        "code": "US-STANDARD-1",
+        "title": "Standard",
+        "total": "1.50",
+        "compound": false
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "customer": {
+      "id": 2,
+      "created_at": "2014-11-19T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "",
+      "last_name": "",
+      "username": "john.doe",
+      "last_order_id": "645",
+      "last_order_date": "2015-01-26T20:00:21Z",
+      "orders_count": 2,
+      "total_spent": "19.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    }
+  }
+}
+

View An Order

+

This API lets you retrieve and view a specific order.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/<id>
+
+
+
curl https://example.com/wc-api/v2/orders/645 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/645").json())
+
<?php print_r($woocommerce->orders->get(645)); ?>
+
woocommerce.get("orders/645").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order": {
+    "id": 645,
+    "order_number": 645,
+    "created_at": "2015-01-26T20:00:21Z",
+    "updated_at": "2015-01-26T20:00:21Z",
+    "completed_at": "2015-01-26T20:00:21Z",
+    "status": "processing",
+    "currency": "USD",
+    "total": "79.87",
+    "subtotal": "63.97",
+    "total_line_items_quantity": 3,
+    "total_tax": "5.90",
+    "total_shipping": "10.00",
+    "cart_tax": "5.40",
+    "shipping_tax": "0.50",
+    "total_discount": "0.00",
+    "shipping_methods": "Flat Rate",
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "note": "",
+    "customer_ip": "127.0.0.1",
+    "customer_user_agent": "WordPress/4.1; http://example.com",
+    "customer_id": 2,
+    "view_order_url": "https://example.com/my-account/view-order/645",
+    "line_items": [
+      {
+        "id": 504,
+        "subtotal": "43.98",
+        "subtotal_tax": "4.40",
+        "total": "43.98",
+        "total_tax": "4.40",
+        "price": "21.99",
+        "quantity": 2,
+        "tax_class": "reduced-rate",
+        "name": "Premium Quality",
+        "product_id": 546,
+        "sku": "",
+        "meta": []
+      },
+      {
+        "id": 505,
+        "subtotal": "19.99",
+        "subtotal_tax": "1.00",
+        "total": "19.99",
+        "total_tax": "1.00",
+        "price": "19.99",
+        "quantity": 1,
+        "tax_class": null,
+        "name": "Ship Your Idea",
+        "product_id": 613,
+        "sku": "",
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 506,
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 507,
+        "rate_id": "5",
+        "code": "US-CA-TAX-1",
+        "title": "Tax",
+        "total": "4.40",
+        "compound": false
+      },
+      {
+        "id": 508,
+        "rate_id": "4",
+        "code": "US-STANDARD-1",
+        "title": "Standard",
+        "total": "1.50",
+        "compound": false
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "customer": {
+      "id": 2,
+      "created_at": "2014-11-19T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "",
+      "last_name": "",
+      "username": "john.doe",
+      "last_order_id": "645",
+      "last_order_date": "2015-01-26T20:00:21Z",
+      "orders_count": 2,
+      "total_spent": "19.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    }
+  }
+}
+

View List Of Orders

+

This API helps you to view all the orders.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders
+
+
+
curl https://example.com/wc-api/v2/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders").json())
+
<?php print_r($woocommerce->orders->get()); ?>
+
woocommerce.get("orders").parsed_response
+
+
+

JSON response example:

+
+
{
+  "orders": [
+    {
+      "id": 645,
+      "order_number": 645,
+      "created_at": "2015-01-26T20:00:21Z",
+      "updated_at": "2015-01-26T20:00:21Z",
+      "completed_at": "2015-01-26T20:00:21Z",
+      "status": "processing",
+      "currency": "USD",
+      "total": "79.87",
+      "subtotal": "63.97",
+      "total_line_items_quantity": 3,
+      "total_tax": "5.90",
+      "total_shipping": "10.00",
+      "cart_tax": "5.40",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": true
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "WordPress/4.1; http://example.com",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/645",
+      "line_items": [
+        {
+          "id": 504,
+          "subtotal": "43.98",
+          "subtotal_tax": "4.40",
+          "total": "43.98",
+          "total_tax": "4.40",
+          "price": "21.99",
+          "quantity": 2,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 505,
+          "subtotal": "19.99",
+          "subtotal_tax": "1.00",
+          "total": "19.99",
+          "total_tax": "1.00",
+          "price": "19.99",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Ship Your Idea",
+          "product_id": 613,
+          "sku": "",
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 506,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 507,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 508,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    },
+    {
+      "id": 644,
+      "order_number": 644,
+      "created_at": "2015-01-26T19:33:42Z",
+      "updated_at": "2015-01-26T19:33:42Z",
+      "completed_at": "2015-01-26T19:33:42Z",
+      "status": "on-hold",
+      "currency": "USD",
+      "total": "44.14",
+      "subtotal": "30.99",
+      "total_line_items_quantity": 2,
+      "total_tax": "3.15",
+      "total_shipping": "10.00",
+      "cart_tax": "2.65",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": false
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/644",
+      "line_items": [
+        {
+          "id": 499,
+          "subtotal": "21.99",
+          "subtotal_tax": "2.20",
+          "total": "21.99",
+          "total_tax": "2.20",
+          "price": "21.99",
+          "quantity": 1,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 500,
+          "subtotal": "9.00",
+          "subtotal_tax": "0.45",
+          "total": "9.00",
+          "total_tax": "0.45",
+          "price": "9.00",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Woo Album #4",
+          "product_id": 96,
+          "sku": "",
+          "meta": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 501,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 502,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 503,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringOrders by status. eg: processing or cancelled
+

Update An Order

+

This API lets you make changes to an order.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/orders/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/orders/645 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order": {
+    "status": "completed"
+  }
+}'
+
var data = {
+  order: {
+    status: 'completed'
+  }
+};
+
+WooCommerce.put('orders/645', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "order": {
+        "status": "completed"
+    }
+}
+
+print(wcapi.put("orders/645", data).json())
+
<?php
+$data = array(
+    'order' => array(
+        'status' => 'completed'
+    )
+);
+
+print_r($woocommerce->orders->update(645, $data));
+?>
+
data = {
+  order: {
+    status: "completed"
+  }
+}
+
+woocommerce.put("orders/645", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order": {
+    "id": 645,
+    "order_number": 645,
+    "created_at": "2015-01-26T20:00:21Z",
+    "updated_at": "2015-01-26T20:00:21Z",
+    "completed_at": "2015-01-26T20:00:21Z",
+    "status": "completed",
+    "currency": "USD",
+    "total": "79.87",
+    "subtotal": "63.97",
+    "total_line_items_quantity": 3,
+    "total_tax": "5.90",
+    "total_shipping": "10.00",
+    "cart_tax": "5.40",
+    "shipping_tax": "0.50",
+    "total_discount": "0.00",
+    "shipping_methods": "Flat Rate",
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "note": "",
+    "customer_ip": "127.0.0.1",
+    "customer_user_agent": "WordPress/4.1; http://example.com",
+    "customer_id": 2,
+    "view_order_url": "https://example.com/my-account/view-order/645",
+    "line_items": [
+      {
+        "id": 504,
+        "subtotal": "43.98",
+        "subtotal_tax": "4.40",
+        "total": "43.98",
+        "total_tax": "4.40",
+        "price": "21.99",
+        "quantity": 2,
+        "tax_class": "reduced-rate",
+        "name": "Premium Quality",
+        "product_id": 546,
+        "sku": "",
+        "meta": []
+      },
+      {
+        "id": 505,
+        "subtotal": "19.99",
+        "subtotal_tax": "1.00",
+        "total": "19.99",
+        "total_tax": "1.00",
+        "price": "19.99",
+        "quantity": 1,
+        "tax_class": null,
+        "name": "Ship Your Idea",
+        "product_id": 613,
+        "sku": "",
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 506,
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 507,
+        "rate_id": "5",
+        "code": "US-CA-TAX-1",
+        "title": "Tax",
+        "total": "4.40",
+        "compound": false
+      },
+      {
+        "id": 508,
+        "rate_id": "4",
+        "code": "US-STANDARD-1",
+        "title": "Standard",
+        "total": "1.50",
+        "compound": false
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "customer": {
+      "id": 2,
+      "created_at": "2014-11-19T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "",
+      "last_name": "",
+      "username": "john.doe",
+      "last_order_id": "645",
+      "last_order_date": "2015-01-26T20:00:21Z",
+      "orders_count": 2,
+      "total_spent": "19.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    }
+  }
+}
+

Delete An Order

+

This API helps you delete an order.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/orders/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/orders/645/?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('orders/645/?force=true', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("orders/645/", params={"force": True}).json())
+
<?php print_r($woocommerce->orders->delete(645, true)); ?>
+
woocommerce.delete("orders/645/, force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted order"
+}
+

Parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the order, defaults to false. Note that permanently deleting the order will return HTTP 200 rather than HTTP 202.
+

View Orders Count

+

This API lets you retrieve a count of all orders.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/count
+
+
+
curl https://example.com/wc-api/v2/orders/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/count', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/count").json())
+
<?php print_r($woocommerce->orders->get_count()); ?>
+
woocommerce.get("orders/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 2
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringOrders by status. eg: processing or cancelled
+

View List Of Order Statuses

+

This API lets you retrieve a list of orders statuses available.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/statuses
+
+
+
curl https://example.com/wc-api/v2/orders/statuses \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/statuses', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/statuses").json())
+
<?php print_r($woocommerce->orders->get_statuses()); ?>
+
woocommerce.get("orders/statuses").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_statuses": {
+    "pending": "Pending Payment",
+    "processing": "Processing",
+    "on-hold": "On Hold",
+    "completed": "Completed",
+    "cancelled": "Cancelled",
+    "refunded": "Refunded",
+    "failed": "Failed"
+  }
+}
+

Create A Note For An Order

+

This API helps you to create a new note for an order.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/orders/<id>/notes
+
+
+
curl -X POST https://example.com/wc-api/v2/orders/645/notes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_note": {
+    "note": "Order ok!!!"
+  }
+}'
+
var data = {
+  order_note: {
+    note: 'Order ok!!!'
+  }
+};
+
+WooCommerce.post('orders/645/notes', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "order_note": {
+        "note": "Order ok!!!"
+    }
+}
+
+print(wcapi.post("orders/645/notes", data).json())
+
<?php
+$data = array(
+    'order_note' => array(
+        'note' => 'Order ok!!!'
+    )
+);
+
+print_r($woocommerce->order_notes->create(645, $data));
+?>
+
data = {
+  order_note: {
+    note: "Order ok!!!"
+  }
+}
+
+woocommerce.post("orders/645/notes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_note": {
+    "id": "416",
+    "created_at": "2015-01-26T20:56:44Z",
+    "note": "Order ok!!!",
+    "customer_note": false
+  }
+}
+

Order Notes Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerOrder note ID read-only
created_atstringUTC DateTime when the order note was created read-only
notestringOrder note required
customer_notebooleanShows/define if the note is only for reference or for the customer (the user will be notified). Default is false
+

View An Order Note

+

This API lets you retrieve and view a specific note from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/<id>/notes/<note_id>
+
+
+
curl https://example.com/wc-api/v2/orders/645/notes/416 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/notes/416', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/645/notes/416").json())
+
<?php print_r($woocommerce->order_notes->get(645, 416)); ?>
+
woocommerce.get("orders/645/notes/416").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_note": {
+    "id": "416",
+    "created_at": "2015-01-26T20:56:44Z",
+    "note": "Order ok!!!",
+    "customer_note": false
+  }
+}
+
+ +

View List Of Notes From An Order

+

This API helps you to view all the notes from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/<id>/notes
+
+
+
curl https://example.com/wc-api/v2/orders/645/notes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/notes', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/645/notes").json())
+
<?php print_r($woocommerce->order_notes->get(645)); ?>
+
woocommerce.get("orders/645/notes").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_notes": [
+    {
+      "id": "416",
+      "created_at": "2015-01-26T20:56:44Z",
+      "note": "Order ok!!!",
+      "customer_note": false
+    },
+    {
+      "id": "415",
+      "created_at": "2015-01-26T20:16:14Z",
+      "note": "Order status changed from Processing to Completed.",
+      "customer_note": false
+    },
+    {
+      "id": "412",
+      "created_at": "2015-01-26T20:00:21Z",
+      "note": "Order item stock reduced successfully.",
+      "customer_note": false
+    },
+    {
+      "id": "411",
+      "created_at": "2015-01-26T20:00:09Z",
+      "note": "Order status changed from Pending Payment to Processing.",
+      "customer_note": false
+    }
+  ]
+}
+
+ +

Update An Order Note

+

This API lets you make changes to an order note.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/orders/<id>/notes/<note_id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/orders/645/notes/416 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_note": {
+    "note": "Ok!"
+  }
+}'
+
var data = {
+  order_note: {
+    note: 'Ok!'
+  }
+};
+
+WooCommerce.put('orders/645/notes/416', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "order_note": {
+        "note": "Ok!"
+    }
+}
+
+print(wcapi.put("orders/645/notes/416", data).json())
+
<?php
+$data = array(
+    'order_note' => array(
+        'note' => 'Ok!'
+    )
+);
+
+print_r($woocommerce->order_notes->update(645, 416, $data));
+?>
+
data = {
+  order_note: {
+    note: "Ok!"
+  }
+}
+
+woocommerce.put("orders/645/notes/416", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_note": {
+    "id": "416",
+    "created_at": "2015-01-26T20:56:44Z",
+    "note": "Ok!",
+    "customer_note": false
+  }
+}
+
+ +

Delete An Order Note

+

This API helps you delete an order note.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/orders/<id>/notes/<note_id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/orders/645/notes/416 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('orders/645/notes/416', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("orders/645/notes/416").json())
+
<?php print_r($woocommerce->order_notes->delete(645, 416)); ?>
+
woocommerce.delete("orders/645/notes/416").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted order note"
+}
+

Create A Refund For An Order

+

This API helps you to create a new refund for an order.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/orders/<id>/refunds
+
+
+
curl -X POST https://example.com/wc-api/v2/orders/645/refunds \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_refund": {
+    "amount": 10
+  }
+}'
+
var data = {
+  order_refund: {
+    amount: 10
+  }
+};
+
+WooCommerce.post('orders/645/refunds', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "order_refund": {
+        "amount": 10
+    }
+}
+
+print(wcapi.post("orders/645/refunds", data).json())
+
<?php
+$data = array(
+    'order_refund' => array(
+        'amount' => 10
+    )
+);
+
+print_r($woocommerce->order_refunds->create(645, $data));
+?>
+
data = {
+  order_refund: {
+    amount: 10
+  }
+}
+
+woocommerce.post("orders/645/refunds", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refund": {
+    "id": 649,
+    "created_at": "2015-01-26T19:29:32Z",
+    "amount": "10.00",
+    "reason": "",
+    "line_items": []
+  }
+}
+

Order Refunds Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerOrder note ID read-only
created_atstringUTC DateTime when the order refund was created read-only
amountstringRefund amount required
reasonstringReason for refund
line_itemsarrayList of order items to refund. See Line Items Properties
+

View An Order Refund

+

This API lets you retrieve and view a specific refund from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/<id>/refunds/<refund_id>
+
+
+
curl https://example.com/wc-api/v2/orders/645/refunds/649 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/refunds/649', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/645/refunds/649").json())
+
<?php print_r($woocommerce->order_refunds->get(645, 649)); ?>
+
woocommerce.get("orders/645/refunds/649").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refund": {
+    "id": 649,
+    "created_at": "2015-01-26T19:29:32Z",
+    "amount": "10.00",
+    "reason": "",
+    "line_items": []
+  }
+}
+
+ +

View List Of Refunds From An Order

+

This API helps you to view all the refunds from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/orders/<id>/refunds
+
+
+
curl https://example.com/wc-api/v2/orders/645/refunds \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/refunds', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("orders/645/refunds").json())
+
<?php print_r($woocommerce->order_refunds->get(645)); ?>
+
woocommerce.get("orders/645/refunds").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refunds": [
+    {
+      "id": 649,
+      "created_at": "2015-01-26T19:29:32Z",
+      "amount": "10.00",
+      "reason": "",
+      "line_items": []
+    },
+    {
+      "id": 647,
+      "created_at": "2015-01-26T19:19:06Z",
+      "amount": "21.99",
+      "reason": "",
+      "line_items": [
+        {
+          "id": 514,
+          "subtotal": "-21.99",
+          "subtotal_tax": "0.00",
+          "total": "-21.99",
+          "total_tax": "0.00",
+          "price": "-21.99",
+          "quantity": 1,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 515,
+          "subtotal": "0.00",
+          "subtotal_tax": "0.00",
+          "total": "0.00",
+          "total_tax": "0.00",
+          "price": "0.00",
+          "quantity": 0,
+          "tax_class": null,
+          "name": "Ship Your Idea",
+          "product_id": 613,
+          "sku": "",
+          "meta": []
+        }
+      ]
+    }
+  ]
+}
+
+ +

Update An Order Refund

+

This API lets you make changes to an order refund.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/orders/<id>/refunds/<refund_id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/orders/645/refunds/649 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_refund": {
+    "reason": "Because was it necessary!"
+  }
+}'
+
var data = {
+  order_refund: {
+    reason: 'Because was it necessary!'
+  }
+};
+
+WooCommerce.put('orders/645/refunds/649', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "order_refund": {
+        "reason": "Because was it necessary!"
+    }
+}
+
+print(wcapi.put("orders/645/refunds/649", data).json())
+
<?php
+$data = array(
+    'order_refund' => array(
+        'reason' => 'Because was it necessary!'
+    )
+);
+
+print_r($woocommerce->order_refunds->update(645, 649, $data));
+?>
+
data = {
+  order_refund: {
+    reason: "Because was it necessary!"
+  }
+}
+
+woocommerce.put("orders/645/refunds/649", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refund": {
+    "id": 649,
+    "created_at": "2015-01-26T19:29:32Z",
+    "amount": "10.00",
+    "reason": "Because was it necessary!",
+    "line_items": []
+  }
+}
+
+ +

Delete An Order Refund

+

This API helps you delete an order refund.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/orders/<id>/refunds/<refund_id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/orders/645/refunds/649 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('orders/645/refunds/649', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("orders/645/refunds/649").json())
+
<?php print_r($woocommerce->order_refunds->delete(645, 649)); ?>
+
woocommerce.delete("orders/645/refunds/649").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted refund"
+}
+

Products

+

This section lists all API that can be used to create, edit or otherwise manipulate products.

+

Products Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
titlestringProduct name
idintegerProduct ID (post ID) read-only
created_atstringUTC DateTime when the product was created read-only
updated_atstringUTC DateTime when the product was last updated read-only
typestringProduct type. By default in WooCommerce the following types are available: simple, grouped, external, variable. Default is simple
statusstringProduct status (post status). Default is publish
downloadablebooleanIf the product is downloadable or not. Downloadable products give access to a file upon purchase
virtualbooleanIf the product is virtual or not. Virtual products are intangible and aren't shipped
permalinkstringProduct URL (post permalink) read-only
skustringSKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
pricestringCurrent product price. This is setted from regular_price and sale_price read-only
regular_pricestringProduct regular price
sale_pricestringProduct sale price
sale_price_dates_fromstringSets the sale start date. Date in the YYYY-MM-DD format write-only
sale_price_dates_tostringSets the sale end date. Date in the YYYY-MM-DD format write-only
price_htmlstringPrice formatted in HTML, e.g. <del><span class=\"amount\">&#36;&nbsp;3.00</span></del> <ins><span class=\"amount\">&#36;&nbsp;2.00</span></ins> read-only
taxablebooleanShow if the product is taxable or not read-only
tax_statusstringTax status. The options are: taxable, shipping (Shipping only) and none
tax_classstringTax class
managing_stockbooleanEnable stock management at product level
stock_quantityintegerStock quantity. If is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.
in_stockbooleanControls whether or not the product is listed as "in stock" or "out of stock" on the frontend.
backorders_allowedbooleanShows if backorders are allowed read-only
backorderedbooleanShows if a product is on backorder (if the product have the stock_quantity negative) read-only
backordersmixedIf managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0. The options are: false (Do not allow), notify (Allow, but notify customer), and true (Allow) write-only
sold_individuallybooleanWhen true this only allow one item to be bought in a single order
purchaseablebooleanShows if the product can be bought read-only
featuredbooleanFeatured Product
visiblebooleanShows whether or not the product is visible in the catalog read-only
catalog_visibilitystringCatalog visibility. The following options are available: visible (Catalog and search), catalog (Only in catalog), search (Only in search) and hidden (Hidden from all). Default is visible
on_salebooleanShows if the product is on sale or not read-only
weightstringProduct weight in decimal format
dimensionsarrayList of the product dimensions. See Dimensions Properties
shipping_requiredbooleanShows if the product need to be shipped or not read-only
shipping_taxablebooleanShows whether or not the product shipping is taxable read-only
shipping_classstringShipping class slug. Shipping classes are used by certain shipping methods to group similar products
shipping_class_idintegerShipping class ID read-only
descriptionstringProduct description
enable_html_descriptionboolEnable HTML for product description write-only
short_descriptionstringProduct short description
enable_html_short_descriptionstringEnable HTML for product short description write-only
reviews_allowedbooleanShows/define if reviews are allowed
average_ratingstringReviews average rating read-only
rating_countintegerAmount of reviews that the product have read-only
related_idsarrayList of related products IDs (integer) read-only
upsell_idsarrayList of up-sell products IDs (integer). Up-sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive
cross_sell_idsarrayList of cross-sell products IDs. Cross-sells are products which you promote in the cart, based on the current product
parent_idintegerProduct parent ID (post_parent)
categoriesarrayList of product categories names (string). In write-mode need to pass a array of categories IDs (integer) (uses wp_set_object_terms())
tagsarrayList of product tags names (string). In write-mode need to pass a array of tags IDs (integer) (uses wp_set_object_terms())
imagesarrayList of products images. See Images Properties
featured_srcstringFeatured image URL read-only
attributesarrayList of product attributes. See Attributes Properties. Note: the attribute must be registered in WooCommerce before.
default_attributesarrayDefaults variation attributes. These are the attributes that will be pre-selected on the frontend. See Default Attributes Properties write-only
downloadsarrayList of downloadable files. See Downloads Properties
download_limitintegerAmount of times the product can be downloaded. In write-mode you can sent a blank string for unlimited re-downloads. e.g ''
download_expiryintegerNumber of days that the customer has up to be able to download the product. In write-mode you can sent a blank string for never expiry. e.g ''
download_typestringDownload type, this controls the schema. The available options are: '' (Standard Product), application (Application/Software) and music (Music)
purchase_notestringOptional note to send the customer after purchase.
total_salesintegerAmount of sales read-only
variationsarrayList of products variations. See Variations Properties
parentarrayList the product parent data when query for a variation read-only
product_urlstringProduct external URL. Only for external products write-only
button_textstringProduct external button text. Only for external products write-only
+

Dimensions Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringProduct length in decimal format
widthstringProduct width in decimal format
heightstringProduct height in decimal format
unitstringProduct name read-only
+

Images Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID (attachment ID)
created_atstringUTC DateTime when the image was created read-only
updated_atstringUTC DateTime when the image was last updated read-only
srcstringImage URL. In write-mode you can use to send new images
titlestringImage title (attachment title) read-only
altstringImage alt text (attachment image alt text) read-only
positionintegerImage position. 0 means that the image is featured
+

Attributes Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringAttribute name required
slugstringAttribute slug
positionintegerAttribute position
visiblebooleanShows/define if the attribute is visible on the "Additional Information" tab in the product's page
variationbooleanShows/define if the attribute can be used as variation
optionsarrayList of available term names of the attribute
+

Default Attributes Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringAttribute name
slugstringAttribute slug
optionstringSelected term name of the attribute
+

Downloads Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID (File ID) read-only
namestringFile name
filestringFile URL. In write-mode you can use this property to send new files
+

Variations Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerVariation ID (post ID) read-only
created_atstringUTC DateTime when the variation was created read-only
updated_atstringUTC DateTime when the variation was last updated read-only
downloadablebooleanIf the variation is downloadable or not. Downloadable variations give access to a file upon purchase
virtualbooleanIf the variation is virtual or not. Virtual variations are intangible and aren't shipped
permalinkstringVariation URL (post permalink) read-only
skustringSKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
pricestringCurrent variation price. This is setted from regular_price and sale_price read-only
regular_pricestringVariation regular price
sale_pricestringVariation sale price
sale_price_dates_fromstringSets the sale start date. Date in the YYYY-MM-DD format write-only
sale_price_dates_tostringSets the sale end date. Date in the YYYY-MM-DD format write-only
taxablebooleanShow if the variation is taxable or not read-only
tax_statusstringTax status. The options are: taxable, shipping (Shipping only) and none
tax_classstringTax class
managing_stockbooleanEnable stock management at variation level
stock_quantityintegerStock quantity. If is a variable variation this value will be used to control stock for all variations, unless you define stock at variation level.
in_stockbooleanControls whether or not the variation is listed as "in stock" or "out of stock" on the frontend.
backorderedbooleanShows if a variation is on backorder (if the variation have the stock_quantity negative) read-only
purchaseablebooleanShows if the variation can be bought read-only
visiblebooleanShows whether or not the product parent is visible in the catalog read-only
on_salebooleanShows if the variation is on sale or not read-only
weightstringVariation weight in decimal format
dimensionsarrayList of the variation dimensions. See Dimensions Properties
shipping_classstringShipping class slug. Shipping classes are used by certain shipping methods to group similar products
shipping_class_idintegerShipping class ID read-only
imagearrayVariation featured image. See Images Properties
attributesarrayList of variation attributes. Similar to a simple or variable product, but for variation indicate the attributes used to form the variation. See Attributes Properties
downloadsarrayList of downloadable files. See Downloads Properties
download_limitintegerAmount of times the variation can be downloaded. In write-mode you can sent a blank string for unlimited re-downloads. e.g ''
download_expiryintegerNumber of days that the customer has up to be able to download the varition. In write-mode you can sent a blank string for never expiry. e.g ''
+

Create A Product

+

This API helps you to create a new product.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/products
+
+
+ +
+

Example of how to create a simple product:

+
+
curl -X POST https://example.com/wc-api/v2/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product": {
+    "title": "Premium Quality",
+    "type": "simple",
+    "regular_price": "21.99",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+      9,
+      14
+    ],
+    "images": [
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "position": 0
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "position": 1
+      }
+    ]
+  }
+}'
+
var data = {
+  product: {
+    title: 'Premium Quality',
+    type: 'simple',
+    regular_price: '21.99',
+    description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    short_description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
+        position: 0
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
+        position: 1
+      }
+    ]
+  }
+};
+
+WooCommerce.post('products', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "product": {
+        "title": "Premium Quality",
+        "type": "simple",
+        "regular_price": "21.99",
+        "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+        "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+        "categories": [
+            9,
+            14
+        ],
+        "images": [
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+                "position": 0
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+                "position": 1
+            }
+        ]
+    }
+}
+
+print(wcapi.post("products", data).json())
+
<?php
+$data = array(
+    'product' => array(
+        'title' => 'Premium Quality',
+        'type' => 'simple',
+        'regular_price' => '21.99',
+        'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+        'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+        'categories' => array(
+            9,
+            14
+        ),
+        'images' => array(
+            array(
+                'src' => 'http =>//example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
+                'position' => 0
+            ),
+            array(
+                'src' => 'http =>//example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
+                'position' => 1
+            )
+        )
+    )
+);
+
+print_r($woocommerce->products->create($data));
+?>
+
data = {
+  product: {
+    title: "Premium Quality",
+    type: "simple",
+    regular_price: "21.99",
+    description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        position: 0
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        position: 1
+      }
+    ]
+  }
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Premium Quality",
+    "id": 546,
+    "created_at": "2015-01-22T19:46:16Z",
+    "updated_at": "2015-01-22T19:46:16Z",
+    "type": "simple",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example.com/product/premium-quality/",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      37,
+      47,
+      31,
+      19,
+      22
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 547,
+        "created_at": "2015-01-22T19:46:16Z",
+        "updated_at": "2015-01-22T19:46:16Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 548,
+        "created_at": "2015-01-22T19:46:17Z",
+        "updated_at": "2015-01-22T19:46:17Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+    "attributes": [],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [],
+    "parent": []
+  }
+}
+
+
+

Example of how to create a variable product:

+
+
curl -X POST https://example.com/wc-api/v2/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product": {
+    "title": "Ship Your Idea",
+    "type": "variable",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+      9,
+      14
+    ],
+    "images": [
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+        "position": 0
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+        "position": 1
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+        "position": 2
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+        "position": 3
+      }
+    ],
+    "attributes": [
+      {
+        "name": "Color",
+        "slug": "color",
+        "position": "0",
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      }
+    ],
+    "default_attributes": [
+      {
+        "name": "Color",
+        "slug": "color",
+        "option": "Black"
+      }
+    ],
+    "variations": [
+      {
+        "regular_price": "19.99",
+        "image": [
+          {
+            "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "black"
+          }
+        ]
+      },
+      {
+        "regular_price": "19.99",
+        "image": [
+          {
+            "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "green"
+          }
+        ]
+      }
+    ]
+  }
+}'
+
var data = {
+  product: {
+    title: 'Ship Your Idea',
+    type: 'variable',
+    description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    short_description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+        position: 0
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
+        position: 1
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+        position: 2
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
+        position: 3
+      }
+    ],
+    attributes: [
+      {
+        name: 'Color',
+        slug: 'color',
+        position: '0',
+        visible: false,
+        variation: true,
+        options: [
+          'Black',
+          'Green'
+        ]
+      }
+    ],
+    default_attributes: [
+      {
+        name: 'Color',
+        slug: 'color',
+        option: 'Black'
+      }
+    ],
+    variations: [
+      {
+        regular_price: '19.99',
+        image: [
+          {
+            src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: 'Color',
+            slug: 'color',
+            option: 'black'
+          }
+        ]
+      },
+      {
+        regular_price: '19.99',
+        image: [
+          {
+            src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: 'Color',
+            slug: 'color',
+            option: 'green'
+          }
+        ]
+      }
+    ]
+  }
+};
+
+WooCommerce.post('products', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "product": {
+        "title": "Ship Your Idea",
+        "type": "variable",
+        "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+        "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+        "categories": [
+            9,
+            14
+        ],
+        "images": [
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+                "position": 0
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+                "position": 1
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+                "position": 2
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+                "position": 3
+            }
+        ],
+        "attributes": [
+            {
+                "name": "Color",
+                "slug": "color",
+                "position": "0",
+                "visible": False,
+                "variation": True,
+                "options": [
+                    "Black",
+                    "Green"
+                ]
+            }
+        ],
+        "default_attributes": [
+            {
+                "name": "Color",
+                "slug": "color",
+                "option": "Black"
+            }
+        ],
+        "variations": [
+            {
+                "regular_price": "19.99",
+                "image": [
+                    {
+                        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+                        "position": 0
+                    }
+                ],
+                "attributes": [
+                    {
+                        "name": "Color",
+                        "slug": "color",
+                        "option": "black"
+                    }
+                ]
+            },
+            {
+                "regular_price": "19.99",
+                "image": [
+                    {
+                        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+                        "position": 0
+                    }
+                ],
+                "attributes": [
+                    {
+                        "name": "Color",
+                        "slug": "color",
+                        "option": "green"
+                    }
+                ]
+            }
+        ]
+    }
+}
+
+print(wcapi.post("products", data).json())
+
<?php
+$data = array(
+    'product' => array(
+        'title' => 'Ship Your Idea',
+        'type' => 'variable',
+        'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+        'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+        'categories' => array(
+            9,
+            14
+        ),
+        'images' => array(
+            array(
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+                'position' => 0
+            ),
+            array(
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
+                'position' => 1
+            ),
+            array(
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+                'position' => 2
+            ),
+            array(
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
+                'position' => 3
+            )
+        ),
+        'attributes' => array(
+            array(
+                'name' => 'Color',
+                'slug' => 'color',
+                'position' => '0',
+                'visible' => False,
+                'variation' => True,
+                'options' => array(
+                    'Black',
+                    'Green'
+                )
+            )
+        ),
+        'default_attributes' => array(
+            array(
+                'name' => 'Color',
+                'slug' => 'color',
+                'option' => 'Black'
+            )
+        ),
+        'variations' => array(
+            array(
+                'regular_price' => '19.99',
+                'image' => array(
+                    array(
+                        'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+                        'position' => 0
+                    )
+                ),
+                'attributes' => array(
+                    array(
+                        'name' => 'Color',
+                        'slug' => 'color',
+                        'option' => 'black'
+                    )
+                )
+            ),
+            array(
+                'regular_price' => '19.99',
+                'image' => array(
+                    array(
+                        'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+                        'position' => 0
+                    )
+                ),
+                'attributes' => array(
+                    array(
+                        'name' => 'Color',
+                        'slug' => 'color',
+                        'option' => 'green'
+                    )
+                )
+            )
+        )
+    )
+);
+
+print_r($woocommerce->products->create($data));
+?>
+
data = {
+  product: {
+    title: "Ship Your Idea",
+    type: "variable",
+    description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+        position: 0
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+        position: 1
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+        position: 2
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+        position: 3
+      }
+    ],
+    attributes: [
+      {
+        name: "Color",
+        slug: "color",
+        position: "0",
+        visible: false,
+        variation: true,
+        options: [
+          "Black",
+          "Green"
+        ]
+      }
+    ],
+    default_attributes: [
+      {
+        name: "Color",
+        slug: "color",
+        option: "Black"
+      }
+    ],
+    variations: [
+      {
+        regular_price: "19.99",
+        image: [
+          {
+            src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: "Color",
+            slug: "color",
+            option: "black"
+          }
+        ]
+      },
+      {
+        regular_price: "19.99",
+        image: [
+          {
+            src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: "Color",
+            slug: "color",
+            option: "green"
+          }
+        ]
+      }
+    ]
+  }
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Ship Your Idea",
+    "id": 604,
+    "created_at": "2015-01-22T20:37:14Z",
+    "updated_at": "2015-01-22T20:37:14Z",
+    "type": "variable",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example/product/ship-your-idea/",
+    "sku": "",
+    "price": "19.99",
+    "regular_price": "0.00",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;19.99</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      40,
+      37,
+      47,
+      577,
+      34
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 605,
+        "created_at": "2015-01-22T20:37:14Z",
+        "updated_at": "2015-01-22T20:37:14Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 606,
+        "created_at": "2015-01-22T20:37:15Z",
+        "updated_at": "2015-01-22T20:37:15Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      },
+      {
+        "id": 607,
+        "created_at": "2015-01-22T20:37:15Z",
+        "updated_at": "2015-01-22T20:37:15Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 2
+      },
+      {
+        "id": 608,
+        "created_at": "2015-01-22T20:37:16Z",
+        "updated_at": "2015-01-22T20:37:16Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 3
+      }
+    ],
+    "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+    "attributes": [
+      {
+        "name": "Color",
+        "slug": "color",
+        "position": 0,
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      }
+    ],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [
+      {
+        "id": 609,
+        "created_at": "2015-01-22T20:37:14Z",
+        "updated_at": "2015-01-22T20:37:14Z",
+        "downloadable": false,
+        "virtual": false,
+        "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
+        "sku": "",
+        "price": "19.99",
+        "regular_price": "19.99",
+        "sale_price": null,
+        "taxable": true,
+        "tax_status": "taxable",
+        "tax_class": "",
+        "managing_stock": false,
+        "stock_quantity": 0,
+        "in_stock": true,
+        "backordered": false,
+        "purchaseable": true,
+        "visible": true,
+        "on_sale": false,
+        "weight": null,
+        "dimensions": {
+          "length": "",
+          "width": "",
+          "height": "",
+          "unit": "cm"
+        },
+        "shipping_class": "",
+        "shipping_class_id": null,
+        "image": [
+          {
+            "id": 610,
+            "created_at": "2015-01-22T20:37:18Z",
+            "updated_at": "2015-01-22T20:37:18Z",
+            "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+            "title": "",
+            "alt": "",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "black"
+          }
+        ],
+        "downloads": [],
+        "download_limit": 0,
+        "download_expiry": 0
+      },
+      {
+        "id": 611,
+        "created_at": "2015-01-22T20:37:14Z",
+        "updated_at": "2015-01-22T20:37:14Z",
+        "downloadable": false,
+        "virtual": false,
+        "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
+        "sku": "",
+        "price": "19.99",
+        "regular_price": "19.99",
+        "sale_price": null,
+        "taxable": true,
+        "tax_status": "taxable",
+        "tax_class": "",
+        "managing_stock": false,
+        "stock_quantity": 0,
+        "in_stock": true,
+        "backordered": false,
+        "purchaseable": true,
+        "visible": true,
+        "on_sale": false,
+        "weight": null,
+        "dimensions": {
+          "length": "",
+          "width": "",
+          "height": "",
+          "unit": "cm"
+        },
+        "shipping_class": "",
+        "shipping_class_id": null,
+        "image": [
+          {
+            "id": 612,
+            "created_at": "2015-01-22T20:37:19Z",
+            "updated_at": "2015-01-22T20:37:19Z",
+            "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+            "title": "",
+            "alt": "",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "green"
+          }
+        ],
+        "downloads": [],
+        "download_limit": 0,
+        "download_expiry": 0
+      }
+    ],
+    "parent": []
+  }
+}
+

View A Product

+

This API lets you retrieve and view a specific product by ID or sku.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/products/<id>
+
+
+ +
+
+ GET +
/wc-api/v2/products/sku/<sku>
+
+
+
curl https://example.com/wc-api/v2/products/546 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/546', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("products/546").json())
+
<?php print_r($woocommerce->products->get(546)); ?>
+
woocommerce.get("products/546").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Premium Quality",
+    "id": 546,
+    "created_at": "2015-01-22T19:46:16Z",
+    "updated_at": "2015-01-22T19:46:16Z",
+    "type": "simple",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example.com/product/premium-quality/",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      37,
+      47,
+      31,
+      19,
+      22
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 547,
+        "created_at": "2015-01-22T19:46:16Z",
+        "updated_at": "2015-01-22T19:46:16Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 548,
+        "created_at": "2015-01-22T19:46:17Z",
+        "updated_at": "2015-01-22T19:46:17Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+    "attributes": [],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [],
+    "parent": []
+  }
+}
+

View List Of Products

+

This API helps you to view all the products.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/products
+
+
+
curl https://example.com/wc-api/v2/products \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("products").json())
+
<?php print_r($woocommerce->products->get()); ?>
+
woocommerce.get("products").parsed_response
+
+
+

JSON response example:

+
+
{
+  "products": [
+    {
+      "title": "Premium Quality",
+      "id": 546,
+      "created_at": "2015-01-22T19:46:16Z",
+      "updated_at": "2015-01-22T19:46:16Z",
+      "type": "simple",
+      "status": "publish",
+      "downloadable": false,
+      "virtual": false,
+      "permalink": "https://example.com/product/premium-quality/",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": null,
+      "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
+      "taxable": true,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "managing_stock": false,
+      "stock_quantity": 0,
+      "in_stock": true,
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "purchaseable": true,
+      "featured": false,
+      "visible": true,
+      "catalog_visibility": "visible",
+      "on_sale": false,
+      "weight": null,
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": "",
+        "unit": "cm"
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": null,
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        37,
+        47,
+        31,
+        19,
+        22
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "categories": [
+        "Clothing",
+        "T-shirts"
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 547,
+          "created_at": "2015-01-22T19:46:16Z",
+          "updated_at": "2015-01-22T19:46:16Z",
+          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 548,
+          "created_at": "2015-01-22T19:46:17Z",
+          "updated_at": "2015-01-22T19:46:17Z",
+          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+      "attributes": [],
+      "downloads": [],
+      "download_limit": 0,
+      "download_expiry": 0,
+      "download_type": "",
+      "purchase_note": "",
+      "total_sales": 0,
+      "variations": [],
+      "parent": []
+    },
+    {
+      "title": "Ship Your Idea",
+      "id": 604,
+      "created_at": "2015-01-22T20:37:14Z",
+      "updated_at": "2015-01-22T20:37:14Z",
+      "type": "variable",
+      "status": "publish",
+      "downloadable": false,
+      "virtual": false,
+      "permalink": "https://example/product/ship-your-idea/",
+      "sku": "",
+      "price": "19.99",
+      "regular_price": "0.00",
+      "sale_price": null,
+      "price_html": "<span class=\"amount\">&#36;&nbsp;19.99</span>",
+      "taxable": true,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "managing_stock": false,
+      "stock_quantity": 0,
+      "in_stock": true,
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "purchaseable": true,
+      "featured": false,
+      "visible": true,
+      "catalog_visibility": "visible",
+      "on_sale": false,
+      "weight": null,
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": "",
+        "unit": "cm"
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": null,
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        40,
+        37,
+        47,
+        577,
+        34
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "categories": [
+        "Clothing",
+        "T-shirts"
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 605,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 606,
+          "created_at": "2015-01-22T20:37:15Z",
+          "updated_at": "2015-01-22T20:37:15Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 1
+        },
+        {
+          "id": 607,
+          "created_at": "2015-01-22T20:37:15Z",
+          "updated_at": "2015-01-22T20:37:15Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 2
+        },
+        {
+          "id": 608,
+          "created_at": "2015-01-22T20:37:16Z",
+          "updated_at": "2015-01-22T20:37:16Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 3
+        }
+      ],
+      "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+      "attributes": [
+        {
+          "name": "Color",
+          "slug": "color",
+          "position": 0,
+          "visible": false,
+          "variation": true,
+          "options": [
+            "Black",
+            "Green"
+          ]
+        }
+      ],
+      "downloads": [],
+      "download_limit": 0,
+      "download_expiry": 0,
+      "download_type": "",
+      "purchase_note": "",
+      "total_sales": 0,
+      "variations": [
+        {
+          "id": 609,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "downloadable": false,
+          "virtual": false,
+          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
+          "sku": "",
+          "price": "19.99",
+          "regular_price": "19.99",
+          "sale_price": null,
+          "taxable": true,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "managing_stock": false,
+          "stock_quantity": 0,
+          "in_stock": true,
+          "backordered": false,
+          "purchaseable": true,
+          "visible": true,
+          "on_sale": false,
+          "weight": null,
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": "",
+            "unit": "cm"
+          },
+          "shipping_class": "",
+          "shipping_class_id": null,
+          "image": [
+            {
+              "id": 610,
+              "created_at": "2015-01-22T20:37:18Z",
+              "updated_at": "2015-01-22T20:37:18Z",
+              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+              "title": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "name": "Color",
+              "slug": "color",
+              "option": "black"
+            }
+          ],
+          "downloads": [],
+          "download_limit": 0,
+          "download_expiry": 0
+        },
+        {
+          "id": 611,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "downloadable": false,
+          "virtual": false,
+          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
+          "sku": "",
+          "price": "19.99",
+          "regular_price": "19.99",
+          "sale_price": null,
+          "taxable": true,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "managing_stock": false,
+          "stock_quantity": 0,
+          "in_stock": true,
+          "backordered": false,
+          "purchaseable": true,
+          "visible": true,
+          "on_sale": false,
+          "weight": null,
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": "",
+            "unit": "cm"
+          },
+          "shipping_class": "",
+          "shipping_class_id": null,
+          "image": [
+            {
+              "id": 612,
+              "created_at": "2015-01-22T20:37:19Z",
+              "updated_at": "2015-01-22T20:37:19Z",
+              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+              "title": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "name": "Color",
+              "slug": "color",
+              "option": "green"
+            }
+          ],
+          "downloads": [],
+          "download_limit": 0,
+          "download_expiry": 0
+        }
+      ],
+      "parent": []
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + + + + + + + + + + + +
FilterTypeDescription
typestringProducts by type. eg: simple or variable
categorystringProducts by category.
skustringFilter a product by SKU.
+

Update A Product

+

This API lets you make changes to a product.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/products/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/products/546 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product": {
+    "regular_price": "24.54"
+  }
+}'
+
var data = {
+  product: {
+    regular_price: '24.54'
+  }
+};
+
+WooCommerce.put('products/546', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "product": {
+        "regular_price": "24.54"
+    }
+}
+
+print(wcapi.put("products/546", data).json())
+
<?php
+$data = array(
+    'product' => array(
+        'regular_price': '24.54'
+    )
+);
+
+print_r($woocommerce->products->update(546, $data));
+?>
+
data = {
+  product: {
+    regular_price: "24.54"
+  }
+}
+
+woocommerce.put("products/546", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Premium Quality",
+    "id": 546,
+    "created_at": "2015-01-22T19:46:16Z",
+    "updated_at": "2015-01-22T19:55:31Z",
+    "type": "simple",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example.com/product/premium-quality/",
+    "sku": "",
+    "price": "24.54",
+    "regular_price": "24.54",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;24.54</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      37,
+      47,
+      31,
+      19,
+      22
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 547,
+        "created_at": "2015-01-22T19:46:16Z",
+        "updated_at": "2015-01-22T19:46:16Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 548,
+        "created_at": "2015-01-22T19:46:17Z",
+        "updated_at": "2015-01-22T19:46:17Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+    "attributes": [],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [],
+    "parent": []
+  }
+}
+

Delete A Product

+

This API helps you delete a product.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/products/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/products/546/?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/546/?force=true', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("products/546/", params={"force": True}).json())
+
<?php print_r($woocommerce->products->delete(546, true)); ?>
+
woocommerce.delete("products/546, force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted product"
+}
+

Parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the product, defaults to false. Note that permanently deleting the product will return HTTP 200 rather than HTTP 202.
+

View Products Count

+

This API lets you retrieve a count of all products.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/products/count
+
+
+
curl https://example.com/wc-api/v2/products/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/count', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("products/count").json())
+
<?php print_r($woocommerce->products->get_count()); ?>
+
woocommerce.get("products/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 2
+}
+

Available Filters

+ + + + + + + + + + + + + + + + + +
FilterTypeDescription
typestringProducts by type. eg: simple or variable
categorystringProducts by category.
+

View List Of Product Reviews

+
+
+ GET +
/wc-api/v2/products/<id>/reviews
+
+
+
curl https://example.com/wc-api/v2/products/546/reviews \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/546/reviews', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("products/546/reviews").json())
+
<?php print_r($woocommerce->products->get_reviews(546)); ?>
+
woocommerce.get("products/546/reviews").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_reviews": [
+    {
+      "id": 4,
+      "created_at": "2013-06-07T11:57:45Z",
+      "review": "This t-shirt is awesome! Would recommend to everyone!\n\nI'm ordering mine next week",
+      "rating": "5",
+      "reviewer_name": "Andrew",
+      "reviewer_email": "andrew@example.com",
+      "verified": false
+    },
+    {
+      "id": 3,
+      "created_at": "2013-06-07T11:53:49Z",
+      "review": "Wonderful quality, and an awesome design. WooThemes ftw!",
+      "rating": "4",
+      "reviewer_name": "Cobus Bester",
+      "reviewer_email": "cobus@example.com",
+      "verified": false
+    }
+  ]
+}
+

Product Reviews Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerReview ID (comment ID) read-only
created_atstringUTC DateTime when the review was created read-only
ratingstringReview rating (0 to 5) read-only
reviewer_namestringReviewer name read-only
reviewer_emailstringReviewer email read-only
verifiedbooleanShows if the reviewer bought the product or not read-only
+

View A Product Category

+
+
+ GET +
/wc-api/v2/products/categories/<id>
+
+
+
curl https://example.com/wc-api/v2/products/categories/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/categories/9', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("products/categories/9").json())
+
<?php print_r($woocommerce->products->get_categories(9)); ?>
+
woocommerce.get("products/categories/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_category": {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": "",
+    "count": 23
+  }
+}
+

Product Category Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCategory ID (term ID) read-only
namestringCategory Name read-only
slugstringCategory slug read-only
parentintegerCategory parent read-only
descriptionstringCategory description read-only
displaystringCategory archive display type, the types available include: default, products, subcategories and both read-only
imagestringCategory image URL read-only
countintegerShows the quantity of products in this category read-only
+

View List Of Product Categories

+
+
+ GET +
/wc-api/v3/products/categories
+
+
+
curl https://example.com/wc-api/v3/products/categories \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/categories', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("products/categories").json())
+
<?php print_r($woocommerce->products->get_categories()); ?>
+
woocommerce.get("products/categories").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_categories": [
+    {
+      "id": 15,
+      "name": "Albums",
+      "slug": "albums",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 4
+    },
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 23
+    },
+    {
+      "id": 10,
+      "name": "Hoodies",
+      "slug": "hoodies",
+      "parent": 9,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 6
+    },
+    {
+      "id": 11,
+      "name": "Music",
+      "slug": "music",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 6
+    },
+    {
+      "id": 12,
+      "name": "Posters",
+      "slug": "posters",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 5
+    },
+    {
+      "id": 13,
+      "name": "Singles",
+      "slug": "singles",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 2
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts",
+      "parent": 9,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 17
+    }
+  ]
+}
+
+ +

Reports

+

This section lists all API that can be used view reports.

+

Reports Filters

+

Use the following filters for any type of report to specify the period of sales:

+ + + + + + + + + + + + + + + + + + + + + + + +
FilterTypeDescription
periodstringThe supported periods are: week, month, last_month, and year. If you use an invalid period, week is used. If you don't specify a period, the current day is used
date_minstringReturn sales for a specific start date. The date need to be in the YYYY-MM-DD format
date_maxstringReturn sales for a specific end date. The dates need to be in the YYYY-MM-DD format. Required to set the filter[date_min] too
+

View List Of Reports

+

This API lets you retrieve and view a simple list of available reports.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/reports
+
+
+
curl https://example.com/wc-api/v2/reports \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('reports', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("reports").json())
+
<?php print_r($woocommerce->reports->get()); ?>
+
woocommerce.get("reports").parsed_response
+
+
+

JSON response example:

+
+
{
+  "reports": [
+    "sales",
+    "sales/top_sellers"
+  ]
+}
+

View List Of Sales Report

+

This API lets you retrieve and view a list of sales report.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/reports/sales
+
+
+
curl https://example.com/wc-api/v2/reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21").json())
+
<?php
+$args = array(
+    'filter' => array(
+        'date_min' => '2015-01-18',
+        'date_max' => '2015-01-21'
+    )
+);
+
+print_r($woocommerce->reports->get_sales($args));
+?>
+
woocommerce.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21").parsed_response
+
+
+

JSON response example:

+
+
{
+  "sales": {
+    "total_sales": "580.10",
+    "average_sales": "145.03",
+    "total_orders": 4,
+    "total_items": 31,
+    "total_tax": "26.10",
+    "total_shipping": "20.00",
+    "total_discount": "0.00",
+    "totals_grouped_by": "day",
+    "totals": {
+      "2015-01-18": {
+        "sales": "-17.00",
+        "orders": 1,
+        "items": 1,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2015-01-19": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2015-01-20": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2015-01-21": {
+        "sales": "597.10",
+        "orders": 3,
+        "items": 30,
+        "tax": "26.10",
+        "shipping": "20.00",
+        "discount": "0.00",
+        "customers": 0
+      }
+    },
+    "total_customers": 0
+  }
+}
+

View List Of Top Sellers Report

+

This API lets you retrieve and view a list of top sellers report.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/reports/sales/top_sellers
+
+
+
curl https://example.com/wc-api/v2/reports/sales/top_sellers?filter[period]=last_month \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('reports/sales/top_sellers?filter[period]=last_month', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("reports/sales/top_sellers?filter[period]=last_month").json())
+
<?php
+$args = array(
+    'filter' => array(
+        'period' => 'last_month'
+    )
+);
+
+print_r($woocommerce->reports->get_top_sellers($args));
+?>
+
woocommerce.get("reports/sales/top_sellers?filter[period]=last_month").parsed_response
+
+
+

JSON response example:

+
+
{
+  "top_sellers": [
+    {
+      "title": "Happy Ninja",
+      "product_id": "37",
+      "quantity": "24"
+    },
+    {
+      "title": "Flying Ninja",
+      "product_id": "70",
+      "quantity": "14"
+    },
+    {
+      "title": "Happy Ninja",
+      "product_id": "53",
+      "quantity": "6"
+    },
+    {
+      "title": "Ninja Silhouette",
+      "product_id": "31",
+      "quantity": "3"
+    },
+    {
+      "title": "Woo Logo",
+      "product_id": "15",
+      "quantity": "3"
+    },
+    {
+      "title": "Woo Album #1",
+      "product_id": "83",
+      "quantity": "3"
+    },
+    {
+      "title": "Woo Album #4",
+      "product_id": "96",
+      "quantity": "1"
+    },
+    {
+      "title": "Premium Quality",
+      "product_id": "19",
+      "quantity": "1"
+    },
+    {
+      "title": "Ninja Silhouette",
+      "product_id": "56",
+      "quantity": "1"
+    }
+  ]
+}
+

Webhooks

+

This section lists all API that can be used to create, edit or otherwise manipulate webhooks.

+

Webhooks Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerThe webhook ID (post ID) read-only
namestringA friendly name for the webhook, defaults to "Webhook created on <date>"
statusstringWebhook status, options are active (delivers payload), paused (does not deliver), or disabled (does not deliver due delivery failures). Default is active
topicstringWebhook topic, e.g. coupon.updated. See the complete list
resourcestringWebhook resource, e.g. coupon read-only
eventstringWebhook event, e.g. updated read-only
hooksarrayWooCommerce action names associated with the webhook read-only
delivery_urlstringThe URL where the webhook payload is delivered
secretstringSecret key used to generate a hash of the delivered webhook and provided in the request headers. required write-only
created_atstringUTC DateTime when the webhook was created read-only
updated_atstringUTC DateTime when the webhook was last updated read-only
+

Delivery Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerThe delivery ID (comment ID)
durationstringThe delivery duration, in seconds
summarystringA friendly summary of the response including the HTTP response code, message, and body
request_urlstringThe URL where the webhook was delivered
request_headersarrayArray of request headers (see Request Headers Attributes)
request_bodystringThe request body, this matches the API response for the given resource (e.g. for the coupon.updated topic, the request body would match the response for GET /coupons/{id})
response_codestringThe HTTP response code from the receiving server
response_messagestringThe HTTP response message from the receiving server
response_headersarrayArray of the response headers from the receiving server
response_bodystringThe response body from the receiving server
created_atstringA DateTime of when the delivery was logged
+

Request Headers Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
User-AgentstringThe request user agent, defaults to "WooCommerce/{version} Hookshot (WordPress/{version})"
Content-TypestringThe request content-type, defaults to "application/json"
X-WC-Webhook-TopicstringThe webhook topic
X-WC-Webhook-ResourcestringThe webhook resource
X-WC-Webhook-EventstringThe webhook event
X-WC-Webhook-SignaturestringA base64 encoded HMAC-SHA256 hash of the payload
X-WC-Webhook-IDintegerThe webhook's ID
X-WC-Webhook-Delivery-IDintegerThe delivery ID
+

Create A Webhook

+

This API helps you to create a new webhook.

+

HTTP Request

+
+
+ POST +
/wc-api/v2/webhooks
+
+
+
curl -X POST https://example.com/wc-api/v2/webhooks \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "webhook": {
+    "name": "An add to cart webhook",
+    "secret": "my-super-secret-private-key",
+    "topic": "action.woocommerce_add_to_cart",
+    "delivery_url": "http://requestb.in/1exdwip1"
+  }
+}'
+
var data = {
+  webhook: {
+    name: 'An add to cart webhook',
+    secret: 'my-super-secret-private-key',
+    topic: 'action.woocommerce_add_to_cart',
+    delivery_url: 'http://requestb.in/1exdwip1'
+  }
+};
+
+WooCommerce.post('webhooks', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "webhook": {
+        "name": "An add to cart webhook",
+        "secret": "my-super-secret-private-key",
+        "topic": "action.woocommerce_add_to_cart",
+        "delivery_url": "http://requestb.in/1exdwip1"
+    }
+}
+
+print(wcapi.post("webhooks", data).json())
+
<?php
+$data = array(
+    'webhook' => array(
+        'name' => 'An add to cart webhook',
+        'secret' => 'my-super-secret-private-key',
+        'topic' => 'action.woocommerce_add_to_cart',
+        'delivery_url' => 'http://requestb.in/1exdwip1'
+    )
+);
+
+print_r($woocommerce->webhooks->create($data));
+?>
+
data = {
+  webhook: {
+    name: "An add to cart webhook",
+    secret: "my-super-secret-private-key",
+    topic: "action.woocommerce_add_to_cart",
+    delivery_url: "http://requestb.in/1exdwip1"
+  }
+}
+
+woocommerce.post("webhooks", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook": {
+    "id": 535,
+    "name": "An add to cart webhook",
+    "status": "active",
+    "topic": "action.woocommerce_add_to_cart",
+    "resource": "action",
+    "event": "woocommerce_add_to_cart",
+    "hooks": [
+      "woocommerce_add_to_cart"
+    ],
+    "delivery_url": "http://requestb.in/1exdwip1",
+    "created_at": "2015-01-21T13:19:58Z",
+    "updated_at": "2015-01-21T13:19:58Z"
+  }
+}
+

View A Webhook

+

This API lets you retrieve and view a specific webhook.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/webhooks/<id>
+
+
+
curl https://example.com/wc-api/v2/webhooks/535 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/535', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("webhooks/535").json())
+
<?php print_r($woocommerce->webhooks->get(535)); ?>
+
woocommerce.get("webhooks/535").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook": {
+    "id": 535,
+    "name": "An add to cart webhook",
+    "status": "active",
+    "topic": "action.woocommerce_add_to_cart",
+    "resource": "action",
+    "event": "woocommerce_add_to_cart",
+    "hooks": [
+      "woocommerce_add_to_cart"
+    ],
+    "delivery_url": "http://requestb.in/1exdwip1",
+    "created_at": "2015-01-21T13:19:58Z",
+    "updated_at": "2015-01-21T13:19:58Z"
+  }
+}
+

View List Of Webhooks

+

This API helps you to view all the webhooks.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/webhooks
+
+
+
curl https://example.com/wc-api/v2/webhooks \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("webhooks").json())
+
<?php print_r($woocommerce->webhooks->get()); ?>
+
woocommerce.get("webhooks").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhooks": [
+    {
+      "id": 535,
+      "name": "An add to cart webhook",
+      "status": "active",
+      "topic": "action.woocommerce_add_to_cart",
+      "resource": "action",
+      "event": "woocommerce_add_to_cart",
+      "hooks": [
+        "woocommerce_add_to_cart"
+      ],
+      "delivery_url": "http://requestb.in/1exdwip1",
+      "created_at": "2015-01-21T13:19:58Z",
+      "updated_at": "2015-01-21T13:19:58Z"
+    },
+    {
+      "id": 313,
+      "name": "Webhook created on Jan 17, 2015 @ 11:45 AM",
+      "status": "active",
+      "topic": "order.created",
+      "resource": "order",
+      "event": "created",
+      "hooks": [
+        "woocommerce_checkout_order_processed",
+        "woocommerce_process_shop_order_meta",
+        "woocommerce_api_create_order"
+      ],
+      "delivery_url": "http://requestb.in/1exdwip1",
+      "created_at": "2014-12-17T11:45:05Z",
+      "updated_at": "2015-01-10T00:41:08Z"
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringWebhooks by status. The following options are available: active or paused and disabled. Default is active
+

Update A Webhook

+

This API lets you make changes to a webhook.

+

HTTP Request

+
+
+ PUT +
/wc-api/v2/webhook/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v2/webhook/535 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "webhook": {
+    "status": "paused"
+  }
+}'
+
var data = {
+  webhook: {
+    status: 'paused'
+  }
+}
+
+WooCommerce.put('webhooks/535', data, function(err, data, res) {
+  console.log(res);
+});
+
data = {
+    "webhook": {
+        "status": "paused"
+    }
+}
+
+print(wcapi.put("webhooks/535", data).json())
+
<?php
+$data = array(
+    'webhook' => array(
+        'status' => 'paused'
+    )
+);
+
+print_r($woocommerce->webhooks->updaste(535, $data));
+?>
+
data = {
+  webhook: {
+    status: "paused"
+  }
+}
+
+woocommerce.put("webhooks/535", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook": {
+    "id": 535,
+    "name": "An add to cart webhook",
+    "status": "paused",
+    "topic": "action.woocommerce_add_to_cart",
+    "resource": "action",
+    "event": "woocommerce_add_to_cart",
+    "hooks": [
+      "woocommerce_add_to_cart"
+    ],
+    "delivery_url": "http://requestb.in/1exdwip1",
+    "created_at": "2015-01-21T13:19:58Z",
+    "updated_at": "2015-01-21T13:19:58Z"
+  }
+}
+

Delete A Webhook

+

This API helps you delete a webhook.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v2/webhooks/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v2/webhooks/535 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('webhooks/535', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.delete("webhooks/535").json())
+
<?php print_r($woocommerce->webhooks->delete(535)); ?>
+
woocommerce.delete("webhooks/535").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted webhook"
+}
+

View Webhooks Count

+

This API lets you retrieve a count of all webhooks.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/webhooks/count
+
+
+
curl https://example.com/wc-api/v2/webhooks/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/count', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("webhooks/count").json())
+
<?php print_r($woocommerce->webhooks->get_count()); ?>
+
woocommerce.get("webhooks/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 4
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringWebhooks by status. The following options are available: active or paused and disabled
+

View A Webhooks Delivery

+

This API lets you retrieve and view a specific webhook delivery.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/webhooks/<id>/deliveries/<delivery_id>
+
+
+
curl https://example.com/wc-api/v2/webhooks/535/deliveries/378 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/535/deliveries/378', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("webhooks/535/deliveries/378").json())
+
<?php print_r($woocommerce->webhooks->get_deliveries(378)); ?>
+
woocommerce.get("webhooks/535/deliveries/378").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook_delivery": {
+    "id": 378,
+    "duration": "0.90226",
+    "summary": "HTTP 200 OK: ok",
+    "request_method": "POST",
+    "request_url": "http://requestb.in/125q7ns1",
+    "request_headers": {
+      "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
+      "Content-Type": "application/json",
+      "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
+      "X-WC-Webhook-Resource": "action",
+      "X-WC-Webhook-Event": "woocommerce_add_to_cart",
+      "X-WC-Webhook-Signature": "geC1akFhCtsO7fbXz5XiGUsMsRa4Mt0IJsZ96nTaHjI=",
+      "X-WC-Webhook-ID": 535,
+      "X-WC-Webhook-Delivery-ID": 378
+    },
+    "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"7cbbc409ec990f19c78c75bd1e06f215\"}",
+    "response_code": "200",
+    "response_message": "OK",
+    "response_headers": {
+      "connection": "close",
+      "server": "gunicorn/18.0",
+      "date": "Wed, 21 Jan 2015 16:22:49 GMT",
+      "content-type": "text/html; charset=utf-8",
+      "content-length": "2",
+      "sponsored-by": "https://www.runscope.com",
+      "via": "1.1 vegur"
+    },
+    "response_body": "ok",
+    "created_at": "2015-01-21T16:26:12Z"
+  }
+}
+
+ +

View List Of Webhooks Deliveries

+

This API helps you to view all deliveries from a specific webhooks.

+

HTTP Request

+
+
+ GET +
/wc-api/v2/webhooks/<id>/deliveries
+
+
+
curl https://example.com/wc-api/v2/webhooks/535/deliveries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/535/deliveries', function(err, data, res) {
+  console.log(res);
+});
+
print(wcapi.get("webhooks/535/deliveries").json())
+
<?php print_r($woocommerce->webhooks->get_deliveries()); ?>
+
woocommerce.get("webhooks/535/deliveries").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook_deliveries": [
+    {
+      "id": 380,
+      "duration": "0.58635",
+      "summary": "HTTP 200 OK: ok",
+      "request_method": "POST",
+      "request_url": "http://requestb.in/125q7ns1",
+      "request_headers": {
+        "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
+        "Content-Type": "application/json",
+        "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
+        "X-WC-Webhook-Resource": "action",
+        "X-WC-Webhook-Event": "woocommerce_add_to_cart",
+        "X-WC-Webhook-Signature": "st4egVCTwG1JMfxmxe7MZYEuj9Y6Euge4SOTNfCUCWY=",
+        "X-WC-Webhook-ID": 535,
+        "X-WC-Webhook-Delivery-ID": 380
+      },
+      "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"c16a5320fa475530d9583c34fd356ef5\"}",
+      "response_code": "200",
+      "response_message": "OK",
+      "response_headers": {
+        "connection": "close",
+        "server": "gunicorn/18.0",
+        "date": "Wed, 21 Jan 2015 16:23:05 GMT",
+        "content-type": "text/html; charset=utf-8",
+        "content-length": "2",
+        "sponsored-by": "https://www.runscope.com",
+        "via": "1.1 vegur"
+      },
+      "response_body": "ok",
+      "created_at": "2015-01-21T16:26:28Z"
+    },
+    {
+      "id": 378,
+      "duration": "0.90226",
+      "summary": "HTTP 200 OK: ok",
+      "request_method": "POST",
+      "request_url": "http://requestb.in/125q7ns1",
+      "request_headers": {
+        "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
+        "Content-Type": "application/json",
+        "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
+        "X-WC-Webhook-Resource": "action",
+        "X-WC-Webhook-Event": "woocommerce_add_to_cart",
+        "X-WC-Webhook-Signature": "geC1akFhCtsO7fbXz5XiGUsMsRa4Mt0IJsZ96nTaHjI=",
+        "X-WC-Webhook-ID": 535,
+        "X-WC-Webhook-Delivery-ID": 378
+      },
+      "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"7cbbc409ec990f19c78c75bd1e06f215\"}",
+      "response_code": "200",
+      "response_message": "OK",
+      "response_headers": {
+        "connection": "close",
+        "server": "gunicorn/18.0",
+        "date": "Wed, 21 Jan 2015 16:22:49 GMT",
+        "content-type": "text/html; charset=utf-8",
+        "content-length": "2",
+        "sponsored-by": "https://www.runscope.com",
+        "via": "1.1 vegur"
+      },
+      "response_body": "ok",
+      "created_at": "2015-01-21T16:26:12Z"
+    }
+  ]
+}
+
+
+
+
+ cURL + Node.js + Python + PHP + Ruby +
+
+
+ +
+ This documentation is for the WooCommerce API v2 which is now deprecated. Please use the latest REST API version. +
+ + + diff --git a/v3.html b/v3.html new file mode 100644 index 00000000..2f6329f3 --- /dev/null +++ b/v3.html @@ -0,0 +1,15957 @@ + + + + + + + + WooCommerce REST API Documentation v3 + + + + + + + + + + + + + + + + + + + NAV + + + +
+ +
+ cURL + Node.js + PHP + Python + Ruby +
+ + +
+
+
+
+

Introduction

+

Introduced in WooCommerce 2.1, the REST API allows WooCommerce data to be created, read, updated, and deleted using JSON format.

+

Requirements

+

You must be using WooCommerce 2.1 or newer and the REST API must be enabled under WooCommerce > Settings. You must enable pretty permalinks in Settings > Permalinks (default permalinks will not work).

+ + +

Version

+

The current API version is v3 which takes a first-order position in endpoints. The following table shows API versions present in each major version of WooCommerce:

+ + + + + + + + + + + + + + + + + + + +
API VersionWooCommerce
v12.1.x, 2.2.x, 2.3.x and 2.4.x
v22.2.x, 2.3.x and 2.4.x
v32.4.x, 2.5.x
+ +

The v1 and v2 APIs will be removed in future versions.

+

What's changed in v3?

+
    +
  • v3 implements full basic authentication (conforms to the Basic auth spec)).
  • +
  • v3 fixes the OAuth implementation to be compliant with the Oauth 1.0a specs.
  • +
  • v3 includes a new endpoint to get all product orders.
  • +
  • v3 has new endpoints for bulk creation and updating of products, orders, customers and coupons.
  • +
  • v3 introduces new product attribute endpoints (GET, POST, PUT and DELETE).
  • +
  • v3 deprecated the product/sku/<id> endpoint (because a SKU can be generated with any character and there is a filter, filter[sku], that covers this use case).
  • +
  • v3 includes category thumbnails with requests for product/categories.
  • +
  • v3 can auto generate passwords for new customers if the "automatically generate customer password" option is enabled.
  • +
+

Differences between v1 and v2

+
    +
  • v1 supports XML response format, v2 only supports JSON.
  • +
  • v1 does not support creating or updating (with the exception of order status) any resources, v2 supports full create/read/update/delete for all endpoints.
  • +
  • v1 does not include order item meta, v2 includes full order item meta (with an optional filter parameter to include protected order item meta)
  • +
  • v1 does not include any endpoints for listing a customer's available downloads, v2 includes the GET /customer/{id}/downloads endpoint.
  • +
  • v1 includes an endpoint for listing notes for an order, v2 includes full create/read/update/delete endpoints.
  • +
  • v1 does not include any endpoints for listing product categories, v2 includes two endpoints for product categories (GET /products/categories and GET /products/categories/{id}).
  • +
  • v1 does not include any endpoints for getting valid order statuses, v2 includes an endpoint for listing valid order statuses (GET /orders/statuses).
  • +
  • v2 supports the core features added in WooCommerce 2.2, primarily order refunds (via the /orders/refunds endpoint) and Webhooks (via the /webhooks).
  • +
+

API Docs for past versions

+ +

Schema

+

The API is accessible via this endpoint:

+ +

https://www.your-store.com/wc-api/v3

+ +

Pretty permalinks must be enabled. You may access the API over either HTTP or HTTPS. HTTPS is recommended where possible, since authentication is simpler. The API index will declare if the site supports SSL or not.

+

Requests/Responses

+

The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

+ +

Some general information about responses:

+ +
    +
  • Dates are returned in RFC3339 format in UTC timezone: YYYY-MM-DDTHH:MM:SSZ

  • +
  • Resource IDs are returned as integers.

  • +
  • Any decimal monetary amount, such as prices or totals, will be returned as strings with two decimal places. The decimal separator (typically either . or ,) is controlled by the site and is included in the API index. This is by design in order to make localization of API data easier for the client. You may need to account for this in your implementation if you will be doing calculations with the returned data (e.g. converting string amounts with commas to decimal places before performing calculations).

  • +
  • Other amounts, such as item counts, are returned as integers.

  • +
  • Blank fields are generally included as null instead of being returned as blank strings or omitted.

  • +
+

Authentication

+

There are two ways to authenticate with the API, depending on whether the site supports SSL. Remember that the Index endpoint will indicate if the site supports SSL.

+

Over HTTPS

+

You may use HTTP Basic Auth by providing the API Consumer Key as the username and the API Consumer Secret as the password.

+ +
+

HTTP Basic Auth example

+
+
curl https://www.example.com/wc-api/v3/orders \
+    -u consumer_key:consumer_secret
+
+

Occasionally some servers may not parse the Authorization header correctly (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters.

+ +
+

Example for servers that not properly parse the Authorization header:

+
+
curl https://www.example.com/wc-api/v3/orders?consumer_key=123&consumer_secret=abc
+

Over HTTP

+

You must use OAuth 1.0a "one-legged" authentication to ensure API credentials cannot be intercepted. Typically you will use any standard OAuth 1.0a library in the language of choice to handle the authentication, or generate the necessary parameters by following the following instructions.

+

Generating an OAuth signature

+

1) Set the HTTP method for the request:

+ +

GET

+ +

2) Set your base request URI -- this is the full request URI without query string parameters -- and URL encode according to RFC 3986:

+ +

http://www.example.com/wc-api/v1/orders

+ +

when encoded:

+ +

http%3A%2F%2Fwww.example.com%2Fwc-api%2Fv1%2Forders

+ +

3) Collect and normalize your query string parameters. This includes all oauth_* parameters except for the signature. Parameters should be normalized by URL encoding according to RFC 3986 (rawurlencode in PHP) and percent(%) characters should be double-encoded (e.g. % becomes %25.

+ +

4) Sort the parameters in byte-order (uksort( $params, 'strcmp' ) in PHP)

+ +

5) Join each parameter with an encoded equals sign (%3D):

+ +

oauth_signature_method%3DHMAC-SHA1

+ +

6) Join each parameter key/value with an encoded ampersand (%26):

+ +

oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1

+ +

7) Form the string to sign by joining the HTTP method, encoded base request URI, and encoded parameter string with an unencoded ampersand symbol (&):

+ +

GET&http%3A%2F%2Fwww.example.com%2Fwc-api%2Fv1%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1

+ +

8) Generate the signature using the string to key and your consumer secret key

+ +

If you are having trouble generating a correct signature, you'll want to review the string you are signing for encoding errors. The authentication source can also be helpful in understanding how to properly generate the signature.

+

OAuth Tips

+
    +
  • The OAuth parameters may be added as query string parameters or included in the Authorization header.
  • +
  • Note there is no reliable cross-platform way to get the raw request headers in WordPress, so query string should be more reliable in some cases.
  • +
  • The required parameters are: oauth_consumer_key, oauth_timestamp, oauth_nonce, oauth_signature, and oauth_signature_method. oauth_version is not required and should be omitted.
  • +
  • The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key.
  • +
  • The OAuth timestamp should be the unix timestamp at the time of the request. The REST API will deny any requests that include a timestamp outside of a 15 minute window to prevent replay attacks.
  • +
  • You must use the store URL provided by the index when forming the base string used for the signature, as this is what the server will use. (e.g. if the store URL includes a www sub-domain, you should use it for requests)
  • +
  • Note that the request body is not signed as per the OAuth spec.
  • +
  • If including parameters in your request, it saves a lot of trouble if you can order your items alphabetically.
  • +
  • Authorization header is supported starting WooCommerce 3.0.
  • +
+

Parameters

+

All endpoints accept optional parameters which can be passed as an HTTP query string parameter, e.g. GET /orders?status=completed. There are common parameters and endpoint-specific parameters which are documented along with that endpoint.

+

Filter Parameter

+

All endpoints accept a filter parameter that scopes individual filters using brackets, like date filtering:

+ +

GET /orders?filter[created_at_min]=2013-11-01

+ +

Multiple filter parameters can be included and intermixed with other parameters:

+ +

GET /orders?status=completed&filter[created_at_min]=2013-11-01&filter[created_at_max]=2013-11-30

+ +

Note that the following filters are supported for all endpoints except the reports endpoint, which has it's own set of filters that are documented along with that endpoint.

+

Available Filters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilterDescription
created_at_mingiven a date, only resources created after the provided date will be returned
created_at_maxgiven a date, only resources created before the provided date will be returned
updated_at_mingiven a date, only resources updated after the provided date will be returned
updated_at_maxgiven a date, only resources updated before the provided date will be returned
qperforms a keyword search and returns resources that match, e.g. GET /products?filter[q]=search-keyword. Note that search terms should be URL-encoded as they will be decoded internally with urldecode
ordercontrols the ordering of the resources returned, accepted values are ASC (default) or DESC
orderbycontrols the field that is used for ordering the resources returned. Accepts the same arguments as WP_Query. Defaults to date. You can order by meta_value but you must provide orderby_meta_key
orderby_meta_keythe meta key to order returned resources by when using orderby=meta_value. For example, you could order products by price using GET /products?filter[orderby]=meta_value_num&filter[orderby_meta_key]=_price
post_statuslimits resources to only those with the specified post status. Most useful for returning unpublished products, e.g. GET /products?filter[post_status]=draft
metaresource meta is excluded by default, but it can be included by setting meta=true, e.g. GET /orders?filter[meta]=true. Protected meta (meta whose key is prefixed with an underscore) is not included in the response
paginationexplained below
+ +

Note that Dates should be provided in RFC3339 format in the UTC timezone: YYYY-MM-DDTHH:MM:SSZ. You may omit the time and timezone if desired.

+

Fields Parameter

+

You may limit the fields returned in the response using the fields parameter:

+ +

GET /orders?fields=id

+ +

To include multiple fields, separate them with commas:

+ +

GET /orders?fields=id,status

+ +

You can specify sub-fields using dot-notation:

+ +

GET /orders?fields=id,status,payment_details.method_title

+ +

Sub-fields can't be limited for resources that have multiple structs, like an order's line items. For example, this will return just the line items, but each line item will have the full set of information, not just the product ID:

+ +

GET /orders?fields=line_items.product_id

+

Pagination

+

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specified with the ?filter[limit] parameter:

+ +

GET /orders?filter[limit]=15

+ +

You can specify further pages with the ?page parameter:

+ +

GET /orders?page=2

+ +

You may also specify the offset from the first resource using the ?filter[offset] parameter:

+ +

GET /orders?filter[offset]=5

+ +

Page number is 1-based and omitting the ?page parameter will return the first page.

+ +

The total number of resources and pages are always included in the X-WC-Total and X-WC-TotalPages HTTP headers.

+ +

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

+
Link: <https://www.example.com/wc-api/v1/products?page=2>; rel="next",
+<https://www.example.com/wc-api/v1/products?page=3>; rel="last"`
+
+

Linebreak included for readability

+ +

The possible rel values are:

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
nextShows the URL of the immediate next page of results
lastShows the URL of the last page of results
firstShows the URL of the first page of results
prevShows the URL of the immediate previous page of results
+

Errors

+

Occasionally you might encounter errors when accessing the API. There are four possible types:

+ +
    +
  • Invalid requests, such as using an unsupported HTTP method will result in 400 Bad Request.
  • +
  • Authentication or permission errors, such as incorrect API keys will result in 401 Unauthorized.
  • +
  • Requests to resources that don't exist or are missing required parameters will result in 404 Not Found.
  • +
  • Requests that cannot be processed due to a server error will result in 500 Internal Server Error.
  • +
+ +
+

400 Bad Request example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_unsupported_method",
+      "message" : "Unsupported request method"
+    }
+  ]
+}
+
+
+

401 Unauthorized example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_authentication_error",
+      "message" : "Consumer Key is invalid"
+    }
+  ]
+}
+
+
+

404 Not Found example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_invalid_order",
+      "message" : "Invalid order"
+    }
+  ]
+}
+
+
+

500 Internal Server Error example:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_invalid_handler",
+      "message" : "The handler for the route is invalid"
+    }
+  ]
+}
+
+

Errors return both an appropriate HTTP status code and response object which contains a code and message attribute. If an endpoint has any custom errors, they are documented within that endpoint.

+

HTTP Verbs

+

The API uses the appropriate HTTP verb for each action:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
VerbDescription
HEADCan be used for any endpoint to return just the HTTP header information
GETUsed for retrieving resources
PUTUsed for updating resources
POSTUsed for creating resources
DELETEUsed for deleting resources
+

JSONP Support

+

The API supports JSONP by default. JSONP responses use the application/javascript content-type. You can specify the callback using the ?_jsonp parameter for GET requests to have the response wrapped in a JSON function:

+ +
+
+ GET +
/wc-api/v3/orders/count?_jsonp=ordersCount
+
+
+
curl https://example.com/wc-api/v3/orders/count?_jsonp=ordersCount \
+    -u consumer_key:consumer_secret
+
+
+

Response:

+
+
\**\ordersCount({"count":8})
+
+
+

If the site administrator has chosen to disable it, you will receive a 400 Bad Request error:

+
+
{
+  "errors": [
+    {
+      "code": "woocommerce_api_jsonp_disabled",
+      "message": "JSONP support is disabled on this site"
+    }
+  ]
+}
+
+
+

If your callback contains invalid characters, you will receive a 400 Bad Request error:

+
+
{
+  "errors": [
+    {
+      "code": "woocommerce_api_jsonp_callback_invalid",
+      "message": "The JSONP callback function is invalid"
+    }
+  ]
+}
+

Webhooks

+

Webhooks can be managed via the WooCommerce settings screen or by using the REST API endpoints. The WC_Webhook class manages all data storage and retrieval of the custom post type, as well as enqueuing webhook actions and processing/delivering/logging the webhook. On woocommerce_init, active webhooks are loaded and their associated hooks are added.

+ +

Each webhook has:

+ +
    +
  • status: active (delivers payload), paused (delivery paused by admin), disabled (delivery paused by failure)
  • +
  • topic: determines which resource events the webhook is triggered for
  • +
  • delivery URL: URL where the payload is delivered, must be HTTP or HTTPS
  • +
  • secret: an optional secret key that is used to generate a HMAC-SHA256 hash of the request body so the receiver can verify authenticity of the webhook
  • +
  • hooks: an array of hook names that are added and bound to the webhook for processing
  • +
+

Topics

+

The topic is a combination resource (e.g. order) and event (e.g. created) and maps to one or more hook names (e.g. woocommerce_checkout_order_processed). Webhooks can be created using the topic name and the appropriate hooks are automatically added.

+ +

Core topics are:

+ +
    +
  • coupon.created, coupon.updated, coupon.deleted
  • +
  • customer.created, customer.updated, customer.deleted
  • +
  • order.created, order.updated, order.deleted
  • +
  • product.created, product.updated, product.deleted
  • +
+ +

Custom topics can also be used which map to a single hook name, for example you could add a webhook with topic action.woocommerce_add_to_cart that is triggered on that event. Custom topics pass the first hook argument to the payload, so in this example the cart_item_key would be included in the payload.

+

Delivery/Payload

+

Delivery is done using wp_remote_post() (HTTP POST) and processed in the background by default using wp-cron. A few custom headers are added to the request to help the receiver process the webhook:

+ +
    +
  • X-WC-Webhook-Topic - e.g. order.updated
  • +
  • X-WC-Webhook-Resource - e.g. order
  • +
  • X-WC-Webhook-Event - e.g. updated
  • +
  • X-WC-Webhook-Signature - a base64 encoded HMAC-SHA256 hash of the payload
  • +
  • X-WC-Webhook-ID - webhook's post ID
  • +
  • X-WC-Delivery-ID - delivery log ID (a comment)
  • +
+ +

The payload is JSON encoded and for API resources (coupons, customers, orders, products), the response is exactly the same as if requested via the REST API.

+

Logging

+

Requests/responses are logged as comments on the webhook custom post type. Each delivery log includes:

+ +
    +
  • Request duration
  • +
  • Request URL, method, headers, and body
  • +
  • Response Code, message, headers, and body
  • +
+ +

Only the 25 most recent delivery logs are kept in order to reduce comment table bloat.

+ +

After 5 consecutive failed deliveries (as defined by a non HTTP 2xx response code), the webhook is disabled and must be edited via the REST API to re-enable.

+ +

Delivery logs can be fetched through the REST API endpoint or in code using WC_Webhook::get_delivery_logs()

+

Endpoints

+

See the webhook resource section.

+

Visual Interface

+

You can find the Webhooks interface going to "WooCommerce" > "Settings" > "API" > "Webhooks", see our Visual Webhooks docs for more details.

+

Troubleshooting

+
    +
  • Nginx - Older configurations of Nginx can cause issues with the API, see this issue for details
  • +
  • ModSecurity - When activated may be blocking POST, PUT and DELETE requests, usually showing 501 Method Not Implemented error, see this issue for details
  • +
+

Official Libraries

+ +
// Install:
+// npm install --save woocommerce-api
+
+// Setup:
+var WooCommerceAPI = require('woocommerce-api');
+
+var WooCommerce = new WooCommerceAPI({
+  url: 'http://example.com', // Your store URL
+  consumerKey: 'consumer_key', // Your consumer key
+  consumerSecret: 'consumer_secret', // Your consumer secret
+  version: 'v3' // WooCommerce API version
+});
+
<?php 
+// Install:
+// composer require automattic/woocommerce
+
+// Setup:
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'http://example.com', // Your store URL
+    'consumer_key', // Your consumer key
+    'consumer_secret', // Your consumer secret
+    [
+        'version' => 'v3' // WooCommerce API version
+    ]
+);
+?>
+
# Install:
+# pip install woocommerce
+
+# Setup:
+from woocommerce import API
+
+wcapi = API(
+    url="http://example.com", # Your store URL
+    consumer_key="consumer_key", # Your consumer key
+    consumer_secret="consumer_secret", # Your consumer secret
+    version="v3" # WooCommerce API version
+)
+
# Install:
+# gem install woocommerce_api
+
+# Setup:
+require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "http://example.com", # Your store URL
+  "consumer_key", # Your consumer key
+  "consumer_secret", # Your consumer secret
+  {
+    version: "v3" # WooCommerce API version
+  }
+)
+
+ +

Tools

+ +

Index

+

The API index provides information about the endpoints available for the site, as well as store-specific information. No authentication is required to access the API index, however if the REST API is disabled, you will receive a 404 Not Found error.

+ +
+

404 Not Found response:

+
+
{
+  "errors" : [
+    {
+      "code" : "woocommerce_api_disabled",
+      "message" : "The WooCommerce API is disabled on this site"
+    }
+  ]
+}
+

Index Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringThe name of the site - get_option( 'blogname' )
descriptionstringThe site's description - get_option( 'blogdescription' )
URLstringThe site's URL - get_option( 'siteurl' )
wc_versionstringThe active WooCommerce version
versionstringREST API version
routesarrayA list of available endpoints for the site keyed by relative URL. Each endpoint specifies the HTTP methods supported as well as the canonical URL
metaarrayA list of WooCommerce settings used in the API. See Meta Properties
+ + +

Meta Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
timezonestringThe site's timezone
currencystringCurrency ISO Code, e.g. GBP
currency_formatstringCurrency symbol, HTML encoded, e.g. £
currency_positionstringCurrency position, available the following options: right, left, right_space and left_space
thousand_separatorstringThousands separator, e.g .
decimal_separatorstringDecimal separator, e.g ,
price_num_decimalsintegerNumber of decimals
tax_includedbooleanTrue if prices include tax, false otherwise
weight_unitstringThe unit set for product weights. Valid units are kg, g, lbs, oz
dimension_unitstringThe unit set for product dimensions. Valid units are cm, m, cm, mm, in, and yd
ssl_enabledbooleanTrue if SSL is enabled for the site, false otherwise
permalinks_enabledbooleanWhether pretty permalinks are enabled on the site, if this is false, the API will not function correctly
generate_passwordbooleanShows if the API is able to auto generate passwords for new customers
linksarrayAPI help links list
+

View Index List

+

Retrieve a set of store information.

+

HTTP Request

+
+
+ GET +
/wc-api/v3
+
+
+
curl https://example.com/wc-api/v3 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('')); ?>
+
print(wcapi.get("").json())
+
woocommerce.get("").parsed_response
+
+
+

JSON response example:

+
+
{
+  "store": {
+    "name": "WooCommerce Dev",
+    "description": "",
+    "URL": "http://example.com",
+    "wc_version": "2.5.0",
+    "version": "3.1.0",
+    "routes": {
+      "/": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/"
+        }
+      },
+      "/coupons": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/coupons"
+        },
+        "accepts_data": true
+      },
+      "/coupons/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/coupons/count"
+        }
+      },
+      "/coupons/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/coupons/code/<code>": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/coupons/bulk": {
+        "accepts_data": true,
+        "meta": {
+          "self": "http://example.com/wc-api/v3/coupons/bulk"
+        },
+        "supports": [
+          "POST",
+          "PUT",
+          "PATCH"
+        ]
+      },
+      "/customers": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/customers"
+        },
+        "accepts_data": true
+      },
+      "/customers/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/customers/count"
+        }
+      },
+      "/customers/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/customers/email/<email>": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/customers/<id>/orders": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/customers/<id>/downloads": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/customers/bulk": {
+        "accepts_data": true,
+        "meta": {
+          "self": "http://example.com/wc-api/v3/customers/bulk"
+        },
+        "supports": [
+          "POST",
+          "PUT",
+          "PATCH"
+        ]
+      },
+      "/orders": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/orders"
+        },
+        "accepts_data": true
+      },
+      "/orders/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/orders/count"
+        }
+      },
+      "/orders/statuses": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/orders/statuses"
+        }
+      },
+      "/orders/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/orders/<order_id>/notes": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "accepts_data": true
+      },
+      "/orders/<order_id>/notes/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/orders/<order_id>/refunds": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "accepts_data": true
+      },
+      "/orders/<order_id>/refunds/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/orders/bulk": {
+        "accepts_data": true,
+        "meta": {
+          "self": "http://example.com/wc-api/v3/orders/bulk"
+        },
+        "supports": [
+          "POST",
+          "PUT",
+          "PATCH"
+        ]
+      },
+      "/products": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products"
+        },
+        "accepts_data": true
+      },
+      "/products/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products/count"
+        }
+      },
+      "/products/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/products/<id>/reviews": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/products/<id>/orders": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/products/categories": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products/categories"
+        },
+        "accepts_data": true
+      },
+      "/products/categories/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/products/tags": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products/tags"
+        },
+        "accepts_data": true
+      },
+      "/products/tags/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/products/shipping_classes": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products/shipping_classes"
+        },
+        "accepts_data": true
+      },
+      "/products/shipping_classes/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/products/attributes": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products/attributes"
+        },
+        "accepts_data": true
+      },
+      "/products/attributes/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/products/attributes/<attribute_id>/terms": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "accepts_data": true
+      },
+      "/products/attributes/<attribute_id>/terms/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/products/bulk": {
+        "accepts_data": true,
+        "meta": {
+          "self": "http://example.com/wc-api/v3/products/bulk"
+        },
+        "supports": [
+          "POST",
+          "PUT",
+          "PATCH"
+        ]
+      },
+      "/reports": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/reports"
+        }
+      },
+      "/reports/sales": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/reports/sales"
+        }
+      },
+      "/reports/sales/top_sellers": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/reports/sales/top_sellers"
+        }
+      },
+      "/taxes": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/taxes"
+        },
+        "accepts_data": true
+      },
+      "/taxes/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/taxes/count"
+        }
+      },
+      "/taxes/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/taxes/classes": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/taxes/classes"
+        },
+        "accepts_data": true
+      },
+      "/taxes/classes/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/taxes/classes/count"
+        }
+      },
+      "/taxes/classes/<slug>": {
+        "supports": [
+          "DELETE"
+        ]
+      },
+      "/taxes/bulk": {
+        "accepts_data": true,
+        "meta": {
+          "self": "http://example.com/wc-api/v3/taxes/bulk"
+        },
+        "supports": [
+          "POST",
+          "PUT",
+          "PATCH"
+        ]
+      },
+      "/webhooks": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/webhooks"
+        },
+        "accepts_data": true
+      },
+      "/webhooks/count": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ],
+        "meta": {
+          "self": "http://example.com/wc-api/v3/webhooks/count"
+        }
+      },
+      "/webhooks/<id>": {
+        "supports": [
+          "HEAD",
+          "GET",
+          "POST",
+          "PUT",
+          "PATCH",
+          "DELETE"
+        ],
+        "accepts_data": true
+      },
+      "/webhooks/<webhook_id>/deliveries": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      },
+      "/webhooks/<webhook_id>/deliveries/<id>": {
+        "supports": [
+          "HEAD",
+          "GET"
+        ]
+      }
+    },
+    "meta": {
+      "timezone": "America/Los_Angeles",
+      "currency": "USD",
+      "currency_format": "&#36;",
+      "currency_position": "left",
+      "thousand_separator": ".",
+      "decimal_separator": ",",
+      "price_num_decimals": 2,
+      "tax_included": false,
+      "weight_unit": "lbs",
+      "dimension_unit": "in",
+      "ssl_enabled": false,
+      "permalinks_enabled": true,
+      "generate_password": false,
+      "links": {
+        "help": "http://woocommerce.github.io/woocommerce-rest-api-docs/"
+      }
+    }
+  }
+}
+

Coupons

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate coupons.

+

Coupon Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCoupon ID (post ID) read-only
codestringCoupon code, always lowercase mandatory
typestringCoupon type, valid core types are: fixed_cart, percent, fixed_product and percent_product. Default is fixed_cart
created_atstringUTC DateTime when the coupon was created read-only
updated_atstringUTC DateTime when the coupon was last updated read-only
amountstringThe amount of discount
individual_usebooleanWhether coupon can only be used individually
product_idsarrayArray of product ID's the coupon can be used on
exclude_product_idsarrayArray of product ID's the coupon cannot be used on
usage_limitintegerHow many times the coupon can be used
usage_limit_per_userintegerHow many times the coupon can be user per customer
limit_usage_to_x_itemsintegerMax number of items in the cart the coupon can be applied to
usage_countintegerNumber of times the coupon has been used already read-only
expiry_datestringUTC DateTime`when the coupon expires
enable_free_shippingbooleanIs the coupon for free shipping
product_category_idsarrayArray of category ID's the coupon applies to
exclude_product_category_idsarrayArray of category ID's the coupon does not apply to
exclude_sale_itemsbooleanExclude sale items from the coupon
minimum_amountstringMinimum order amount that needs to be in the cart before coupon applies
maximum_amountstringMaximum order amount allowed when using the coupon
customer_emailsarrayArray of email addresses that can use this coupon
descriptionstringCoupon description
+

Create a Coupon

+

This API helps you to create a new coupon.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/coupons
+
+
+
curl -X POST https://example.com/wc-api/v3/coupons \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "coupon": {
+    "code": "new-coupon",
+    "type": "percent",
+    "amount": 10,
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": "",
+    "usage_limit_per_user": "",
+    "limit_usage_to_x_items": "",
+    "expiry_date": "",
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}'
+
var data = {
+  coupon: {
+    code: 'new-coupon',
+    type: 'percent',
+    amount: 10,
+    individual_use: true,
+    product_ids: [],
+    exclude_product_ids: [],
+    usage_limit: '',
+    usage_limit_per_user: '',
+    limit_usage_to_x_items: '',
+    expiry_date: '',
+    enable_free_shipping: false,
+    product_category_ids: [],
+    exclude_product_category_ids: [],
+    exclude_sale_items: true,
+    minimum_amount: '100.00',
+    maximum_amount: '0.00',
+    customer_emails: [],
+    description: ''
+  }
+};
+
+WooCommerce.post('coupons', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'coupon' => [
+        'code' => 'new-coupon',
+        'type' => 'percent',
+        'amount' => 10,
+        'individual_use' => true,
+        'product_ids' => [],
+        'exclude_product_ids' => [],
+        'usage_limit' => '',
+        'usage_limit_per_user' => '',
+        'limit_usage_to_x_items' => '',
+        'expiry_date' => '',
+        'enable_free_shipping' => false,
+        'product_category_ids' => [],
+        'exclude_product_category_ids' => [],
+        'exclude_sale_items' => true,
+        'minimum_amount' => '100.00',
+        'maximum_amount' => '0.00',
+        'customer_emails' => [],
+        'description' => ''
+    ]
+];
+
+print_r($woocommerce->post('coupons', $data));
+?>
+
data = {
+    "coupon": {
+        "code": "new-coupon",
+        "type": "percent",
+        "amount": 10,
+        "individual_use": True,
+        "product_ids": [],
+        "exclude_product_ids": [],
+        "usage_limit": "",
+        "usage_limit_per_user": "",
+        "limit_usage_to_x_items": "",
+        "expiry_date": "",
+        "enable_free_shipping": False,
+        "product_category_ids": [],
+        "exclude_product_category_ids": [],
+        "exclude_sale_items": True,
+        "minimum_amount": "100.00",
+        "maximum_amount": "0.00",
+        "customer_emails": [],
+        "description": ""
+    }
+}
+
+print(wcapi.post("coupons", data).json())
+
data = {
+  coupon: {
+    code: "new-coupon",
+    type: "percent",
+    amount: 10,
+    individual_use: true,
+    product_ids: [],
+    exclude_product_ids: [],
+    usage_limit: "",
+    usage_limit_per_user: "",
+    limit_usage_to_x_items: "",
+    expiry_date: "",
+    enable_free_shipping: false,
+    product_category_ids: [],
+    exclude_product_category_ids: [],
+    exclude_sale_items: true,
+    minimum_amount: "100.00",
+    maximum_amount: "0.00",
+    customer_emails: [],
+    description: ""
+  }
+}
+
+woocommerce.post("coupons", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupon": {
+    "id": 529,
+    "code": "new-coupon",
+    "type": "percent",
+    "created_at": "2015-01-20T19:05:27Z",
+    "updated_at": "2015-01-20T19:05:27Z",
+    "amount": "10.00",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "usage_count": 0,
+    "expiry_date": null,
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}
+

View a Coupon

+

This API lets you retrieve and view a specific coupon by ID or code.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/coupons/<id>
+
+
+
curl https://example.com/wc-api/v3/coupons/529 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('coupons/529', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('coupons/529')); ?>
+
print(wcapi.get("coupons/529").json())
+
woocommerce.get("coupons/529").parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupon": {
+    "id": 529,
+    "code": "new-coupon",
+    "type": "percent",
+    "created_at": "2015-01-20T19:05:27Z",
+    "updated_at": "2015-01-20T19:05:27Z",
+    "amount": "10.00",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "usage_count": 0,
+    "expiry_date": null,
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}
+

View List of Coupons

+

This API helps you to view all the coupons.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/coupons
+
+
+
curl https://example.com/wc-api/v3/coupons \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('coupons', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('coupons')); ?>
+
print(wcapi.get("coupons").json())
+
woocommerce.get("coupons").parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupons": [
+    {
+      "id": 529,
+      "code": "new-coupon",
+      "type": "percent",
+      "created_at": "2015-01-20T19:05:27Z",
+      "updated_at": "2015-01-20T19:05:27Z",
+      "amount": "10.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": null,
+      "enable_free_shipping": false,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": ""
+    },
+    {
+      "id": 527,
+      "code": "free-shipping",
+      "type": "fixed_cart",
+      "created_at": "2015-01-20T18:35:59Z",
+      "updated_at": "2015-01-20T18:35:59Z",
+      "amount": "0.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": null,
+      "enable_free_shipping": true,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "50.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": ""
+    },
+    {
+      "id": 526,
+      "code": "christmas-promo",
+      "type": "percent",
+      "created_at": "2015-01-20T18:10:58Z",
+      "updated_at": "2015-01-20T18:10:58Z",
+      "amount": "10.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": 1,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": "2014-12-25T00:00:00Z",
+      "enable_free_shipping": false,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "200.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": "Discount for Christmas for orders over $ 200"
+    }
+  ]
+}
+

Update a Coupon

+

This API lets you make changes to a coupon.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/coupons/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/coupons/529 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "coupon": {
+    "amount": 5
+  }
+}'
+
var data = {
+  coupon: {
+    amount: 5
+  }
+};
+
+WooCommerce.put('coupons/529', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php 
+$data = [
+    'coupon' => [
+        'amount' => 5
+    ]
+];
+
+print_r($woocommerce->put('coupons/529', $data)); 
+?>
+
data = {
+    "coupon": {
+        "amount": 5
+    }
+}
+
+print(wcapi.put("coupons/529", data).json())
+
data = {
+  coupon: {
+    amount: 5
+  }
+}
+
+woocommerce.put("coupons/529", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupon": {
+    "id": 529,
+    "code": "new-coupon",
+    "type": "percent",
+    "created_at": "2015-01-20T19:05:27Z",
+    "updated_at": "2015-01-20T19:10:33Z",
+    "amount": "5.00",
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "usage_count": 0,
+    "expiry_date": null,
+    "enable_free_shipping": false,
+    "product_category_ids": [],
+    "exclude_product_category_ids": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "customer_emails": [],
+    "description": ""
+  }
+}
+

Create/Update Multiple Coupons

+

This API helps you to bulk create/update multiple coupons.

+ +

To update is necessary to send objects containing IDs and to create new not just send the ID.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/coupons/bulk
+
+
+
curl -X POST https://example.com/wc-api/v3/coupons/bulk \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "coupons": [
+    {
+      "id": 529,
+      "amount": "15.00"
+    },
+    {
+      "id": 527,
+      "minimum_amount": "55.00"
+    },
+    {
+      "id": 526,
+      "amount": "20.00"
+    }
+  ]
+}'
+
var data = {
+  coupons: [
+    {
+      id: 529,
+      amount: '15.00'
+    },
+    {
+      id: 527,
+      minimum_amount: '55.00'
+    },
+    {
+      id: 526,
+      amount: '20.00'
+    }
+  ]
+};
+
+WooCommerce.post('coupons/bulk', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php 
+$data = [
+    'coupons' => [
+        [
+            'id' => 529,
+            'amount' => '15.00'
+        ],
+        [
+            'id' => 527,
+            'minimum_amount' => '55.00'
+        ],
+        [
+            'id' => 526,
+            'amount': '20.00'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('coupons/bulk', $data)); 
+?>
+
data = {
+    "coupons": [
+        {
+            "id": 529,
+            "amount": "15.00"
+        },
+        {
+            "id": 527,
+            "minimum_amount": "55.00"
+        },
+        {
+            "id": 526,
+            "amount": "20.00"
+        }
+    ]
+}
+
+print(wcapi.post("coupons/bulk", data).json())
+
data = {
+  coupons: [
+    {
+      id: 529,
+      amount: "15.00"
+    },
+    {
+      id: 527,
+      minimum_amount: "55.00"
+    },
+    {
+      id: 526,
+      amount: "20.00"
+    }
+  ]
+}
+
+woocommerce.post("coupons/bulk", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "coupons": [
+    {
+      "id": 529,
+      "code": "new-coupon",
+      "type": "percent",
+      "created_at": "2015-01-20T19:05:27Z",
+      "updated_at": "2015-07-31T12:10:33Z",
+      "amount": "15.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": null,
+      "enable_free_shipping": false,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": ""
+    },
+    {
+      "id": 527,
+      "code": "free-shipping",
+      "type": "fixed_cart",
+      "created_at": "2015-01-20T18:35:59Z",
+      "updated_at": "2015-07-31T12:10:33Z",
+      "amount": "0.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": null,
+      "enable_free_shipping": true,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "55.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": ""
+    },
+    {
+      "id": 526,
+      "code": "christmas-promo",
+      "type": "percent",
+      "created_at": "2015-01-20T18:10:58Z",
+      "updated_at": "2015-07-31T12:10:33Z",
+      "amount": "20.00",
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": 1,
+      "limit_usage_to_x_items": 0,
+      "usage_count": 0,
+      "expiry_date": "2015-12-25T00:00:00Z",
+      "enable_free_shipping": false,
+      "product_category_ids": [],
+      "exclude_product_category_ids": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "200.00",
+      "maximum_amount": "0.00",
+      "customer_emails": [],
+      "description": "Discount for Christmas for orders over $ 200"
+    }
+  ]
+}
+

Delete a Coupon

+

This API helps you delete a coupon.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/coupons/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/coupons/529/?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('coupons/529/?force=true', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('coupons/529', ['force' => true])); ?>
+
print(wcapi.delete("coupons/529", params={"force": True}).json())
+
woocommerce.delete("coupons/529", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted coupon"
+}
+

Parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the coupon, defaults to false. Note that permanently deleting the coupon will return HTTP 200 rather than HTTP 202.
+

View Coupons Count

+

This API lets you retrieve a count of all coupons.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/coupons/count
+
+
+
curl https://example.com/wc-api/v3/coupons/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('coupons/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('coupons/count')); ?>
+
print(wcapi.get("coupons/count").json())
+
woocommerce.get("coupons/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 3
+}
+

Customers

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate customers.

+

Customers Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCustomer ID (user ID) read-only
created_atstringUTC DateTime when the customer was created read-only
emailstringCustomer email address mandatory
first_namestringCustomer first name
last_namestringCustomer last name
usernamestringCustomer username, can be generated automatically from the customer's email addrees if the option woocommerce_registration_generate_username is equal to yes cannot be changed
passwordstringCustomer password, can be generated automatically with wp_generate_password() if the "Automatically generate customer password" option is enabled, check the index meta for generate_password write-only
last_order_idintegerLast order ID read-only
last_order_datestringUTC DateTime of the customer last order read-only
orders_countintegerQuantity of orders that the customer have read-only
total_spentintegerTotal amount spent read-only
avatar_urlstringGravatar URL
billing_addressarrayList of Billing Address fields. See Billing Address Properties
shipping_addressarrayList of Shipping Address fields. See Shipping Address Properties
+

Billing Address Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name
last_namestringLast name
companystringCompany name
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name
statestringISO code or name of the state, province or district
postcodestringPostal code
countrystringISO code of the country
emailstringEmail address
phonestringPhone
+

Shipping Address Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name
last_namestringLast name
companystringCompany name
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name
statestringISO code or name of the state, province or district
postcodestringPostal code
countrystringISO code of the country
+

Create a Customer

+

This API helps you to create a new customer.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/customers
+
+
+
curl -X POST https://example.com/wc-api/v3/customers \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "customer": {
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}'
+
var data = {
+  customer: {
+    email: 'john.doe@example.com',
+    first_name: 'John',
+    last_name: 'Doe',
+    username: 'john.doe',
+    billing_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      company: '',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US',
+      email: 'john.doe@example.com',
+      phone: '(555) 555-5555'
+    },
+    shipping_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      company: '',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US'
+    }
+  }
+};
+
+WooCommerce.post('customers', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'customer' => [
+        'email' => 'john.doe@example.com',
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'username' => 'john.doe',
+        'billing_address' => [
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'company' => '',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US',
+            'email' => 'john.doe@example.com',
+            'phone' => '(555) 555-5555'
+        ],
+        'shipping_address' => [
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'company' => '',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('customers', $data));
+?>
+
data = {
+    "customer": {
+        "email": "john.doe@example.com",
+        "first_name": "John",
+        "last_name": "Doe",
+        "username": "john.doe",
+        "billing_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "company": "",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US",
+            "email": "john.doe@example.com",
+            "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "company": "",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US"
+        }
+    }
+}
+
+print(wcapi.post("customers", data).json())
+
data = {
+  customer: {
+    email: "john.doe@example.com",
+    first_name: "John",
+    last_name: "Doe",
+    username: "john.doe",
+    billing_address: {
+      first_name: "John",
+      last_name: "Doe",
+      company: "",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US",
+      email: "john.doe@example.com",
+      phone: "(555) 555-5555"
+    },
+    shipping_address: {
+      first_name: "John",
+      last_name: "Doe",
+      company: "",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US"
+    }
+  }
+}
+
+woocommerce.post("customers", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "customer": {
+    "id": 2,
+    "created_at": "2015-01-05T18:34:19Z",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order_id": null,
+    "last_order_date": null,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}
+

View a Customer

+

This API lets you retrieve and view a specific customer by ID or email.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/customers/<id>
+
+
+ +
+
+ GET +
/wc-api/v3/customers/email/<email>
+
+
+
curl https://example.com/wc-api/v3/customers/2 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/2', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('customers/2')); ?>
+
print(wcapi.get("customers/2").json())
+
woocommerce.get("customers/2").parsed_response
+
+
+

JSON response example:

+
+
{
+  "customer": {
+    "id": 2,
+    "created_at": "2015-01-05T18:34:19Z",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order_id": null,
+    "last_order_date": null,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}
+

View List of Customers

+

This API helps you to view all the customers.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/customers
+
+
+
curl https://example.com/wc-api/v3/customers \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('customers')); ?>
+
print(wcapi.get("customers").json())
+
woocommerce.get("customers").parsed_response
+
+
+

JSON response example:

+
+
{
+  "customers": [
+    {
+      "id": 2,
+      "created_at": "2015-01-05T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe",
+      "last_order_id": 123,
+      "last_order_date": "2015-01-14T16:47:30Z",
+      "orders_count": 10,
+      "total_spent": "1034.58",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "id": 3,
+      "created_at": "2015-01-10T14:25:39Z",
+      "email": "joao.silva@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva",
+      "last_order_id": 120,
+      "last_order_date": "2015-01-10T14:26:30Z",
+      "orders_count": 1,
+      "total_spent": "429.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
rolestringCustomers by status. eg: customer or subscriber
+

Update a Customer

+

This API lets you make changes to a customer.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/customers/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/customers/2 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "customer": {
+    "first_name": "James",
+    "billing_address": {
+      "first_name": "James"
+    },
+    "shipping_address": {
+      "first_name": "James"
+    }
+  }
+}'
+
var data = {
+  customer: {
+    first_name: 'James',
+    billing_address: {
+      first_name: 'James'
+    },
+    shipping_address: {
+      first_name: 'James'
+    }
+  }
+};
+
+WooCommerce.put('customers/2', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php 
+$data = [
+    'customer' => [
+        'first_name' => 'James',
+        'billing_address' => [
+            'first_name' => 'James'
+        ],
+        'shipping_address' => [
+            'first_name' => 'James'
+        ]
+    ]
+];
+
+print_r($woocommerce->put('customers/2', $data));
+?>
+
data = {
+    "customer": {
+        "first_name": "James",
+        "billing_address": {
+            "first_name": "James"
+        },
+        "shipping_address": {
+            "first_name": "James"
+        }
+    }
+}
+
+print(wcapi.put("customers/2", data).json())
+
data = {
+  customer: {
+    first_name: "James",
+    billing_address: {
+      first_name: "James"
+    },
+    shipping_address: {
+      first_name: "James"
+    }
+  }
+}
+
+woocommerce.put("customers/2", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "customer": {
+    "id": 2,
+    "created_at": "2015-01-05T18:34:19Z",
+    "email": "john.doe@example.com",
+    "first_name": "James",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order_id": null,
+    "last_order_date": null,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    }
+  }
+}
+

Create/Update Multiple Customers

+

This API helps you to bulk create/update multiple customers.

+ +

To update is necessary to send objects containing IDs and to create new not just send the ID.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/customers/bulk
+
+
+
curl -X POST https://example.com/wc-api/v3/customers/bulk \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "customers": [
+    {
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe2",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva2",
+      "billing_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ]
+}'
+
var data = {
+  customers: [
+    {
+      email: 'john.doe2@example.com',
+      first_name: 'John',
+      last_name: 'Doe',
+      username: 'john.doe2',
+      billing_address: {
+        first_name: 'John',
+        last_name: 'Doe',
+        company: '',
+        address_1: '969 Market',
+        address_2: '',
+        city: 'San Francisco',
+        state: 'CA',
+        postcode: '94103',
+        country: 'US',
+        email: 'john.doe@example.com',
+        phone: '(555) 555-5555'
+      },
+      shipping_address: {
+        first_name: 'John',
+        last_name: 'Doe',
+        company: '',
+        address_1: '969 Market',
+        address_2: '',
+        city: 'San Francisco',
+        state: 'CA',
+        postcode: '94103',
+        country: 'US'
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing_address: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping_address: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ]
+};
+
+WooCommerce.post('customers/bulk', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php 
+$data = [
+    'customers': [
+        [
+            'email': 'john.doe2@example.com',
+            'first_name': 'John',
+            'last_name': 'Doe',
+            'username': 'john.doe2',
+            'billing_address': [
+                'first_name': 'John',
+                'last_name': 'Doe',
+                'company': '',
+                'address_1': '969 Market',
+                'address_2': '',
+                'city': 'San Francisco',
+                'state': 'CA',
+                'postcode': '94103',
+                'country': 'US',
+                'email': 'john.doe@example.com',
+                'phone': '(555) 555-5555'
+            ],
+            'shipping_address': [
+                'first_name': 'John',
+                'last_name': 'Doe',
+                'company': '',
+                'address_1': '969 Market',
+                'address_2': '',
+                'city': 'San Francisco',
+                'state': 'CA',
+                'postcode': '94103',
+                'country': 'US'
+            ]
+        ],
+        [
+            'email': 'joao.silva2@example.com',
+            'first_name': 'João',
+            'last_name': 'Silva',
+            'username': 'joao.silva2',
+            'billing_address': [
+                'first_name': 'João',
+                'last_name': 'Silva',
+                'company': '',
+                'address_1': 'Av. Brasil, 432',
+                'address_2': '',
+                'city': 'Rio de Janeiro',
+                'state': 'RJ',
+                'postcode': '12345-000',
+                'country': 'BR',
+                'email': 'joao.silva@example.com',
+                'phone': '(55) 5555-5555'
+            ],
+            'shipping_address': [
+                'first_name': 'João',
+                'last_name': 'Silva',
+                'company': '',
+                'address_1': 'Av. Brasil, 432',
+                'address_2': '',
+                'city': 'Rio de Janeiro',
+                'state': 'RJ',
+                'postcode': '12345-000',
+                'country': 'BR'
+            ]
+        ]
+    ]
+];
+
+print_r($woocommerce->post('customers/bulk', $data));
+?>
+
data = {
+    "customers": [
+        {
+            "email": "john.doe2@example.com",
+            "first_name": "John",
+            "last_name": "Doe",
+            "username": "john.doe2",
+            "billing_address": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping_address": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            }
+        },
+        {
+            "email": "joao.silva2@example.com",
+            "first_name": "João",
+            "last_name": "Silva",
+            "username": "joao.silva2",
+            "billing_address": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR",
+                "email": "joao.silva@example.com",
+                "phone": "(55) 5555-5555"
+            },
+            "shipping_address": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR"
+            }
+        }
+    ]
+}
+
+print(wcapi.post("customers/bulk", data).json())
+
data = {
+  customers: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing_address: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping_address: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing_address: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping_address: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ]
+}
+
+woocommerce.post("customers/bulk", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "customers": [
+    {
+      "id": 4,
+      "created_at": "2015-07-31T14:20:46Z",
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe2",
+      "last_order_id": null,
+      "last_order_date": null,
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "id": 5,
+      "created_at": "2015-07-31T14:20:46Z",
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva2",
+      "last_order_id": null,
+      "last_order_date": null,
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping_address": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ]
+}
+

Delete a Customer

+

This API helps you delete a customer.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/customers/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/customers/2 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('customers/2', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('customers/2')); ?>
+
print(wcapi.delete("customers/2").json())
+
woocommerce.delete("customers/2").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted customer"
+}
+

View Customer Orders

+

This API lets you retrieve the customers orders.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/customers/<id>/orders
+
+
+
curl https://example.com/wc-api/v3/customers/2/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/2/orders', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('customers/2/orders')); ?>
+
print(wcapi.get("customers/2/orders").json())
+
woocommerce.get("customers/2/orders").parsed_response
+
+
+

JSON response example:

+
+
{
+  "orders": [
+    {
+      "id": 531,
+      "order_number": 531,
+      "created_at": "2015-01-21T12:02:13Z",
+      "updated_at": "2015-01-21T12:02:13Z",
+      "completed_at": "2015-01-21T12:02:13Z",
+      "status": "on-hold",
+      "currency": "USD",
+      "total": "30.00",
+      "subtotal": "20.00",
+      "total_line_items_quantity": 1,
+      "total_tax": "0.00",
+      "total_shipping": "10.00",
+      "cart_tax": "0.00",
+      "shipping_tax": "0.00",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": false
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/531",
+      "line_items": [
+        {
+          "id": 417,
+          "subtotal": "20.00",
+          "subtotal_tax": "0.00",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "price": "20.00",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Premium Quality",
+          "product_id": 19,
+          "sku": "",
+          "meta": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 418,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "531",
+        "last_order_date": "2015-01-21T12:02:13Z",
+        "orders_count": 1,
+        "total_spent": "0.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    }
+  ]
+}
+
+ +

View Customer Downloads

+

This API lets you retrieve the customers downloads.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/customers/<id>/downloads
+
+
+
curl https://example.com/wc-api/v3/customers/2/downloads \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/2/downloads', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('customers/2/downloads')); ?>
+
print(wcapi.get("customers/2/downloads").json())
+
woocommerce.get("customers/2/downloads").parsed_response
+
+
+

JSON response example:

+
+
{
+  "downloads": [
+    {
+      "download_url": "https://example.com/?download_file=96&order=wc_order_9999999999999&email=john.doe@example.com&key=99999999999999999999999999999999",
+      "download_id": "99999999999999999999999999999999",
+      "product_id": 96,
+      "download_name": "Woo Album #4 &ndash; Woo Album",
+      "order_id": 532,
+      "order_key": "wc_order_9999999999999",
+      "downloads_remaining": "5",
+      "access_expires": null,
+      "file": {
+        "name": "Woo Album",
+        "file": "http://example.com/wp-content/uploads/woocommerce_uploads/2015/01/album.zip"
+      }
+    }
+  ]
+}
+

Customer Downloads Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
download_urlstringDownload file URL
download_idstringDownload ID
product_idintegerDownloadable product ID
download_namestringDownloadable file name
order_idintegerOrder ID
order_keystringOrder Key
downloads_remainingstringAmount of downloads remaining. An empty string means that is "Unlimited"
access_expiresstringUTC DateTime when the download access expires. null means "Never"
filearrayList for downloadable files, each one have a name (file name) and file (file URL) attribute
+

View Customers Count

+

This API lets you retrieve a count of all customers.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/customers/count
+
+
+
curl https://example.com/wc-api/v3/customers/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('customers/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('customers/count')); ?>
+
print(wcapi.get("customers/count").json())
+
woocommerce.get("customers/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 10
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
rolestringCustomers by status. eg: customer or subscriber
+

Orders

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate orders.

+

Orders Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerOrder ID (post ID) read-only
order_numberintegerOrder number read-only
created_atstringUTC DateTime when the order was created read-only
updated_atstringUTC DateTime when the order was last updated read-only
completed_atstringUTC DateTime when the order was last completed read-only
statusstringOrder status. By default are available the status: pending, processing, on-hold, completed, cancelled, refunded and failed. See View List of Order Statuses
currencystringCurrency in ISO format, e.g USD
totalstringOrder total read-only
subtotalstringOrder subtotal read-only
total_line_items_quantityintegerTotal of order items read-only
total_taxstringOrder tax total read-only
total_shippingstringOrder shipping total read-only
cart_taxstringOrder cart tax read-only
shipping_taxstringOrder shipping tax read-only
total_discountstringOrder total discount read-only
shipping_methodsstringText list of the shipping methods used in the order read-only
payment_detailsarrayList of payment details. See Payment Details Properties
billing_addressarrayList of customer billing address. See Customer Billing Address Properties
shipping_addressarrayList of customer shipping address. See Customer Shipping Address Properties
notestringCustomer order notes
customer_ipstringCustomer IP address read-only
customer_user_agentstringCustomer User-Agent read-only
customer_idintegerCustomer ID (user ID) required
view_order_urlstringURL to view the order in frontend read-only
line_itemsarrayList of order line items. See Line Items Properties
shipping_linesarrayList of shipping line items. See Shipping Lines Properties
tax_linesarrayList of tax line items. See Tax Lines Properties read-only
fee_linesarrayList of fee line items. See Fee Lines Properites
coupon_linesarrayList of cupon line items. See Coupon Lines Properties
customerarrayCustomer data. See Customer Properties
+

Payment Details Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
method_idstringPayment method ID required
method_titlestringPayment method title required
paidbooleanShows/define if the order is paid using this payment method. Use true to complate the payment.
transaction_idstringTransaction ID, an optional field to set the transacion ID when complate one payment (to set this you need set the paid as true too)
+

Line Items Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerLine item ID read-only
subtotalstringLine item subtotal
subtotal_taxstringLine item tax subtotal
totalstringLine item total
total_taxstringLine item tax total
pricestringProduct price read-only
quantityintegerQuantity
tax_classstringProduct tax class read-only
namestringProduct name read-only
product_idintegerProduct ID required
skustringProduct SKU read-only
metaarrayList of product meta items. See Products Meta Items Properties
variationsarrayList of product variation attributes. e.g: "variation": {"pa_color": "Black", "pa_size": "XGG"} (Use pa_ prefix when is a product attribute) write-only
+

Products Meta Items Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
keystringMeta item key
labelstringMeta item label
valuestringMeta item value
+

Shipping Lines Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerShipping line ID read-only
method_idstringShipping method ID required
method_titlestringShipping method title required
totalstringTotal amount
+

Tax Lines Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTax rate line ID read-only
rate_idintegerTax rate ID read-only
codestringTax rate code read-only
titlestringTax rate title/name read-only
totalstringTax rate total read-only
compoundbooleanShows if is or not a compound rate. Compound tax rates are applied on top of other tax rates. read-only
+

Fee Lines Properites

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerFee line ID read-only
titlestringShipping method title required
taxablebooleanShows/define if the fee is taxable write-only
tax_classstringTax class, requered in write-mode if the fee is taxable
totalstringTotal amount
total_taxstringTax total
+

Coupon Lines Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCoupon line ID read-only
codestringCoupon code required
amountstringTotal amount required
+

Create an Order

+

This API helps you to create a new order.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/orders
+
+
+ +
+

Example of create a paid order:

+
+
curl -X POST https://example.com/wc-api/v3/orders \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order": {
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "customer_id": 2,
+    "line_items": [
+      {
+        "product_id": 546,
+        "quantity": 2
+      },
+      {
+        "product_id": 613,
+        "quantity": 1,
+        "variations": {
+          "pa_color": "Black"
+        }
+      }
+    ],
+    "shipping_lines": [
+      {
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ]
+  }
+}'
+
var data = {
+  order: {
+    payment_details: {
+      method_id: 'bacs',
+      method_title: 'Direct Bank Transfer',
+      paid: true
+    },
+    billing_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US',
+      email: 'john.doe@example.com',
+      phone: '(555) 555-5555'
+    },
+    shipping_address: {
+      first_name: 'John',
+      last_name: 'Doe',
+      address_1: '969 Market',
+      address_2: '',
+      city: 'San Francisco',
+      state: 'CA',
+      postcode: '94103',
+      country: 'US'
+    },
+    customer_id: 2,
+    line_items: [
+      {
+        product_id: 546,
+        quantity: 2
+      },
+      {
+        product_id: 613,
+        quantity: 1,
+        variations: {
+          pa_color: 'Black'
+        }
+      }
+    ],
+    shipping_lines: [
+      {
+        method_id: 'flat_rate',
+        method_title: 'Flat Rate',
+        total: '10.00'
+      }
+    ]
+  }
+};
+
+WooCommerce.post('orders', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'order' => [
+        'payment_details' => [
+            'method_id' => 'bacs',
+            'method_title' => 'Direct Bank Transfer',
+            'paid' => true
+        ],
+        'billing_address' => [
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US',
+            'email' => 'john.doe@example.com',
+            'phone' => '(555) 555-5555'
+        ],
+        'shipping_address' => [
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'address_1' => '969 Market',
+            'address_2' => '',
+            'city' => 'San Francisco',
+            'state' => 'CA',
+            'postcode' => '94103',
+            'country' => 'US'
+        ],
+        'customer_id' => 2,
+        'line_items' => [
+            [
+                'product_id' => 546,
+                'quantity' => 2
+            ],
+            [
+                'product_id' => 613,
+                'quantity' => 1,
+                'variations' => [
+                    'pa_color' => 'Black'
+                ]
+            ]
+        ],
+        'shipping_lines' => [
+            [
+                'method_id' => 'flat_rate',
+                'method_title' => 'Flat Rate',
+                'total' => '10.00'
+            ]
+        ]
+    ]
+];
+
+print_r($woocommerce->post('orders', $data));
+?>
+
data = {
+    "order": {
+        "payment_details": {
+            "method_id": "bacs",
+            "method_title": "Direct Bank Transfer",
+            "paid": True
+        },
+        "billing_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US",
+            "email": "john.doe@example.com",
+            "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+            "first_name": "John",
+            "last_name": "Doe",
+            "address_1": "969 Market",
+            "address_2": "",
+            "city": "San Francisco",
+            "state": "CA",
+            "postcode": "94103",
+            "country": "US"
+        },
+        "customer_id": 2,
+        "line_items": [
+            {
+                "product_id": 546,
+                "quantity": 2
+            },
+            {
+                "product_id": 613,
+                "quantity": 1,
+                "variations": {
+                    "pa_color": "Black"
+                }
+            }
+        ],
+        "shipping_lines": [
+            {
+                "method_id": "flat_rate",
+                "method_title": "Flat Rate",
+                "total": "10.00"
+            }
+        ]
+    }
+}
+
+print(wcapi.post("orders", data).json())
+
data = {
+  order: {
+    payment_details: {
+      method_id: "bacs",
+      method_title: "Direct Bank Transfer",
+      paid: true
+    },
+    billing_address: {
+      first_name: "John",
+      last_name: "Doe",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US",
+      email: "john.doe@example.com",
+      phone: "(555) 555-5555"
+    },
+    shipping_address: {
+      first_name: "John",
+      last_name: "Doe",
+      address_1: "969 Market",
+      address_2: "",
+      city: "San Francisco",
+      state: "CA",
+      postcode: "94103",
+      country: "US"
+    },
+    customer_id: 2,
+    line_items: [
+        {
+          product_id: 546,
+          quantity: 2
+        },
+        {
+          product_id: 613,
+          quantity: 1,
+          variations: {
+            pa_color: "Black"
+          }
+        }
+    ],
+    shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: '10.00'
+        }
+    ]
+  }
+}
+
+woocommerce.post("orders", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order": {
+    "id": 645,
+    "order_number": 645,
+    "created_at": "2015-01-26T20:00:21Z",
+    "updated_at": "2015-01-26T20:00:21Z",
+    "completed_at": "2015-01-26T20:00:21Z",
+    "status": "processing",
+    "currency": "USD",
+    "total": "79.87",
+    "subtotal": "63.97",
+    "total_line_items_quantity": 3,
+    "total_tax": "5.90",
+    "total_shipping": "10.00",
+    "cart_tax": "5.40",
+    "shipping_tax": "0.50",
+    "total_discount": "0.00",
+    "shipping_methods": "Flat Rate",
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "note": "",
+    "customer_ip": "127.0.0.1",
+    "customer_user_agent": "WordPress/4.1; http://example.com",
+    "customer_id": 2,
+    "view_order_url": "https://example.com/my-account/view-order/645",
+    "line_items": [
+      {
+        "id": 504,
+        "subtotal": "43.98",
+        "subtotal_tax": "4.40",
+        "total": "43.98",
+        "total_tax": "4.40",
+        "price": "21.99",
+        "quantity": 2,
+        "tax_class": "reduced-rate",
+        "name": "Premium Quality",
+        "product_id": 546,
+        "sku": "",
+        "meta": []
+      },
+      {
+        "id": 505,
+        "subtotal": "19.99",
+        "subtotal_tax": "1.00",
+        "total": "19.99",
+        "total_tax": "1.00",
+        "price": "19.99",
+        "quantity": 1,
+        "tax_class": null,
+        "name": "Ship Your Idea",
+        "product_id": 613,
+        "sku": "",
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 506,
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 507,
+        "rate_id": "5",
+        "code": "US-CA-TAX-1",
+        "title": "Tax",
+        "total": "4.40",
+        "compound": false
+      },
+      {
+        "id": 508,
+        "rate_id": "4",
+        "code": "US-STANDARD-1",
+        "title": "Standard",
+        "total": "1.50",
+        "compound": false
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "customer": {
+      "id": 2,
+      "created_at": "2014-11-19T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "",
+      "last_name": "",
+      "username": "john.doe",
+      "last_order_id": "645",
+      "last_order_date": "2015-01-26T20:00:21Z",
+      "orders_count": 2,
+      "total_spent": "19.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    }
+  }
+}
+

View an Order

+

This API lets you retrieve and view a specific order.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/<id>
+
+
+
curl https://example.com/wc-api/v3/orders/645 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/645')); ?>
+
print(wcapi.get("orders/645").json())
+
woocommerce.get("orders/645").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order": {
+    "id": 645,
+    "order_number": 645,
+    "created_at": "2015-01-26T20:00:21Z",
+    "updated_at": "2015-01-26T20:00:21Z",
+    "completed_at": "2015-01-26T20:00:21Z",
+    "status": "processing",
+    "currency": "USD",
+    "total": "79.87",
+    "subtotal": "63.97",
+    "total_line_items_quantity": 3,
+    "total_tax": "5.90",
+    "total_shipping": "10.00",
+    "cart_tax": "5.40",
+    "shipping_tax": "0.50",
+    "total_discount": "0.00",
+    "shipping_methods": "Flat Rate",
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "note": "",
+    "customer_ip": "127.0.0.1",
+    "customer_user_agent": "WordPress/4.1; http://example.com",
+    "customer_id": 2,
+    "view_order_url": "https://example.com/my-account/view-order/645",
+    "line_items": [
+      {
+        "id": 504,
+        "subtotal": "43.98",
+        "subtotal_tax": "4.40",
+        "total": "43.98",
+        "total_tax": "4.40",
+        "price": "21.99",
+        "quantity": 2,
+        "tax_class": "reduced-rate",
+        "name": "Premium Quality",
+        "product_id": 546,
+        "sku": "",
+        "meta": []
+      },
+      {
+        "id": 505,
+        "subtotal": "19.99",
+        "subtotal_tax": "1.00",
+        "total": "19.99",
+        "total_tax": "1.00",
+        "price": "19.99",
+        "quantity": 1,
+        "tax_class": null,
+        "name": "Ship Your Idea",
+        "product_id": 613,
+        "sku": "",
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 506,
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 507,
+        "rate_id": "5",
+        "code": "US-CA-TAX-1",
+        "title": "Tax",
+        "total": "4.40",
+        "compound": false
+      },
+      {
+        "id": 508,
+        "rate_id": "4",
+        "code": "US-STANDARD-1",
+        "title": "Standard",
+        "total": "1.50",
+        "compound": false
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "customer": {
+      "id": 2,
+      "created_at": "2014-11-19T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "",
+      "last_name": "",
+      "username": "john.doe",
+      "last_order_id": "645",
+      "last_order_date": "2015-01-26T20:00:21Z",
+      "orders_count": 2,
+      "total_spent": "19.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    }
+  }
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
expandstringExpand coupons, products and taxes objects, eg: filter[expand]=coupons,products,taxes
+ + +

View List of Orders

+

This API helps you to view all the orders.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders
+
+
+
curl https://example.com/wc-api/v3/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders')); ?>
+
print(wcapi.get("orders").json())
+
woocommerce.get("orders").parsed_response
+
+
+

JSON response example:

+
+
{
+  "orders": [
+    {
+      "id": 645,
+      "order_number": 645,
+      "created_at": "2015-01-26T20:00:21Z",
+      "updated_at": "2015-01-26T20:00:21Z",
+      "completed_at": "2015-01-26T20:00:21Z",
+      "status": "processing",
+      "currency": "USD",
+      "total": "79.87",
+      "subtotal": "63.97",
+      "total_line_items_quantity": 3,
+      "total_tax": "5.90",
+      "total_shipping": "10.00",
+      "cart_tax": "5.40",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": true
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "WordPress/4.1; http://example.com",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/645",
+      "line_items": [
+        {
+          "id": 504,
+          "subtotal": "43.98",
+          "subtotal_tax": "4.40",
+          "total": "43.98",
+          "total_tax": "4.40",
+          "price": "21.99",
+          "quantity": 2,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 505,
+          "subtotal": "19.99",
+          "subtotal_tax": "1.00",
+          "total": "19.99",
+          "total_tax": "1.00",
+          "price": "19.99",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Ship Your Idea",
+          "product_id": 613,
+          "sku": "",
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 506,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 507,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 508,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    },
+    {
+      "id": 644,
+      "order_number": 644,
+      "created_at": "2015-01-26T19:33:42Z",
+      "updated_at": "2015-01-26T19:33:42Z",
+      "completed_at": "2015-01-26T19:33:42Z",
+      "status": "on-hold",
+      "currency": "USD",
+      "total": "44.14",
+      "subtotal": "30.99",
+      "total_line_items_quantity": 2,
+      "total_tax": "3.15",
+      "total_shipping": "10.00",
+      "cart_tax": "2.65",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": false
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/644",
+      "line_items": [
+        {
+          "id": 499,
+          "subtotal": "21.99",
+          "subtotal_tax": "2.20",
+          "total": "21.99",
+          "total_tax": "2.20",
+          "price": "21.99",
+          "quantity": 1,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 500,
+          "subtotal": "9.00",
+          "subtotal_tax": "0.45",
+          "total": "9.00",
+          "total_tax": "0.45",
+          "price": "9.00",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Woo Album #4",
+          "product_id": 96,
+          "sku": "",
+          "meta": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 501,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 502,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 503,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + + + + + + +
FilterTypeDescription
statusstringOrders by status. eg: processing or cancelled
expandstringExpand coupons, products and taxes objects, eg: filter[expand]=coupons,products,taxes
+ + +

Update an Order

+

This API lets you make changes to an order.

+ +

To remove a fee item, send the id of the item and name set to null.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/orders/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/orders/645 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order": {
+    "status": "completed"
+  }
+}'
+
var data = {
+  order: {
+    status: 'completed'
+  }
+};
+
+WooCommerce.put('orders/645', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'order' => [
+        'status' => 'completed'
+    ]
+];
+
+print_r($woocommerce->put('orders/645', $data));
+?>
+
data = {
+    "order": {
+        "status": "completed"
+    }
+}
+
+print(wcapi.put("orders/645", data).json())
+
data = {
+  order: {
+    status: "completed"
+  }
+}
+
+woocommerce.put("orders/645", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order": {
+    "id": 645,
+    "order_number": 645,
+    "created_at": "2015-01-26T20:00:21Z",
+    "updated_at": "2015-01-26T20:00:21Z",
+    "completed_at": "2015-01-26T20:00:21Z",
+    "status": "completed",
+    "currency": "USD",
+    "total": "79.87",
+    "subtotal": "63.97",
+    "total_line_items_quantity": 3,
+    "total_tax": "5.90",
+    "total_shipping": "10.00",
+    "cart_tax": "5.40",
+    "shipping_tax": "0.50",
+    "total_discount": "0.00",
+    "shipping_methods": "Flat Rate",
+    "payment_details": {
+      "method_id": "bacs",
+      "method_title": "Direct Bank Transfer",
+      "paid": true
+    },
+    "billing_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping_address": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "note": "",
+    "customer_ip": "127.0.0.1",
+    "customer_user_agent": "WordPress/4.1; http://example.com",
+    "customer_id": 2,
+    "view_order_url": "https://example.com/my-account/view-order/645",
+    "line_items": [
+      {
+        "id": 504,
+        "subtotal": "43.98",
+        "subtotal_tax": "4.40",
+        "total": "43.98",
+        "total_tax": "4.40",
+        "price": "21.99",
+        "quantity": 2,
+        "tax_class": "reduced-rate",
+        "name": "Premium Quality",
+        "product_id": 546,
+        "sku": "",
+        "meta": []
+      },
+      {
+        "id": 505,
+        "subtotal": "19.99",
+        "subtotal_tax": "1.00",
+        "total": "19.99",
+        "total_tax": "1.00",
+        "price": "19.99",
+        "quantity": 1,
+        "tax_class": null,
+        "name": "Ship Your Idea",
+        "product_id": 613,
+        "sku": "",
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 506,
+        "method_id": "flat_rate",
+        "method_title": "Flat Rate",
+        "total": "10.00"
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 507,
+        "rate_id": "5",
+        "code": "US-CA-TAX-1",
+        "title": "Tax",
+        "total": "4.40",
+        "compound": false
+      },
+      {
+        "id": 508,
+        "rate_id": "4",
+        "code": "US-STANDARD-1",
+        "title": "Standard",
+        "total": "1.50",
+        "compound": false
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "customer": {
+      "id": 2,
+      "created_at": "2014-11-19T18:34:19Z",
+      "email": "john.doe@example.com",
+      "first_name": "",
+      "last_name": "",
+      "username": "john.doe",
+      "last_order_id": "645",
+      "last_order_date": "2015-01-26T20:00:21Z",
+      "orders_count": 2,
+      "total_spent": "19.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    }
+  }
+}
+

Create/Update Multiple Orders

+

This API helps you to bulk create/update multiple orders.

+ +

To update is necessary to send objects containing IDs and to create new not just send the ID.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/orders/bulk
+
+
+
curl -X POST https://example.com/wc-api/v3/orders/bulk \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "orders": [
+    {
+      "id": 645,
+      "shipping_methods": "Local Delivery"
+    },
+    {
+      "id": 644,
+      "shipping_methods": "Local Delivery"
+    }
+  ]
+}'
+
var data = {
+  orders: [
+    {
+      id: 645,
+      shipping_methods: 'Local Delivery'
+    },
+    {
+      id: 644,
+      shipping_methods: 'Local Delivery'
+    }
+  ]
+};
+
+WooCommerce.post('orders/bulk', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'orders' => [
+        [
+            'id' => 645,
+            'shipping_methods' => 'Local Delivery'
+        ],
+        [
+            'id' => 644,
+            'shipping_methods' => 'Local Delivery'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('orders/bulk', $data));
+?>
+
data = {
+    "orders": [
+        {
+            "id": 645,
+            "shipping_methods": "Local Delivery"
+        },
+        {
+            "id": 644,
+            "shipping_methods": "Local Delivery"
+        }
+    ]
+}
+
+print(wcapi.post("orders/bulk", data).json())
+
data = {
+  orders: [
+    {
+      id: 645,
+      shipping_methods: "Local Delivery"
+    },
+    {
+      id: 644,
+      shipping_methods: "Local Delivery"
+    }
+  ]
+}
+
+woocommerce.post("orders/bulk", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "orders": [
+    {
+      "id": 645,
+      "order_number": 645,
+      "created_at": "2015-01-26T20:00:21Z",
+      "updated_at": "2015-07-31T11:45:12Z",
+      "completed_at": "2015-01-26T20:00:21Z",
+      "status": "processing",
+      "currency": "USD",
+      "total": "79.87",
+      "subtotal": "63.97",
+      "total_line_items_quantity": 3,
+      "total_tax": "5.90",
+      "total_shipping": "10.00",
+      "cart_tax": "5.40",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Local Delivery",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": true
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "WordPress/4.1; http://example.com",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/645",
+      "line_items": [
+        {
+          "id": 504,
+          "subtotal": "43.98",
+          "subtotal_tax": "4.40",
+          "total": "43.98",
+          "total_tax": "4.40",
+          "price": "21.99",
+          "quantity": 2,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 505,
+          "subtotal": "19.99",
+          "subtotal_tax": "1.00",
+          "total": "19.99",
+          "total_tax": "1.00",
+          "price": "19.99",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Ship Your Idea",
+          "product_id": 613,
+          "sku": "",
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 506,
+          "method_id": "flat_rate",
+          "method_title": "Local Delivery",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 507,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 508,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    },
+    {
+      "id": 644,
+      "order_number": 644,
+      "created_at": "2015-01-26T19:33:42Z",
+      "updated_at": "2015-07-31T11:45:12Z",
+      "completed_at": "2015-01-26T19:33:42Z",
+      "status": "on-hold",
+      "currency": "USD",
+      "total": "44.14",
+      "subtotal": "30.99",
+      "total_line_items_quantity": 2,
+      "total_tax": "3.15",
+      "total_shipping": "10.00",
+      "cart_tax": "2.65",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": false
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/644",
+      "line_items": [
+        {
+          "id": 499,
+          "subtotal": "21.99",
+          "subtotal_tax": "2.20",
+          "total": "21.99",
+          "total_tax": "2.20",
+          "price": "21.99",
+          "quantity": 1,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 500,
+          "subtotal": "9.00",
+          "subtotal_tax": "0.45",
+          "total": "9.00",
+          "total_tax": "0.45",
+          "price": "9.00",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Woo Album #4",
+          "product_id": 96,
+          "sku": "",
+          "meta": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 501,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 502,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 503,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    }
+  ]
+}
+

Delete an Order

+

This API helps you delete an order.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/orders/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/orders/645/?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('orders/645/?force=true', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('orders/645', ['force' => true])); ?>
+
print(wcapi.delete("orders/645/", params={"force": True}).json())
+
woocommerce.delete("orders/645/", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted order"
+}
+

Parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the order, defaults to false. Note that permanently deleting the order will return HTTP 200 rather than HTTP 202.
+

View Orders Count

+

This API lets you retrieve a count of all orders.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/count
+
+
+
curl https://example.com/wc-api/v3/orders/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/count')); ?>
+
print(wcapi.get("orders/count").json())
+
woocommerce.get("orders/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 2
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringOrders by status. eg: processing or cancelled
+

View List of Order Statuses

+

This API lets you retrieve a list of orders statuses available.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/statuses
+
+
+
curl https://example.com/wc-api/v3/orders/statuses \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/statuses', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/statuses')); ?>
+
print(wcapi.get("orders/statuses").json())
+
woocommerce.get("orders/statuses").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_statuses": {
+    "pending": "Pending Payment",
+    "processing": "Processing",
+    "on-hold": "On Hold",
+    "completed": "Completed",
+    "cancelled": "Cancelled",
+    "refunded": "Refunded",
+    "failed": "Failed"
+  }
+}
+

Order - Notes

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate order notes.

+

Order Notes Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerOrder note ID read-only
created_atstringUTC DateTime when the order note was created read-only
notestringOrder note required
customer_notebooleanShows/define if the note is only for reference or for the customer (the user will be notified). Default is false
+

Create a Note For an Order

+

This API helps you to create a new note for an order.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/orders/<id>/notes
+
+
+
curl -X POST https://example.com/wc-api/v3/orders/645/notes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_note": {
+    "note": "Order ok!!!"
+  }
+}'
+
var data = {
+  order_note: {
+    note: 'Order ok!!!'
+  }
+};
+
+WooCommerce.post('orders/645/notes', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'order_note' => [
+        'note' => 'Order ok!!!'
+    ]
+];
+
+print_r($woocommerce->post('orders/645/notes', $data));
+?>
+
data = {
+    "order_note": {
+        "note": "Order ok!!!"
+    }
+}
+
+print(wcapi.post("orders/645/notes", data).json())
+
data = {
+  order_note: {
+    note: "Order ok!!!"
+  }
+}
+
+woocommerce.post("orders/645/notes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_note": {
+    "id": "416",
+    "created_at": "2015-01-26T20:56:44Z",
+    "note": "Order ok!!!",
+    "customer_note": false
+  }
+}
+

View an Order Note

+

This API lets you retrieve and view a specific note from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/<id>/notes/<note_id>
+
+
+
curl https://example.com/wc-api/v3/orders/645/notes/416 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/notes/416', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/645/notes/416')); ?>
+
print(wcapi.get("orders/645/notes/416").json())
+
woocommerce.get("orders/645/notes/416").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_note": {
+    "id": "416",
+    "created_at": "2015-01-26T20:56:44Z",
+    "note": "Order ok!!!",
+    "customer_note": false
+  }
+}
+

View List of Notes From an Order

+

This API helps you to view all the notes from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/<id>/notes
+
+
+
curl https://example.com/wc-api/v3/orders/645/notes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/notes', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/645/notes')); ?>
+
print(wcapi.get("orders/645/notes").json())
+
woocommerce.get("orders/645/notes").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_notes": [
+    {
+      "id": "416",
+      "created_at": "2015-01-26T20:56:44Z",
+      "note": "Order ok!!!",
+      "customer_note": false
+    },
+    {
+      "id": "415",
+      "created_at": "2015-01-26T20:16:14Z",
+      "note": "Order status changed from Processing to Completed.",
+      "customer_note": false
+    },
+    {
+      "id": "412",
+      "created_at": "2015-01-26T20:00:21Z",
+      "note": "Order item stock reduced successfully.",
+      "customer_note": false
+    },
+    {
+      "id": "411",
+      "created_at": "2015-01-26T20:00:09Z",
+      "note": "Order status changed from Pending Payment to Processing.",
+      "customer_note": false
+    }
+  ]
+}
+

Update an Order Note

+

This API lets you make changes to an order note.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/orders/<id>/notes/<note_id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/orders/645/notes/416 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_note": {
+    "note": "Ok!"
+  }
+}'
+
var data = {
+  order_note: {
+    note: 'Ok!'
+  }
+};
+
+WooCommerce.put('orders/645/notes/416', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'order_note' => [
+        'note' => 'Ok!'
+    ]
+];
+
+print_r($woocommerce->put('orders/645/notes/416', $data));
+?>
+
data = {
+    "order_note": {
+        "note": "Ok!"
+    }
+}
+
+print(wcapi.put("orders/645/notes/416", data).json())
+
data = {
+  order_note: {
+    note: "Ok!"
+  }
+}
+
+woocommerce.put("orders/645/notes/416", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_note": {
+    "id": "416",
+    "created_at": "2015-01-26T20:56:44Z",
+    "note": "Ok!",
+    "customer_note": false
+  }
+}
+

Delete an Order Note

+

This API helps you delete an order note.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/orders/<id>/notes/<note_id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/orders/645/notes/416 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('orders/645/notes/416', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('orders/645/notes/416')); ?>
+
print(wcapi.delete("orders/645/notes/416").json())
+
woocommerce.delete("orders/645/notes/416").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted order note"
+}
+

Order - Refunds

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate order refunds.

+

Order Refunds Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerOrder note ID read-only
created_atstringUTC DateTime when the order refund was created read-only
amountstringRefund amount required
reasonstringReason for refund
line_itemsarrayList of order items to refund. See Line Items Properties
+

Create a Refund For an Order

+

This API helps you to create a new refund for an order.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/orders/<id>/refunds
+
+
+
curl -X POST https://example.com/wc-api/v3/orders/645/refunds \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_refund": {
+    "amount": 10
+  }
+}'
+
var data = {
+  order_refund: {
+    amount: 10
+  }
+};
+
+WooCommerce.post('orders/645/refunds', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'order_refund' => [
+        'amount' => 10
+    ]
+];
+
+print_r($woocommerce->post('orders/645/refunds', $data));
+?>
+
data = {
+    "order_refund": {
+        "amount": 10
+    }
+}
+
+print(wcapi.post("orders/645/refunds", data).json())
+
data = {
+  order_refund: {
+    amount: 10
+  }
+}
+
+woocommerce.post("orders/645/refunds", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refund": {
+    "id": 649,
+    "created_at": "2015-01-26T19:29:32Z",
+    "amount": "10.00",
+    "reason": "",
+    "line_items": []
+  }
+}
+

View an Order Refund

+

This API lets you retrieve and view a specific refund from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/<id>/refunds/<refund_id>
+
+
+
curl https://example.com/wc-api/v3/orders/645/refunds/649 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/refunds/649', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/645/refunds/649')); ?>
+
print(wcapi.get("orders/645/refunds/649").json())
+
woocommerce.get("orders/645/refunds/649").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refund": {
+    "id": 649,
+    "created_at": "2015-01-26T19:29:32Z",
+    "amount": "10.00",
+    "reason": "",
+    "line_items": []
+  }
+}
+

View List of Refunds From an Order

+

This API helps you to view all the refunds from an order.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/orders/<id>/refunds
+
+
+
curl https://example.com/wc-api/v3/orders/645/refunds \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('orders/645/refunds', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('orders/645/refunds')); ?>
+
print(wcapi.get("orders/645/refunds").json())
+
woocommerce.get("orders/645/refunds").parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refunds": [
+    {
+      "id": 649,
+      "created_at": "2015-01-26T19:29:32Z",
+      "amount": "10.00",
+      "reason": "",
+      "line_items": []
+    },
+    {
+      "id": 647,
+      "created_at": "2015-01-26T19:19:06Z",
+      "amount": "21.99",
+      "reason": "",
+      "line_items": [
+        {
+          "id": 514,
+          "subtotal": "-21.99",
+          "subtotal_tax": "0.00",
+          "total": "-21.99",
+          "total_tax": "0.00",
+          "price": "-21.99",
+          "quantity": 1,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 515,
+          "subtotal": "0.00",
+          "subtotal_tax": "0.00",
+          "total": "0.00",
+          "total_tax": "0.00",
+          "price": "0.00",
+          "quantity": 0,
+          "tax_class": null,
+          "name": "Ship Your Idea",
+          "product_id": 613,
+          "sku": "",
+          "meta": []
+        }
+      ]
+    }
+  ]
+}
+

Update an Order Refund

+

This API lets you make changes to an order refund.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/orders/<id>/refunds/<refund_id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/orders/645/refunds/649 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_refund": {
+    "reason": "Because was it necessary!"
+  }
+}'
+
var data = {
+  order_refund: {
+    reason: 'Because was it necessary!'
+  }
+};
+
+WooCommerce.put('orders/645/refunds/649', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'order_refund' => [
+        'reason' => 'Because was it necessary!'
+    ]
+];
+
+print_r($woocommerce->put('orders/645/refunds/649', $data));
+?>
+
data = {
+    "order_refund": {
+        "reason": "Because was it necessary!"
+    }
+}
+
+print(wcapi.put("orders/645/refunds/649", data).json())
+
data = {
+  order_refund: {
+    reason: "Because was it necessary!"
+  }
+}
+
+woocommerce.put("orders/645/refunds/649", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "order_refund": {
+    "id": 649,
+    "created_at": "2015-01-26T19:29:32Z",
+    "amount": "10.00",
+    "reason": "Because was it necessary!",
+    "line_items": []
+  }
+}
+

Delete an Order Refund

+

This API helps you delete an order refund.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/orders/<id>/refunds/<refund_id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/orders/645/refunds/649 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('orders/645/refunds/649', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('orders/645/refunds/649')); ?>
+
print(wcapi.delete("orders/645/refunds/649").json())
+
woocommerce.delete("orders/645/refunds/649").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted refund"
+}
+

Products

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate products.

+

Products Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
titlestringProduct name
idintegerProduct ID (post ID) read-only
namestringProduct slug edit-only
created_atstringUTC DateTime when the product was created read-only
updated_atstringUTC DateTime when the product was last updated read-only
typestringProduct type. By default in WooCommerce the following types are available: simple, grouped, external, variable. Default is simple
statusstringProduct status (post status). Default is publish
downloadablebooleanIf the product is downloadable or not. Downloadable products give access to a file upon purchase
virtualbooleanIf the product is virtual or not. Virtual products are intangible and aren't shipped
permalinkstringProduct URL (post permalink) read-only
skustringSKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
pricestringCurrent product price. This is setted from regular_price and sale_price read-only
regular_pricestringProduct regular price
sale_pricestringProduct sale price
sale_price_dates_fromstringSets the sale start date. Date in the YYYY-MM-DD format write-only
sale_price_dates_tostringSets the sale end date. Date in the YYYY-MM-DD format write-only
price_htmlstringPrice formatted in HTML, e.g. <del><span class=\"amount\">&#36;&nbsp;3.00</span></del> <ins><span class=\"amount\">&#36;&nbsp;2.00</span></ins> read-only
taxablebooleanShow if the product is taxable or not read-only
tax_statusstringTax status. The options are: taxable, shipping (Shipping only) and none
tax_classstringTax class
managing_stockbooleanEnable stock management at product level
stock_quantityintegerStock quantity. If is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.
in_stockbooleanControls whether or not the product is listed as "in stock" or "out of stock" on the frontend.
backorders_allowedbooleanShows if backorders are allowed read-only
backorderedbooleanShows if a product is on backorder (if the product have the stock_quantity negative) read-only
backordersmixedIf managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0. The options are: false (Do not allow), notify (Allow, but notify customer), and true (Allow) write-only
sold_individuallybooleanWhen true this only allow one item to be bought in a single order
purchaseablebooleanShows if the product can be bought read-only
featuredbooleanFeatured Product
visiblebooleanShows whether or not the product is visible in the catalog read-only
catalog_visibilitystringCatalog visibility. The following options are available: visible (Catalog and search), catalog (Only in catalog), search (Only in search) and hidden (Hidden from all). Default is visible
on_salebooleanShows if the product is on sale or not read-only
weightstringProduct weight in decimal format
dimensionsarrayList of the product dimensions. See Dimensions Properties
shipping_requiredbooleanShows if the product need to be shipped or not read-only
shipping_taxablebooleanShows whether or not the product shipping is taxable read-only
shipping_classstringShipping class slug. Shipping classes are used by certain shipping methods to group similar products
shipping_class_idintegerShipping class ID read-only
descriptionstringProduct description
enable_html_descriptionboolEnable HTML for product description write-only
short_descriptionstringProduct short description
enable_html_short_descriptionstringEnable HTML for product short description write-only
reviews_allowedbooleanShows/define if reviews are allowed
average_ratingstringReviews average rating read-only
rating_countintegerAmount of reviews that the product have read-only
related_idsarrayList of related products IDs (integer) read-only
upsell_idsarrayList of up-sell products IDs (integer). Up-sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive
cross_sell_idsarrayList of cross-sell products IDs. Cross-sells are products which you promote in the cart, based on the current product
parent_idintegerProduct parent ID (post_parent)
categoriesarrayList of product categories names (string). In write-mode need to pass a array of categories IDs (integer) (uses wp_set_object_terms())
tagsarrayList of product tags names (string). In write-mode need to pass a array of tags IDs (integer) (uses wp_set_object_terms())
imagesarrayList of products images. See Images Properties
featured_srcstringFeatured image URL read-only
attributesarrayList of product attributes. See Attributes Properties. Note: the attribute must be registered in WooCommerce before.
default_attributesarrayDefaults variation attributes. These are the attributes that will be pre-selected on the frontend. See Default Attributes Properties write-only
downloadsarrayList of downloadable files. See Downloads Properties
download_limitintegerAmount of times the product can be downloaded. In write-mode you can sent a blank string for unlimited re-downloads. e.g ''
download_expiryintegerNumber of days that the customer has up to be able to download the product. In write-mode you can sent a blank string for never expiry. e.g ''
download_typestringDownload type, this controls the schema. The available options are: '' (Standard Product), application (Application/Software) and music (Music)
purchase_notestringOptional note to send the customer after purchase.
total_salesintegerAmount of sales read-only
variationsarrayList of products variations. See Variations Properties
parentarrayList the product parent data when query for a variation read-only
product_urlstringProduct external URL. Only for external products write-only
button_textstringProduct external button text. Only for external products write-only
menu_orderintegerMenu order, used to custom sort products
+ + +

Dimensions Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringProduct length in decimal format
widthstringProduct width in decimal format
heightstringProduct height in decimal format
unitstringProduct name read-only
+

Images Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID (attachment ID)
created_atstringUTC DateTime when the image was created read-only
updated_atstringUTC DateTime when the image was last updated read-only
srcstringImage URL. In write-mode you can use to send new images
titlestringImage title (attachment title)
altstringImage alt text (attachment image alt text)
positionintegerImage position. 0 means that the image is featured
+ + +

Attributes Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringAttribute name required
slugstringAttribute slug
positionintegerAttribute position
visiblebooleanShows/define if the attribute is visible on the "Additional Information" tab in the product's page
variationbooleanShows/define if the attribute can be used as variation
optionsarrayList of available term names of the attribute
+

Default Attributes Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringAttribute name
slugstringAttribute slug
optionstringSelected term name of the attribute
+

Downloads Properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID (File ID) read-only
namestringFile name
filestringFile URL. In write-mode you can use this property to send new files
+

Variations Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerVariation ID (post ID) read-only
created_atstringUTC DateTime when the variation was created read-only
updated_atstringUTC DateTime when the variation was last updated read-only
downloadablebooleanIf the variation is downloadable or not. Downloadable variations give access to a file upon purchase
virtualbooleanIf the variation is virtual or not. Virtual variations are intangible and aren't shipped
permalinkstringVariation URL (post permalink) read-only
skustringSKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
pricestringCurrent variation price. This is setted from regular_price and sale_price read-only
regular_pricestringVariation regular price
sale_pricestringVariation sale price
sale_price_dates_fromstringSets the sale start date. Date in the YYYY-MM-DD format write-only
sale_price_dates_tostringSets the sale end date. Date in the YYYY-MM-DD format write-only
taxablebooleanShow if the variation is taxable or not read-only
tax_statusstringTax status. The options are: taxable, shipping (Shipping only) and none
tax_classstringTax class
managing_stockbooleanEnable stock management at variation level
stock_quantityintegerStock quantity. If is a variable variation this value will be used to control stock for all variations, unless you define stock at variation level.
in_stockbooleanControls whether or not the variation is listed as "in stock" or "out of stock" on the frontend.
backorderedbooleanShows if a variation is on backorder (if the variation have the stock_quantity negative) read-only
purchaseablebooleanShows if the variation can be bought read-only
visiblebooleanShows whether or not the product parent is visible in the catalog read-only
on_salebooleanShows if the variation is on sale or not read-only
weightstringVariation weight in decimal format
dimensionsarrayList of the variation dimensions. See Dimensions Properties
shipping_classstringShipping class slug. Shipping classes are used by certain shipping methods to group similar products
shipping_class_idintegerShipping class ID read-only
imagearrayVariation featured image. Only position 0 will be used. See Images Properties
attributesarrayList of variation attributes. Similar to a simple or variable product, but for variation indicate the attributes used to form the variation. See Attributes Properties
downloadsarrayList of downloadable files. See Downloads Properties
download_limitintegerAmount of times the variation can be downloaded. In write-mode you can sent a blank string for unlimited re-downloads. e.g ''
download_expiryintegerNumber of days that the customer has up to be able to download the varition. In write-mode you can sent a blank string for never expiry. e.g ''
+

Create a Product

+

This API helps you to create a new product.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products
+
+
+ +
+

Example of how to create a simple product:

+
+
curl -X POST https://example.com/wc-api/v3/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product": {
+    "title": "Premium Quality",
+    "type": "simple",
+    "regular_price": "21.99",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+      9,
+      14
+    ],
+    "images": [
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "position": 0
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "position": 1
+      }
+    ]
+  }
+}'
+
var data = {
+  product: {
+    title: 'Premium Quality',
+    type: 'simple',
+    regular_price: '21.99',
+    description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    short_description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
+        position: 0
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
+        position: 1
+      }
+    ]
+  }
+};
+
+WooCommerce.post('products', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product' => [
+        'title' => 'Premium Quality',
+        'type' => 'simple',
+        'regular_price' => '21.99',
+        'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+        'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+        'categories' => [
+            9,
+            14
+        ],
+        'images' => [
+            [
+                'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
+                'position' => 0
+            ],
+            [
+                'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
+                'position' => 1
+            ]
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "product": {
+        "title": "Premium Quality",
+        "type": "simple",
+        "regular_price": "21.99",
+        "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+        "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+        "categories": [
+            9,
+            14
+        ],
+        "images": [
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+                "position": 0
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+                "position": 1
+            }
+        ]
+    }
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  product: {
+    title: "Premium Quality",
+    type: "simple",
+    regular_price: "21.99",
+    description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        position: 0
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        position: 1
+      }
+    ]
+  }
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Premium Quality",
+    "id": 546,
+    "created_at": "2015-01-22T19:46:16Z",
+    "updated_at": "2015-01-22T19:46:16Z",
+    "type": "simple",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example.com/product/premium-quality/",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      37,
+      47,
+      31,
+      19,
+      22
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 547,
+        "created_at": "2015-01-22T19:46:16Z",
+        "updated_at": "2015-01-22T19:46:16Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 548,
+        "created_at": "2015-01-22T19:46:17Z",
+        "updated_at": "2015-01-22T19:46:17Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+    "attributes": [],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [],
+    "parent": [],
+    "grouped_products": [],
+    "menu_order": 0
+  }
+}
+
+
+

Example of how to create a variable product:

+
+
curl -X POST https://example.com/wc-api/v3/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product": {
+    "title": "Ship Your Idea",
+    "type": "variable",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+      9,
+      14
+    ],
+    "images": [
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+        "position": 0
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+        "position": 1
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+        "position": 2
+      },
+      {
+        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+        "position": 3
+      }
+    ],
+    "attributes": [
+      {
+        "name": "Color",
+        "slug": "color",
+        "position": "0",
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      }
+    ],
+    "default_attributes": [
+      {
+        "name": "Color",
+        "slug": "color",
+        "option": "Black"
+      }
+    ],
+    "variations": [
+      {
+        "regular_price": "19.99",
+        "image": [
+          {
+            "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "black"
+          }
+        ]
+      },
+      {
+        "regular_price": "19.99",
+        "image": [
+          {
+            "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "green"
+          }
+        ]
+      }
+    ]
+  }
+}'
+
var data = {
+  product: {
+    title: 'Ship Your Idea',
+    type: 'variable',
+    description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    short_description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+        position: 0
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
+        position: 1
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+        position: 2
+      },
+      {
+        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
+        position: 3
+      }
+    ],
+    attributes: [
+      {
+        name: 'Color',
+        slug: 'color',
+        position: '0',
+        visible: false,
+        variation: true,
+        options: [
+          'Black',
+          'Green'
+        ]
+      }
+    ],
+    default_attributes: [
+      {
+        name: 'Color',
+        slug: 'color',
+        option: 'Black'
+      }
+    ],
+    variations: [
+      {
+        regular_price: '19.99',
+        image: [
+          {
+            src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: 'Color',
+            slug: 'color',
+            option: 'black'
+          }
+        ]
+      },
+      {
+        regular_price: '19.99',
+        image: [
+          {
+            src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: 'Color',
+            slug: 'color',
+            option: 'green'
+          }
+        ]
+      }
+    ]
+  }
+};
+
+WooCommerce.post('products', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product' => [
+        'title' => 'Ship Your Idea',
+        'type' => 'variable',
+        'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+        'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+        'categories' => [
+            9,
+            14
+        ],
+        'images' => [
+            [
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+                'position' => 0
+            ],
+            [
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
+                'position' => 1
+            ],
+            [
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+                'position' => 2
+            ],
+            [
+                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
+                'position' => 3
+            ]
+        ],
+        'attributes' => [
+            [
+                'name' => 'Color',
+                'slug' => 'color',
+                'position' => '0',
+                'visible' => false,
+                'variation' => true,
+                'options' => [
+                    'Black',
+                    'Green'
+                ]
+            ]
+        ],
+        'default_attributes' => [
+            [
+                'name' => 'Color',
+                'slug' => 'color',
+                'option' => 'Black'
+            ]
+        ],
+        'variations' => [
+            [
+                'regular_price' => '19.99',
+                'image' => [
+                    [
+                        'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+                        'position' => 0
+                    ]
+                ],
+                'attributes' => [
+                    [
+                        'name' => 'Color',
+                        'slug' => 'color',
+                        'option' => 'black'
+                    ]
+                ]
+            ],
+            [
+                'regular_price' => '19.99',
+                'image' => [
+                    [
+                        'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+                        'position' => 0
+                    ]
+                ],
+                'attributes' => [
+                    [
+                        'name' => 'Color',
+                        'slug' => 'color',
+                        'option' => 'green'
+                    ]
+                ]
+            ]
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "product": {
+        "title": "Ship Your Idea",
+        "type": "variable",
+        "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+        "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+        "categories": [
+            9,
+            14
+        ],
+        "images": [
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+                "position": 0
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+                "position": 1
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+                "position": 2
+            },
+            {
+                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+                "position": 3
+            }
+        ],
+        "attributes": [
+            {
+                "name": "Color",
+                "slug": "color",
+                "position": "0",
+                "visible": False,
+                "variation": True,
+                "options": [
+                    "Black",
+                    "Green"
+                ]
+            }
+        ],
+        "default_attributes": [
+            {
+                "name": "Color",
+                "slug": "color",
+                "option": "Black"
+            }
+        ],
+        "variations": [
+            {
+                "regular_price": "19.99",
+                "image": [
+                    {
+                        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+                        "position": 0
+                    }
+                ],
+                "attributes": [
+                    {
+                        "name": "Color",
+                        "slug": "color",
+                        "option": "black"
+                    }
+                ]
+            },
+            {
+                "regular_price": "19.99",
+                "image": [
+                    {
+                        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+                        "position": 0
+                    }
+                ],
+                "attributes": [
+                    {
+                        "name": "Color",
+                        "slug": "color",
+                        "option": "green"
+                    }
+                ]
+            }
+        ]
+    }
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  product: {
+    title: "Ship Your Idea",
+    type: "variable",
+    description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    categories: [
+      9,
+      14
+    ],
+    images: [
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+        position: 0
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+        position: 1
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+        position: 2
+      },
+      {
+        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+        position: 3
+      }
+    ],
+    attributes: [
+      {
+        name: "Color",
+        slug: "color",
+        position: "0",
+        visible: false,
+        variation: true,
+        options: [
+          "Black",
+          "Green"
+        ]
+      }
+    ],
+    default_attributes: [
+      {
+        name: "Color",
+        slug: "color",
+        option: "Black"
+      }
+    ],
+    variations: [
+      {
+        regular_price: "19.99",
+        image: [
+          {
+            src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: "Color",
+            slug: "color",
+            option: "black"
+          }
+        ]
+      },
+      {
+        regular_price: "19.99",
+        image: [
+          {
+            src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+            position: 0
+          }
+        ],
+        attributes: [
+          {
+            name: "Color",
+            slug: "color",
+            option: "green"
+          }
+        ]
+      }
+    ]
+  }
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Ship Your Idea",
+    "id": 604,
+    "created_at": "2015-01-22T20:37:14Z",
+    "updated_at": "2015-01-22T20:37:14Z",
+    "type": "variable",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example/product/ship-your-idea/",
+    "sku": "",
+    "price": "19.99",
+    "regular_price": "0.00",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;19.99</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      40,
+      37,
+      47,
+      577,
+      34
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 605,
+        "created_at": "2015-01-22T20:37:14Z",
+        "updated_at": "2015-01-22T20:37:14Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 606,
+        "created_at": "2015-01-22T20:37:15Z",
+        "updated_at": "2015-01-22T20:37:15Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      },
+      {
+        "id": 607,
+        "created_at": "2015-01-22T20:37:15Z",
+        "updated_at": "2015-01-22T20:37:15Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 2
+      },
+      {
+        "id": 608,
+        "created_at": "2015-01-22T20:37:16Z",
+        "updated_at": "2015-01-22T20:37:16Z",
+        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 3
+      }
+    ],
+    "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+    "attributes": [
+      {
+        "name": "Color",
+        "slug": "color",
+        "position": 0,
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      }
+    ],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [
+      {
+        "id": 609,
+        "created_at": "2015-01-22T20:37:14Z",
+        "updated_at": "2015-01-22T20:37:14Z",
+        "downloadable": false,
+        "virtual": false,
+        "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
+        "sku": "",
+        "price": "19.99",
+        "regular_price": "19.99",
+        "sale_price": null,
+        "taxable": true,
+        "tax_status": "taxable",
+        "tax_class": "",
+        "managing_stock": false,
+        "stock_quantity": 0,
+        "in_stock": true,
+        "backordered": false,
+        "purchaseable": true,
+        "visible": true,
+        "on_sale": false,
+        "weight": null,
+        "dimensions": {
+          "length": "",
+          "width": "",
+          "height": "",
+          "unit": "cm"
+        },
+        "shipping_class": "",
+        "shipping_class_id": null,
+        "image": [
+          {
+            "id": 610,
+            "created_at": "2015-01-22T20:37:18Z",
+            "updated_at": "2015-01-22T20:37:18Z",
+            "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+            "title": "",
+            "alt": "",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "black"
+          }
+        ],
+        "downloads": [],
+        "download_limit": 0,
+        "download_expiry": 0
+      },
+      {
+        "id": 611,
+        "created_at": "2015-01-22T20:37:14Z",
+        "updated_at": "2015-01-22T20:37:14Z",
+        "downloadable": false,
+        "virtual": false,
+        "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
+        "sku": "",
+        "price": "19.99",
+        "regular_price": "19.99",
+        "sale_price": null,
+        "taxable": true,
+        "tax_status": "taxable",
+        "tax_class": "",
+        "managing_stock": false,
+        "stock_quantity": 0,
+        "in_stock": true,
+        "backordered": false,
+        "purchaseable": true,
+        "visible": true,
+        "on_sale": false,
+        "weight": null,
+        "dimensions": {
+          "length": "",
+          "width": "",
+          "height": "",
+          "unit": "cm"
+        },
+        "shipping_class": "",
+        "shipping_class_id": null,
+        "image": [
+          {
+            "id": 612,
+            "created_at": "2015-01-22T20:37:19Z",
+            "updated_at": "2015-01-22T20:37:19Z",
+            "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+            "title": "",
+            "alt": "",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "name": "Color",
+            "slug": "color",
+            "option": "green"
+          }
+        ],
+        "downloads": [],
+        "download_limit": 0,
+        "download_expiry": 0
+      }
+    ],
+    "parent": [],
+    "grouped_products": [],
+    "menu_order": 0
+  }
+}
+

View a Product

+

This API lets you retrieve and view a specific product by ID.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/products/<id>
+
+
+
curl https://example.com/wc-api/v3/products/546 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/546', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/546')); ?>
+
print(wcapi.get("products/546").json())
+
woocommerce.get("products/546").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Premium Quality",
+    "id": 546,
+    "created_at": "2015-01-22T19:46:16Z",
+    "updated_at": "2015-01-22T19:46:16Z",
+    "type": "simple",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example.com/product/premium-quality/",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      37,
+      47,
+      31,
+      19,
+      22
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 547,
+        "created_at": "2015-01-22T19:46:16Z",
+        "updated_at": "2015-01-22T19:46:16Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 548,
+        "created_at": "2015-01-22T19:46:17Z",
+        "updated_at": "2015-01-22T19:46:17Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+    "attributes": [],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [],
+    "parent": [],
+    "grouped_products": [],
+    "menu_order": 0
+  }
+}
+

View List of Products

+

This API helps you to view all the products.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/products
+
+
+
curl https://example.com/wc-api/v3/products \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products')); ?>
+
print(wcapi.get("products").json())
+
woocommerce.get("products").parsed_response
+
+
+

JSON response example:

+
+
{
+  "products": [
+    {
+      "title": "Premium Quality",
+      "id": 546,
+      "created_at": "2015-01-22T19:46:16Z",
+      "updated_at": "2015-01-22T19:46:16Z",
+      "type": "simple",
+      "status": "publish",
+      "downloadable": false,
+      "virtual": false,
+      "permalink": "https://example.com/product/premium-quality/",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": null,
+      "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
+      "taxable": true,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "managing_stock": false,
+      "stock_quantity": 0,
+      "in_stock": true,
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "purchaseable": true,
+      "featured": false,
+      "visible": true,
+      "catalog_visibility": "visible",
+      "on_sale": false,
+      "weight": null,
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": "",
+        "unit": "cm"
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": null,
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        37,
+        47,
+        31,
+        19,
+        22
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "categories": [
+        "Clothing",
+        "T-shirts"
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 547,
+          "created_at": "2015-01-22T19:46:16Z",
+          "updated_at": "2015-01-22T19:46:16Z",
+          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 548,
+          "created_at": "2015-01-22T19:46:17Z",
+          "updated_at": "2015-01-22T19:46:17Z",
+          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+      "attributes": [],
+      "downloads": [],
+      "download_limit": 0,
+      "download_expiry": 0,
+      "download_type": "",
+      "purchase_note": "",
+      "total_sales": 0,
+      "variations": [],
+      "parent": [],
+      "grouped_products": [],
+      "menu_order": 0
+    },
+    {
+      "title": "Ship Your Idea",
+      "id": 604,
+      "created_at": "2015-01-22T20:37:14Z",
+      "updated_at": "2015-01-22T20:37:14Z",
+      "type": "variable",
+      "status": "publish",
+      "downloadable": false,
+      "virtual": false,
+      "permalink": "https://example/product/ship-your-idea/",
+      "sku": "",
+      "price": "19.99",
+      "regular_price": "0.00",
+      "sale_price": null,
+      "price_html": "<span class=\"amount\">&#36;&nbsp;19.99</span>",
+      "taxable": true,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "managing_stock": false,
+      "stock_quantity": 0,
+      "in_stock": true,
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "purchaseable": true,
+      "featured": false,
+      "visible": true,
+      "catalog_visibility": "visible",
+      "on_sale": false,
+      "weight": null,
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": "",
+        "unit": "cm"
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": null,
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        40,
+        37,
+        47,
+        577,
+        34
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "categories": [
+        "Clothing",
+        "T-shirts"
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 605,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 606,
+          "created_at": "2015-01-22T20:37:15Z",
+          "updated_at": "2015-01-22T20:37:15Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 1
+        },
+        {
+          "id": 607,
+          "created_at": "2015-01-22T20:37:15Z",
+          "updated_at": "2015-01-22T20:37:15Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 2
+        },
+        {
+          "id": 608,
+          "created_at": "2015-01-22T20:37:16Z",
+          "updated_at": "2015-01-22T20:37:16Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 3
+        }
+      ],
+      "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+      "attributes": [
+        {
+          "name": "Color",
+          "slug": "color",
+          "position": 0,
+          "visible": false,
+          "variation": true,
+          "options": [
+            "Black",
+            "Green"
+          ]
+        }
+      ],
+      "downloads": [],
+      "download_limit": 0,
+      "download_expiry": 0,
+      "download_type": "",
+      "purchase_note": "",
+      "total_sales": 0,
+      "variations": [
+        {
+          "id": 609,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "downloadable": false,
+          "virtual": false,
+          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
+          "sku": "",
+          "price": "19.99",
+          "regular_price": "19.99",
+          "sale_price": null,
+          "taxable": true,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "managing_stock": false,
+          "stock_quantity": 0,
+          "in_stock": true,
+          "backordered": false,
+          "purchaseable": true,
+          "visible": true,
+          "on_sale": false,
+          "weight": null,
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": "",
+            "unit": "cm"
+          },
+          "shipping_class": "",
+          "shipping_class_id": null,
+          "image": [
+            {
+              "id": 610,
+              "created_at": "2015-01-22T20:37:18Z",
+              "updated_at": "2015-01-22T20:37:18Z",
+              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+              "title": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "name": "Color",
+              "slug": "color",
+              "option": "black"
+            }
+          ],
+          "downloads": [],
+          "download_limit": 0,
+          "download_expiry": 0
+        },
+        {
+          "id": 611,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "downloadable": false,
+          "virtual": false,
+          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
+          "sku": "",
+          "price": "19.99",
+          "regular_price": "19.99",
+          "sale_price": null,
+          "taxable": true,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "managing_stock": false,
+          "stock_quantity": 0,
+          "in_stock": true,
+          "backordered": false,
+          "purchaseable": true,
+          "visible": true,
+          "on_sale": false,
+          "weight": null,
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": "",
+            "unit": "cm"
+          },
+          "shipping_class": "",
+          "shipping_class_id": null,
+          "image": [
+            {
+              "id": 612,
+              "created_at": "2015-01-22T20:37:19Z",
+              "updated_at": "2015-01-22T20:37:19Z",
+              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+              "title": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "name": "Color",
+              "slug": "color",
+              "option": "green"
+            }
+          ],
+          "downloads": [],
+          "download_limit": 0,
+          "download_expiry": 0
+        }
+      ],
+      "parent": [],
+      "grouped_products": [],
+      "menu_order": 0
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilterTypeDescription
typestringProducts by type. eg: simple or variable.
categorystringProducts by category.
tagstringProducts by tag.
shipping_classstringProducts by shipping class.
pa_*stringProducts by attributes. eg: filter[pa_color]=black
skustringFilter a product by SKU.
+ + +

Update a Product

+

This API lets you make changes to a product.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/products/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/products/546 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product": {
+    "regular_price": "24.54"
+  }
+}'
+
var data = {
+  product: {
+    regular_price: '24.54'
+  }
+};
+
+WooCommerce.put('products/546', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product' => [
+        'regular_price' => '24.54'
+    ]
+];
+
+print_r($woocommerce->put('products/546', $data));
+?>
+
data = {
+    "product": {
+        "regular_price": "24.54"
+    }
+}
+
+print(wcapi.put("products/546", data).json())
+
data = {
+  product: {
+    regular_price: "24.54"
+  }
+}
+
+woocommerce.put("products/546", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product": {
+    "title": "Premium Quality",
+    "id": 546,
+    "created_at": "2015-01-22T19:46:16Z",
+    "updated_at": "2015-01-22T19:55:31Z",
+    "type": "simple",
+    "status": "publish",
+    "downloadable": false,
+    "virtual": false,
+    "permalink": "https://example.com/product/premium-quality/",
+    "sku": "",
+    "price": "24.54",
+    "regular_price": "24.54",
+    "sale_price": null,
+    "price_html": "<span class=\"amount\">&#36;&nbsp;24.54</span>",
+    "taxable": true,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "managing_stock": false,
+    "stock_quantity": 0,
+    "in_stock": true,
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "purchaseable": true,
+    "featured": false,
+    "visible": true,
+    "catalog_visibility": "visible",
+    "on_sale": false,
+    "weight": null,
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": "",
+      "unit": "cm"
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": null,
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      37,
+      47,
+      31,
+      19,
+      22
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "categories": [
+      "Clothing",
+      "T-shirts"
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 547,
+        "created_at": "2015-01-22T19:46:16Z",
+        "updated_at": "2015-01-22T19:46:16Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+        "title": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 548,
+        "created_at": "2015-01-22T19:46:17Z",
+        "updated_at": "2015-01-22T19:46:17Z",
+        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+        "title": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+    "attributes": [],
+    "downloads": [],
+    "download_limit": 0,
+    "download_expiry": 0,
+    "download_type": "",
+    "purchase_note": "",
+    "total_sales": 0,
+    "variations": [],
+    "parent": [],
+    "grouped_products": [],
+    "menu_order": 0
+  }
+}
+

Create/Update Multiple Products

+

This API helps you to bulk create/update multiple products.

+ +

To update is necessary to send objects containing IDs and to create new not just send the ID.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products/bulk
+
+
+
curl -X POST https://example.com/wc-api/v3/products/bulk \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "products": [
+    {
+      "id": 546,
+      "regular_price": "29.99"
+    },
+    {
+      "id": 604,
+      "variations": [
+        {
+          "id": 609,
+          "regular_price": "29.99"
+        },
+        {
+          "id": 611,
+          "regular_price": "29.99"
+        }
+      ]
+    }
+  ]
+}'
+
var data = {
+  products: [
+    {
+      id: 546,
+      regular_price: '29.99'
+    },
+    {
+      id: 604,
+      variations: [
+        {
+          id: 609,
+          regular_price: '29.99'
+        },
+        {
+          id: 611,
+          regular_price: '29.99'
+        }
+      ]
+    }
+  ]
+};
+
+WooCommerce.post('products/bulk', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'products' => [
+        [
+            'id' => 546,
+            'regular_price' => '29.99'
+        ],
+        [
+            'id' => 604,
+            'variations' => [
+                [
+                    'id' => 609,
+                    'regular_price' => '29.99'
+                ],
+                [
+                    'id' => 611,
+                    'regular_price' => '29.99'
+                ]
+            ]
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products/bulk', $data));
+?>
+
data = {
+    "products": [
+        {
+            "id": 546,
+            "regular_price": "29.99"
+        },
+        {
+            "id": 604,
+            "variations": [
+                {
+                    "id": 609,
+                    "regular_price": "29.99"
+                },
+                {
+                    "id": 611,
+                    "regular_price": "29.99"
+                }
+            ]
+        }
+    ]
+}
+
+print(wcapi.post("products/bulk", data).json())
+
data = {
+  products: [
+    {
+      id: 546,
+      regular_price: "29.99"
+    },
+    {
+      id: 604,
+      variations: [
+        {
+          id: 609,
+          regular_price: "29.99"
+        },
+        {
+          id: 611,
+          regular_price: "29.99"
+        }
+      ]
+    }
+  ]
+}
+
+woocommerce.post("products/bulk", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "products": [
+    {
+      "title": "Premium Quality",
+      "id": 546,
+      "created_at": "2015-01-22T19:46:16Z",
+      "updated_at": "2015-07-27T14:22:32Z",
+      "type": "simple",
+      "status": "publish",
+      "downloadable": false,
+      "virtual": false,
+      "permalink": "https://example.com/product/premium-quality/",
+      "sku": "",
+      "price": "29.99",
+      "regular_price": "29.99",
+      "sale_price": null,
+      "price_html": "<span class=\"amount\">&#36;&nbsp;29.99</span>",
+      "taxable": true,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "managing_stock": false,
+      "stock_quantity": 0,
+      "in_stock": true,
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "purchaseable": true,
+      "featured": false,
+      "visible": true,
+      "catalog_visibility": "visible",
+      "on_sale": false,
+      "weight": null,
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": "",
+        "unit": "cm"
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": null,
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        37,
+        47,
+        31,
+        19,
+        22
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "categories": [
+        "Clothing",
+        "T-shirts"
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 547,
+          "created_at": "2015-01-22T19:46:16Z",
+          "updated_at": "2015-01-22T19:46:16Z",
+          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 548,
+          "created_at": "2015-01-22T19:46:17Z",
+          "updated_at": "2015-01-22T19:46:17Z",
+          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
+      "attributes": [],
+      "downloads": [],
+      "download_limit": 0,
+      "download_expiry": 0,
+      "download_type": "",
+      "purchase_note": "",
+      "total_sales": 0,
+      "variations": [],
+      "parent": [],
+      "grouped_products": [],
+      "menu_order": 0
+    },
+    {
+      "title": "Ship Your Idea",
+      "id": 604,
+      "created_at": "2015-01-22T20:37:14Z",
+      "updated_at": "2015-07-27T14:22:32Z",
+      "type": "variable",
+      "status": "publish",
+      "downloadable": false,
+      "virtual": false,
+      "permalink": "https://example/product/ship-your-idea/",
+      "sku": "",
+      "price": "29.99",
+      "regular_price": "0.00",
+      "sale_price": null,
+      "price_html": "<span class=\"amount\">&#36;&nbsp;29.99</span>",
+      "taxable": true,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "managing_stock": false,
+      "stock_quantity": 0,
+      "in_stock": true,
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "purchaseable": true,
+      "featured": false,
+      "visible": true,
+      "catalog_visibility": "visible",
+      "on_sale": false,
+      "weight": null,
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": "",
+        "unit": "cm"
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": null,
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        40,
+        37,
+        47,
+        577,
+        34
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "categories": [
+        "Clothing",
+        "T-shirts"
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 605,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-01-22T20:37:14Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 606,
+          "created_at": "2015-01-22T20:37:15Z",
+          "updated_at": "2015-01-22T20:37:15Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 1
+        },
+        {
+          "id": 607,
+          "created_at": "2015-01-22T20:37:15Z",
+          "updated_at": "2015-01-22T20:37:15Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+          "title": "",
+          "alt": "",
+          "position": 2
+        },
+        {
+          "id": 608,
+          "created_at": "2015-01-22T20:37:16Z",
+          "updated_at": "2015-01-22T20:37:16Z",
+          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
+          "title": "",
+          "alt": "",
+          "position": 3
+        }
+      ],
+      "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+      "attributes": [
+        {
+          "name": "Color",
+          "slug": "color",
+          "position": 0,
+          "visible": false,
+          "variation": true,
+          "options": [
+            "Black",
+            "Green"
+          ]
+        }
+      ],
+      "downloads": [],
+      "download_limit": 0,
+      "download_expiry": 0,
+      "download_type": "",
+      "purchase_note": "",
+      "total_sales": 0,
+      "variations": [
+        {
+          "id": 609,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-07-27T14:22:32Z",
+          "downloadable": false,
+          "virtual": false,
+          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
+          "sku": "",
+          "price": "29.99",
+          "regular_price": "29.99",
+          "sale_price": null,
+          "taxable": true,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "managing_stock": false,
+          "stock_quantity": 0,
+          "in_stock": true,
+          "backordered": false,
+          "purchaseable": true,
+          "visible": true,
+          "on_sale": false,
+          "weight": null,
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": "",
+            "unit": "cm"
+          },
+          "shipping_class": "",
+          "shipping_class_id": null,
+          "image": [
+            {
+              "id": 610,
+              "created_at": "2015-01-22T20:37:18Z",
+              "updated_at": "2015-07-27T14:22:32Z",
+              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
+              "title": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "name": "Color",
+              "slug": "color",
+              "option": "black"
+            }
+          ],
+          "downloads": [],
+          "download_limit": 0,
+          "download_expiry": 0
+        },
+        {
+          "id": 611,
+          "created_at": "2015-01-22T20:37:14Z",
+          "updated_at": "2015-07-27T14:22:32Z",
+          "downloadable": false,
+          "virtual": false,
+          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
+          "sku": "",
+          "price": "29.99",
+          "regular_price": "29.99",
+          "sale_price": null,
+          "taxable": true,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "managing_stock": false,
+          "stock_quantity": 0,
+          "in_stock": true,
+          "backordered": false,
+          "purchaseable": true,
+          "visible": true,
+          "on_sale": false,
+          "weight": null,
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": "",
+            "unit": "cm"
+          },
+          "shipping_class": "",
+          "shipping_class_id": null,
+          "image": [
+            {
+              "id": 612,
+              "created_at": "2015-01-22T20:37:19Z",
+              "updated_at": "2015-01-22T20:37:19Z",
+              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
+              "title": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "name": "Color",
+              "slug": "color",
+              "option": "green"
+            }
+          ],
+          "downloads": [],
+          "download_limit": 0,
+          "download_expiry": 0
+        }
+      ],
+      "parent": [],
+      "grouped_products": [],
+      "menu_order": 0
+    }
+  ]
+}
+

Delete a Product

+

This API helps you delete a product.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/products/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/products/546?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/546?force=true', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('products/546', ['force' => true])); ?>
+
print(wcapi.delete("products/546", params={"force": True}).json())
+
woocommerce.delete("products/546, force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted product"
+}
+

Parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the product, defaults to false. Note that permanently deleting the product will return HTTP 200 rather than HTTP 202.
+

View Products Count

+

This API lets you retrieve a count of all products.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/products/count
+
+
+
curl https://example.com/wc-api/v3/products/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/count')); ?>
+
print(wcapi.get("products/count").json())
+
woocommerce.get("products/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 2
+}
+

Available Filters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilterTypeDescription
typestringProducts by type. eg: simple or variable.
categorystringProducts by category.
tagstringProducts by tag.
shipping_classstringProducts by shipping class.
pa_*stringProducts by attributes. eg: filter[pa_color]=black
skustringFilter a product by SKU.
+ + +

View List of Product Orders

+

This API lets you retrieve all product orders.

+ +
+
+ GET +
/wc-api/v3/products/<id>/orders
+
+
+
curl https://example.com/wc-api/v3/products/546/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/546/orders', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/546/orders')); ?>
+
print(wcapi.get("products/546/orders").json())
+
woocommerce.get("products/546/orders").parsed_response
+
+
+

JSON response example:

+
+
{
+  "orders": [
+    {
+      "id": 645,
+      "order_number": 645,
+      "created_at": "2015-01-26T20:00:21Z",
+      "updated_at": "2015-07-31T11:45:12Z",
+      "completed_at": "2015-01-26T20:00:21Z",
+      "status": "processing",
+      "currency": "USD",
+      "total": "79.87",
+      "subtotal": "63.97",
+      "total_line_items_quantity": 3,
+      "total_tax": "5.90",
+      "total_shipping": "10.00",
+      "cart_tax": "5.40",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Local Delivery",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": true
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "WordPress/4.1; http://example.com",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/645",
+      "line_items": [
+        {
+          "id": 504,
+          "subtotal": "43.98",
+          "subtotal_tax": "4.40",
+          "total": "43.98",
+          "total_tax": "4.40",
+          "price": "21.99",
+          "quantity": 2,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 505,
+          "subtotal": "19.99",
+          "subtotal_tax": "1.00",
+          "total": "19.99",
+          "total_tax": "1.00",
+          "price": "19.99",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Ship Your Idea",
+          "product_id": 613,
+          "sku": "",
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 506,
+          "method_id": "flat_rate",
+          "method_title": "Local Delivery",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 507,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 508,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    },
+    {
+      "id": 644,
+      "order_number": 644,
+      "created_at": "2015-01-26T19:33:42Z",
+      "updated_at": "2015-07-31T11:45:12Z",
+      "completed_at": "2015-01-26T19:33:42Z",
+      "status": "on-hold",
+      "currency": "USD",
+      "total": "44.14",
+      "subtotal": "30.99",
+      "total_line_items_quantity": 2,
+      "total_tax": "3.15",
+      "total_shipping": "10.00",
+      "cart_tax": "2.65",
+      "shipping_tax": "0.50",
+      "total_discount": "0.00",
+      "shipping_methods": "Flat Rate",
+      "payment_details": {
+        "method_id": "bacs",
+        "method_title": "Direct Bank Transfer",
+        "paid": false
+      },
+      "billing_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping_address": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "note": "",
+      "customer_ip": "127.0.0.1",
+      "customer_user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36",
+      "customer_id": 2,
+      "view_order_url": "https://example.com/my-account/view-order/644",
+      "line_items": [
+        {
+          "id": 499,
+          "subtotal": "21.99",
+          "subtotal_tax": "2.20",
+          "total": "21.99",
+          "total_tax": "2.20",
+          "price": "21.99",
+          "quantity": 1,
+          "tax_class": "reduced-rate",
+          "name": "Premium Quality",
+          "product_id": 546,
+          "sku": "",
+          "meta": []
+        },
+        {
+          "id": 500,
+          "subtotal": "9.00",
+          "subtotal_tax": "0.45",
+          "total": "9.00",
+          "total_tax": "0.45",
+          "price": "9.00",
+          "quantity": 1,
+          "tax_class": null,
+          "name": "Woo Album #4",
+          "product_id": 96,
+          "sku": "",
+          "meta": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 501,
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "10.00"
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 502,
+          "rate_id": "5",
+          "code": "US-CA-TAX-1",
+          "title": "Tax",
+          "total": "4.40",
+          "compound": false
+        },
+        {
+          "id": 503,
+          "rate_id": "4",
+          "code": "US-STANDARD-1",
+          "title": "Standard",
+          "total": "1.50",
+          "compound": false
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "customer": {
+        "id": 2,
+        "created_at": "2014-11-19T18:34:19Z",
+        "email": "john.doe@example.com",
+        "first_name": "",
+        "last_name": "",
+        "username": "john.doe",
+        "last_order_id": "645",
+        "last_order_date": "2015-01-26T20:00:21Z",
+        "orders_count": 2,
+        "total_spent": "19.00",
+        "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
+        "billing_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US",
+          "email": "john.doe@example.com",
+          "phone": "(555) 555-5555"
+        },
+        "shipping_address": {
+          "first_name": "John",
+          "last_name": "Doe",
+          "company": "",
+          "address_1": "969 Market",
+          "address_2": "",
+          "city": "San Francisco",
+          "state": "CA",
+          "postcode": "94103",
+          "country": "US"
+        }
+      }
+    }
+  ]
+}
+
+ +

View List of Product Reviews

+

This API lets you retrieve all reviews of a product.

+ +
+
+ GET +
/wc-api/v3/products/<id>/reviews
+
+
+
curl https://example.com/wc-api/v3/products/546/reviews \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/546/reviews', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/546/reviews')); ?>
+
print(wcapi.get("products/546/reviews").json())
+
woocommerce.get("products/546/reviews").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_reviews": [
+    {
+      "id": 4,
+      "created_at": "2013-06-07T11:57:45Z",
+      "review": "This t-shirt is awesome! Would recommend to everyone!\n\nI'm ordering mine next week",
+      "rating": "5",
+      "reviewer_name": "Andrew",
+      "reviewer_email": "andrew@example.com",
+      "verified": false
+    },
+    {
+      "id": 3,
+      "created_at": "2013-06-07T11:53:49Z",
+      "review": "Wonderful quality, and an awesome design. WooThemes ftw!",
+      "rating": "4",
+      "reviewer_name": "Cobus Bester",
+      "reviewer_email": "cobus@example.com",
+      "verified": false
+    }
+  ]
+}
+

Product Reviews Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerReview ID (comment ID) read-only
created_atstringUTC DateTime when the review was created read-only
ratingstringReview rating (0 to 5) read-only
reviewer_namestringReviewer name read-only
reviewer_emailstringReviewer email read-only
verifiedbooleanShows if the reviewer bought the product or not read-only
+

Product - Attributes

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product attributes.

+

Product Attribute Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID read-only
namestringAttribute name
slugstringAttribute slug
typestringAttribute type, the types available include by default are: select and text (some plugins can include new types)
order_bystringDefault sort order. Available: menu_order, name, name_num and id
has_archivesbooleanEnable/Disable attribute archives
+

Create a Product Attribute

+

This API helps you to create a new product attribute.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products/attributes
+
+
+
curl -X POST https://example.com/wc-api/v3/products/attributes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_attribute": {
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": true
+  }
+}'
+
var data = {
+  product_attribute: {
+    name: 'Color',
+    slug: 'pa_color',
+    type: 'select',
+    order_by: 'menu_order',
+    has_archives: true
+  }
+};
+
+WooCommerce.post('products/attributes', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_attribute' => [
+        'name' => 'Color',
+        'slug' => 'pa_color',
+        'type' => 'select',
+        'order_by' => 'menu_order',
+        'has_archives' => true
+    ]
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+
data = {
+    "product_attribute": {
+        "name": "Color",
+        "slug": "pa_color",
+        "type": "select",
+        "order_by": "menu_order",
+        "has_archives": True
+    }
+}
+
+print(wcapi.post("products/attributes", data).json())
+
data = {
+  product_attribute: {
+    name: "Color",
+    slug: "pa_color",
+    type: "select",
+    order_by: "menu_order",
+    has_archives: true
+  }
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute": {
+    "id": 1,
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": true
+  }
+}
+

View a Product Attribute

+

This API lets you retrieve and view a specific product attribute by ID.

+ +
+
+ GET +
/wc-api/v3/products/attributes/<id>
+
+
+
curl https://example.com/wc-api/v3/products/attributes/1 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/attributes/1', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/attributes/1')); ?>
+
print(wcapi.get("products/attributes/1").json())
+
woocommerce.get("products/attributes/1").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute": {
+    "id": 1,
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": true
+  }
+}
+

View List of Product Attributes

+

This API helps you to view all the product attributes.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/products/attributes
+
+
+
curl https://example.com/wc-api/v3/products/attributes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/attributes', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/attributes')); ?>
+
print(wcapi.get("products/attributes").json())
+
woocommerce.get("products/attributes").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attributes": [
+    {
+      "id": 1,
+      "name": "Color",
+      "slug": "pa_color",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": true
+    },
+    {
+      "id": 2,
+      "name": "Size",
+      "slug": "pa_size",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false
+    }
+  ]
+}
+

Update a Product Attribute

+

This API lets you make changes to a product attribute.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/products/attributes/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/products/attributes/1 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_attribute": {
+    "order_by": "name"
+  }
+}'
+
var data = {
+  product_attribute: {
+    order_by: 'name'
+  }
+};
+
+WooCommerce.put('products/attributes/1', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_attribute' => [
+        'order_by' => 'name'
+    ]
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+
data = {
+    "product_attribute": {
+        "order_by": "name"
+    }
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+
data = {
+  product_attribute: {
+    order_by: "name"
+  }
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute": {
+    "id": 1,
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "name",
+    "has_archives": true
+  }
+}
+

Delete a Product Attribute

+

This API helps you delete a product attribute.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/products/attributes/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/products/attributes/1 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/attributes/1', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('products/attributes/1')); ?>
+
print(wcapi.delete("products/attributes/1").json())
+
woocommerce.delete("products/attributes/1").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted product_attribute"
+}
+

Product - Attribute Terms

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product attribute terms.

+

Product Attribute Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTerm ID (term ID) read-only
namestringTerm name required
slugstringTerm slug
countintegerShows the quantity of products in this term read-only
+

Create a Product Attribute Term

+

This API helps you to create a new product attribute term.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products/attributes/<attribute_id>/terms
+
+
+
curl -X POST https://example.com/wc-api/v3/products/attributes/1/terms \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_attribute_term": {
+    "name": "Black"
+  }
+}'
+
var data = {
+  product_attribute_term: {
+    name: 'Black'
+  }
+};
+
+WooCommerce.post('products/attributes/1/terms', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_attribute_term' => [
+        'name' => 'Black'
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/1/terms', $data));
+?>
+
data = {
+    "product_attribute_term": {
+        "name": "Black"
+    }
+}
+
+print(wcapi.post("products/attributes/1/terms", data).json())
+
data = {
+  product_attribute_term: {
+    name: "Black"
+  }
+}
+
+woocommerce.post("products/attributes/1/terms", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute_term": {
+    "id": 18,
+    "name": "Black",
+    "slug": "black",
+    "count": 0
+  }
+}
+
+ +

View a Product Attribute Term

+

This API lets you retrieve a product attribute term by ID.

+ +
+
+ GET +
/wc-api/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl https://example.com/wc-api/v3/products/attributes/1/terms/18 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/attributes/1/terms/18', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/attributes/1/terms/18')); ?>
+
print(wcapi.get("products/attributes/1/terms/18").json())
+
woocommerce.get("products/attributes/1/terms/18").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute_term": {
+    "id": 18,
+    "name": "Black",
+    "slug": "black",
+    "count": 5
+  }
+}
+
+ +

View List of Product Attribute Terms

+

This API lets you retrieve all terms from a product attribute.

+ +
+
+ GET +
/wc-api/v3/products/attributes/<attribute_id>/terms
+
+
+
curl https://example.com/wc-api/v3/products/attributes/1/terms \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/attributes/1/terms', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/attributes/1/terms')); ?>
+
print(wcapi.get("products/attributes/1/terms").json())
+
woocommerce.get("products/attributes/1/terms").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute_terms": [
+    {
+      "id": 18,
+      "slug": "black",
+      "name": "Black",
+      "count": 5
+    },
+    {
+      "id": 20,
+      "slug": "blue",
+      "name": "Blue",
+      "count": 4
+    },
+    {
+      "id": 19,
+      "slug": "green",
+      "name": "Green",
+      "count": 4
+    },
+    {
+      "id": 24,
+      "slug": "pink",
+      "name": "Pink",
+      "count": 3
+    },
+    {
+      "id": 22,
+      "slug": "red",
+      "name": "Red",
+      "count": 3
+    },
+    {
+      "id": 21,
+      "slug": "white",
+      "name": "White",
+      "count": 3
+    },
+    {
+      "id": 23,
+      "slug": "yellow",
+      "name": "Yellow",
+      "count": 3
+    }
+  ]
+}
+
+ +

Update a Product Attribute Term

+

This API lets you make changes to a product attribute term.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/products/attributes/1/terms/18 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_attribute_term": {
+    "name": "BLACK"
+  }
+}'
+
var data = {
+  product_attribute_term: {
+    name: 'BLACK'
+  }
+};
+
+WooCommerce.put('products/attributes/1/terms/18', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_attribute_term' => [
+        'name' => 'BLACK'
+    ]
+];
+
+print_r($woocommerce->put('products/attributes/1/terms/18', $data));
+?>
+
data = {
+    "product_attribute_term": {
+        "name": "BLACK"
+    }
+}
+
+print(wcapi.put("products/attributes/1/terms/18", data).json())
+
data = {
+  product_attribute_term: {
+    name: "BLACK"
+  }
+}
+
+woocommerce.put("products/attributes/1/terms/18", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_attribute_term": {
+    "id": 18,
+    "name": "BLACK",
+    "slug": "black",
+    "count": 5
+  }
+}
+
+ +

Delete a Product Attribute Term

+

This API helps you delete a product attribute term.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/products/attributes/1/terms/18 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/attributes/1/terms/18', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('products/attributes/1/terms/18')); ?>
+
print(wcapi.delete("products/attributes/1/terms/18").json())
+
woocommerce.delete("products/attributes/1/terms/18").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted product_attribute_term"
+}
+
+ +

Product - Categories

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product categories.

+

Product Category Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCategory ID (term ID) read-only
namestringCategory name required
slugstringCategory slug
parentintegerCategory parent
descriptionstringCategory description
displaystringCategory archive display type, the types available include: default, products, subcategories and both
imagestringCategory image URL
countintegerShows the quantity of products in this category read-only
+

Create a Product Category

+

This API helps you to create a new product category.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products/categories
+
+
+ +
+

Example of how to create a product category:

+
+
curl -X POST https://example.com/wc-api/v3/products/categories \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_category": {
+    "name": "Clothing"
+  }
+}'
+
var data = {
+  product_category: {
+    name: 'Clothing'
+  }
+};
+
+WooCommerce.post('products/categories', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_category' => [
+        'name' => 'Clothing'
+    ]
+];
+
+print_r($woocommerce->post('products/categories', $data));
+?>
+
data = {
+    "product_category": {
+        "name": "Clothing"
+    }
+}
+
+print(wcapi.post("products/categories", data).json())
+
data = {
+  product_category: {
+    name: "Clothing"
+  }
+}
+
+woocommerce.post("products/categories", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_category": {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": "",
+    "count": 0
+  }
+}
+
+ +

View a Product Category

+

This API lets you retrieve a product category by ID.

+ +
+
+ GET +
/wc-api/v3/products/categories/<id>
+
+
+
curl https://example.com/wc-api/v3/products/categories/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/categories/9', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/categories/9')); ?>
+
print(wcapi.get("products/categories/9").json())
+
woocommerce.get("products/categories/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_category": {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": "",
+    "count": 23
+  }
+}
+

View List of Product Categories

+

This API lets you retrieve all product categories.

+ +
+
+ GET +
/wc-api/v3/products/categories
+
+
+
curl https://example.com/wc-api/v3/products/categories \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/categories', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/categories')); ?>
+
print(wcapi.get("products/categories").json())
+
woocommerce.get("products/categories").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_categories": [
+    {
+      "id": 15,
+      "name": "Albums",
+      "slug": "albums",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 4
+    },
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 23
+    },
+    {
+      "id": 10,
+      "name": "Hoodies",
+      "slug": "hoodies",
+      "parent": 9,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 6
+    },
+    {
+      "id": 11,
+      "name": "Music",
+      "slug": "music",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 6
+    },
+    {
+      "id": 12,
+      "name": "Posters",
+      "slug": "posters",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 5
+    },
+    {
+      "id": 13,
+      "name": "Singles",
+      "slug": "singles",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 2
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts",
+      "parent": 9,
+      "description": "",
+      "display": "default",
+      "image": "",
+      "count": 17
+    }
+  ]
+}
+

Update a Product Category

+

This API lets you make changes to a product category.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/products/categories/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/products/categories/9 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_category": {
+    "description": "All kinds of clothes."
+  }
+}'
+
var data = {
+  product_category: {
+    description: 'All kinds of clothes.'
+  }
+};
+
+WooCommerce.put('products/categories/9', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_category' => [
+        'description' => 'All kinds of clothes.'
+    ]
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+
data = {
+    "product_category": {
+        "description": "All kinds of clothes."
+    }
+}
+
+print(wcapi.put("products/categories/9", data).json())
+
data = {
+  product_category: {
+    description: "All kinds of clothes."
+  }
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_category": {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "All kinds of clothes.",
+    "display": "default",
+    "image": "",
+    "count": 23
+  }
+}
+
+ +

Delete a Product Category

+

This API helps you delete a product category.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/products/categories/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/products/categories/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/categories/9', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('products/categories/9')); ?>
+
print(wcapi.delete("products/categories/9").json())
+
woocommerce.delete("products/categories/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted product_category"
+}
+
+ +

Product - Shipping Classes

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product shipping classes.

+

Product Shipping Class Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerShipping Class ID (term ID) read-only
namestringShipping Class name required
slugstringShipping Class slug
parentintegerShipping Class parent
descriptionstringShipping Class description
countintegerShows the quantity of products in this shipping class read-only
+

Create a Product Shipping Class

+

This API helps you to create a new product shipping class.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products/shipping_classes
+
+
+ +
+

Example of how to create a product shipping class:

+
+
curl -X POST https://example.com/wc-api/v3/products/shipping_classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_shipping_class": {
+    "name": "Priority"
+  }
+}'
+
var data = {
+  product_shipping_class: {
+    name: 'Priority'
+  }
+};
+
+WooCommerce.post('products/shipping_classes', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_shipping_class' => [
+        'name' => 'Priority'
+    ]
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+
data = {
+    "product_shipping_class": {
+        "name": "Priority"
+    }
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+
data = {
+  product_shipping_class: {
+    name: "Priority"
+  }
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_shipping_class": {
+    "id": 35,
+    "name": "Priority",
+    "slug": "priority",
+    "parent": 0,
+    "description": "",
+    "count": 0
+  }
+}
+
+ +

View a Product Shipping Class

+

This API lets you retrieve a product shipping class by ID.

+ +
+
+ GET +
/wc-api/v3/products/shipping_classes/<id>
+
+
+
curl https://example.com/wc-api/v3/products/shipping_classes/35 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/shipping_classes/35', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/shipping_classes/35')); ?>
+
print(wcapi.get("products/shipping_classes/35").json())
+
woocommerce.get("products/shipping_classes/35").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_shipping_class": {
+    "id": 35,
+    "name": "Priority",
+    "slug": "priority",
+    "parent": 0,
+    "description": "",
+    "count": 0
+  }
+}
+
+ +

View List of Product Shipping Classes

+

This API lets you retrieve all product shipping classes.

+ +
+
+ GET +
/wc-api/v3/products/shipping_classes
+
+
+
curl https://example.com/wc-api/v3/products/shipping_classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/shipping_classes', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+
print(wcapi.get("products/shipping_classes").json())
+
woocommerce.get("products/shipping_classes").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_shipping_classes": [
+    {
+      "id": 30,
+      "name": "Express",
+      "slug": "express",
+      "parent": 0,
+      "description": "",
+      "count": 1
+    },
+    {
+      "id": 35,
+      "name": "Priority",
+      "slug": "priority",
+      "parent": 0,
+      "description": "",
+      "count": 0
+    }
+  ]
+}
+
+ +

Update a Product Shipping Class

+

This API lets you make changes to a product shipping class.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/products/shipping_classes/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/products/shipping_classes/35 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_shipping_class": {
+    "description": "Priority mail."
+  }
+}'
+
var data = {
+  product_shipping_class: {
+    description: 'Priority mail.'
+  }
+};
+
+WooCommerce.put('products/shipping_classes/35', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_shipping_class' => [
+        'description' => 'Priority mail.'
+    ]
+];
+
+print_r($woocommerce->put('products/shipping_classes/35', $data));
+?>
+
data = {
+    "product_shipping_class": {
+        "description": "Priority mail."
+    }
+}
+
+print(wcapi.put("products/shipping_classes/35", data).json())
+
data = {
+  product_shipping_class: {
+    description: "Priority mail."
+  }
+}
+
+woocommerce.put("products/shipping_classes/35", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_shipping_class": {
+    "id": 35,
+    "name": "Priority",
+    "slug": "priority",
+    "parent": 0,
+    "description": "Priority mail.",
+    "count": 0
+  }
+}
+
+ +

Delete a Product Shipping Class

+

This API helps you delete a product shipping class.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/products/shipping_classes/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/products/shipping_classes/35 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/shipping_classes/35', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('products/shipping_classes/35')); ?>
+
print(wcapi.delete("products/shipping_classes/35").json())
+
woocommerce.delete("products/shipping_classes/35").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted product_shipping_class"
+}
+
+ +

Product - Tags

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product tags.

+

Product Tag Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTag ID (term ID) read-only
namestringTag name required
slugstringTag slug
descriptionstringTag description
countintegerShows the quantity of products in this tag read-only
+

Create a Product Tag

+

This API helps you to create a new product tag.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/products/tags
+
+
+ +
+

Example of how to create a product tag:

+
+
curl -X POST https://example.com/wc-api/v3/products/tags \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_tag": {
+    "name": "Leather Shoes"
+  }
+}'
+
var data = {
+  product_tag: {
+    name: 'Leather Shoes'
+  }
+};
+
+WooCommerce.post('products/tags', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_tag': [
+        'name' => 'Leather Shoes'
+    ]
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+
data = {
+    "product_tag": {
+        "name": "Leather Shoes"
+    }
+}
+
+print(wcapi.post("products/tags", data).json())
+
data = {
+  product_tag: {
+    name: "Leather Shoes"
+  }
+}
+
+woocommerce.post("products/tags", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_tag": {
+    "id": 37,
+    "name": "Leather Shoes",
+    "slug": "leather-shoes",
+    "description": "",
+    "count": 0
+  }
+}
+
+ +

View a Product Tag

+

This API lets you retrieve a product tag by ID.

+ +
+
+ GET +
/wc-api/v3/products/tags/<id>
+
+
+
curl https://example.com/wc-api/v3/products/tags/37 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/tags/37', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/tags/37')); ?>
+
print(wcapi.get("products/tags/37").json())
+
woocommerce.get("products/tags/37").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_tag": {
+    "id": 37,
+    "name": "Leather Shoes",
+    "slug": "leather-shoes",
+    "description": "",
+    "count": 0
+  }
+}
+
+ +

View List of Product Tags

+

This API lets you retrieve all product tag.

+ +
+
+ GET +
/wc-api/v3/products/tags
+
+
+
curl https://example.com/wc-api/v3/products/tags \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('products/tags', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('products/tags')); ?>
+
print(wcapi.get("products/tags").json())
+
woocommerce.get("products/tags").parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_tags": [
+    {
+      "id": 37,
+      "name": "Leather Shoes",
+      "slug": "leather-shoes",
+      "description": "",
+      "count": 0
+    },
+    {
+      "id": 38,
+      "name": "Oxford Shoes",
+      "slug": "oxford-shoes",
+      "description": "",
+      "count": 0
+    }
+  ]
+}
+
+ +

Update a Product Tag

+

This API lets you make changes to a product tag.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/products/tags/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/products/tags/37 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "product_tag": {
+    "description": "Genuine leather."
+  }
+}'
+
var data = {
+  product_tag: {
+    description: 'Genuine leather.'
+  }
+};
+
+WooCommerce.put('products/tags/37', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'product_tag': [
+        'description': 'Genuine leather.'
+    ]
+];
+
+print_r($woocommerce->put('products/tags/37', $data));
+?>
+
data = {
+    "product_tag": {
+        "description": "Genuine leather."
+    }
+}
+
+print(wcapi.put("products/tags/37", data).json())
+
data = {
+  product_tag: {
+    description: "Genuine leather."
+  }
+}
+
+woocommerce.put("products/tags/37", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "product_tag": {
+    "id": 37,
+    "name": "Leather Shoes",
+    "slug": "leather-shoes",
+    "description": "Genuine leather.",
+    "count": 0
+  }
+}
+
+ +

Delete a Product Tag

+

This API helps you delete a product tag.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/products/tags/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/products/tags/37 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('products/tags/37', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('products/tags/37')); ?>
+
print(wcapi.delete("products/tags/37").json())
+
woocommerce.delete("products/tags/37").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted product_tag"
+}
+
+ +

Reports

+

This section lists all API endpoints that can be used view reports.

+

Reports Filters

+

Use the following filters for any type of report to specify the period of sales:

+ + + + + + + + + + + + + + + + + + + + + + + +
FilterTypeDescription
periodstringThe supported periods are: week, month, last_month, and year. If you use an invalid period, week is used. If you don't specify a period, the current day is used
date_minstringReturn sales for a specific start date. The date need to be in the YYYY-MM-DD format
date_maxstringReturn sales for a specific end date. The dates need to be in the YYYY-MM-DD format. Required to set the filter[date_min] too
+

View List of Reports

+

This API lets you retrieve and view a simple list of available reports.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/reports
+
+
+
curl https://example.com/wc-api/v3/reports \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('reports', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('reports')); ?>
+
print(wcapi.get("reports").json())
+
woocommerce.get("reports").parsed_response
+
+
+

JSON response example:

+
+
{
+  "reports": [
+    "sales",
+    "sales/top_sellers"
+  ]
+}
+

View List of Sales Report

+

This API lets you retrieve and view a list of sales report.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/reports/sales
+
+
+
curl https://example.com/wc-api/v3/reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21', function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$query = [
+    'filter' => [
+        'date_min' => '2015-01-18', 
+        'date_max' => '2015-01-21'
+    ]
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+
print(wcapi.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21").json())
+
query = {
+  filter: {
+    date_min: "2015-01-18",
+    date_max: "2015-01-21"
+  }
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+
+
+

JSON response example:

+
+
{
+  "sales": {
+    "total_sales": "580.10",
+    "average_sales": "145.03",
+    "total_orders": 4,
+    "total_items": 31,
+    "total_tax": "26.10",
+    "total_shipping": "20.00",
+    "total_discount": "0.00",
+    "totals_grouped_by": "day",
+    "totals": {
+      "2015-01-18": {
+        "sales": "-17.00",
+        "orders": 1,
+        "items": 1,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2015-01-19": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2015-01-20": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2015-01-21": {
+        "sales": "597.10",
+        "orders": 3,
+        "items": 30,
+        "tax": "26.10",
+        "shipping": "20.00",
+        "discount": "0.00",
+        "customers": 0
+      }
+    },
+    "total_customers": 0
+  }
+}
+

View List of Top Sellers Report

+

This API lets you retrieve and view a list of top sellers report.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/reports/sales/top_sellers
+
+
+
curl https://example.com/wc-api/v3/reports/sales/top_sellers?filter[period]=last_month \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('reports/sales/top_sellers?filter[period]=last_month', function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$query = [
+    'filter' => [
+        'period' => 'last_month'
+    ]
+];
+
+print_r($woocommerce->get('reports/sales/top_sellers', $query));
+?>
+
print(wcapi.get("reports/sales/top_sellers?filter[period]=last_month").json())
+
query = {
+  filter: {
+    period: "last_month"
+  }
+}
+
+woocommerce.get("reports/sales/top_sellers", query).parsed_response
+
+
+

JSON response example:

+
+
{
+  "top_sellers": [
+    {
+      "title": "Happy Ninja",
+      "product_id": "37",
+      "quantity": "24"
+    },
+    {
+      "title": "Flying Ninja",
+      "product_id": "70",
+      "quantity": "14"
+    },
+    {
+      "title": "Happy Ninja",
+      "product_id": "53",
+      "quantity": "6"
+    },
+    {
+      "title": "Ninja Silhouette",
+      "product_id": "31",
+      "quantity": "3"
+    },
+    {
+      "title": "Woo Logo",
+      "product_id": "15",
+      "quantity": "3"
+    },
+    {
+      "title": "Woo Album #1",
+      "product_id": "83",
+      "quantity": "3"
+    },
+    {
+      "title": "Woo Album #4",
+      "product_id": "96",
+      "quantity": "1"
+    },
+    {
+      "title": "Premium Quality",
+      "product_id": "19",
+      "quantity": "1"
+    },
+    {
+      "title": "Ninja Silhouette",
+      "product_id": "56",
+      "quantity": "1"
+    }
+  ]
+}
+

Taxes

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate tax rates.

+

Taxes Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTax rate ID read-only
countrystringCountry code. See ISO 3166 Codes (Countries) for more details
statestringState code
postcodestringPostcode/ZIP
citystringCity name
ratestringTax rate
namestringTax rate name
priorityintegerTax priority. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate. Default is 1
compoundbooleanChoose whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is false
shippingbooleanChoose whether or not this tax rate also gets applied to shipping. Default is true
orderintegerIndicates the order that will appear in queries
classstringTax class. Default is standard
+

Create a Tax Rate

+

This API helps you to create a new tax rate.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/taxes
+
+
+
curl -X POST https://example.com/wc-api/v3/taxes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "tax": {
+    "country": "US",
+    "state": "AL",
+    "rate": "4",
+    "name": "State Tax",
+    "shipping": false
+  }
+}'
+
var data = {
+  tax: {
+    country: 'US',
+    state: 'AL',
+    rate: '4',
+    name: 'State Tax',
+    shipping: false
+  }
+};
+
+WooCommerce.post('taxes', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'tax' => [
+        'country' => 'US',
+        'state' => 'AL',
+        'rate' => '4',
+        'name' => 'State Tax',
+        'shipping' => false
+    ]
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+
data = {
+    "tax": {
+        "country": "US",
+        "state": "AL",
+        "rate": "4",
+        "name": "State Tax",
+        "shipping": False
+    }
+}
+
+print(wcapi.post("taxes", data).json())
+
data = {
+  tax: {
+    country: "US",
+    state: "AL",
+    rate: "4",
+    name: "State Tax",
+    shipping: false
+  }
+}
+
+woocommerce.post("taxes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "tax": {
+    "id": 53,
+    "country": "US",
+    "state": "AL",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 1,
+    "compound": false,
+    "shipping": false,
+    "order": 0,
+    "class": "standard"
+  }
+}
+
+ +

View a Tax Rate

+

This API lets you retrieve and view a specific tax rate by ID.

+ +
+
+ GET +
/wc-api/v3/taxes/<id>
+
+
+
curl https://example.com/wc-api/v3/taxes/53 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('taxes/53', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('taxes/53')); ?>
+
print(wcapi.get("taxes/53").json())
+
woocommerce.get("taxes/53").parsed_response
+
+
+

JSON response example:

+
+
{
+  "tax": {
+    "id": 53,
+    "country": "US",
+    "state": "AL",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 1,
+    "compound": false,
+    "shipping": false,
+    "order": 0,
+    "class": "standard"
+  }
+}
+
+ +

View List of Tax Rates

+

This API helps you to view all the tax rates.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/taxes
+
+
+
curl https://example.com/wc-api/v3/taxes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('taxes', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('taxes')); ?>
+
print(wcapi.get("taxes").json())
+
woocommerce.get("taxes").parsed_response
+
+
+

JSON response example:

+
+
{
+  "taxes": [
+    {
+      "id": 53,
+      "country": "US",
+      "state": "AL",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 1,
+      "class": "standard"
+    },
+    {
+      "id": 54,
+      "country": "US",
+      "state": "AZ",
+      "postcode": "",
+      "city": "",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 2,
+      "class": "standard"
+    },
+    {
+      "id": 55,
+      "country": "US",
+      "state": "AR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 3,
+      "class": "standard"
+    },
+    {
+      "id": 56,
+      "country": "US",
+      "state": "CA",
+      "postcode": "",
+      "city": "",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 4,
+      "class": "standard"
+    },
+    {
+      "id": 57,
+      "country": "US",
+      "state": "CO",
+      "postcode": "",
+      "city": "",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 5,
+      "class": "standard"
+    },
+    {
+      "id": 58,
+      "country": "US",
+      "state": "CT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 6,
+      "class": "standard"
+    },
+    {
+      "id": 59,
+      "country": "US",
+      "state": "DC",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 7,
+      "class": "standard"
+    },
+    {
+      "id": 60,
+      "country": "US",
+      "state": "FL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 8,
+      "class": "standard"
+    },
+    {
+      "id": 61,
+      "country": "US",
+      "state": "GA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 9,
+      "class": "standard"
+    },
+    {
+      "id": 62,
+      "country": "US",
+      "state": "GU",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 10,
+      "class": "standard"
+    },
+    {
+      "id": 63,
+      "country": "US",
+      "state": "HI",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 11,
+      "class": "standard"
+    },
+    {
+      "id": 64,
+      "country": "US",
+      "state": "ID",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 12,
+      "class": "standard"
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
tax_rate_classstringTax rates by class. eg: standard, reduced-rate or zero-rate
+ + +

Update a Tax Rate

+

This API lets you make changes to a tax rate.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/taxes/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/taxes/53 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "tax": {
+    "name": "US Tax"
+  }
+}'
+
var data = {
+  tax: {
+    name: 'US Tax'
+  }
+};
+
+WooCommerce.put('taxes/53', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'tax' => [
+        'name' => 'US Tax'
+    ]
+];
+
+print_r($woocommerce->put('taxes/53', $data));
+?>
+
data = {
+    "tax": {
+        "name": "US Tax"
+    }
+}
+
+print(wcapi.put("taxes/53", data).json())
+
data = {
+  tax: {
+    name: "US Tax"
+  }
+}
+
+woocommerce.put("taxes/53", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "tax": {
+    "id": 53,
+    "country": "US",
+    "state": "AL",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "US Tax",
+    "priority": 1,
+    "compound": false,
+    "shipping": false,
+    "order": 0,
+    "class": "standard"
+  }
+}
+
+ +

Create/Update Multiple Tax Rates

+

This API helps you to bulk create/update multiple tax rates.

+ +

To update is necessary to send objects containing IDs and to create new not just send the ID.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/taxes/bulk
+
+
+ +
+

Example bulk creating all US taxes:

+
+
curl -X POST https://example.com/wc-api/v3/taxes/bulk \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "taxes": [
+    {
+      "country": "US",
+      "state": "AL",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 1
+    },
+    {
+      "country": "US",
+      "state": "AZ",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 2
+    },
+    {
+      "country": "US",
+      "state": "AR",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 3
+    },
+    {
+      "country": "US",
+      "state": "CA",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 4
+    },
+    {
+      "country": "US",
+      "state": "CO",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 5
+    },
+    {
+      "country": "US",
+      "state": "CT",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 6
+    },
+    {
+      "country": "US",
+      "state": "DC",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 7
+    },
+    {
+      "country": "US",
+      "state": "FL",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 8
+    },
+    {
+      "country": "US",
+      "state": "GA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 9
+    },
+    {
+      "country": "US",
+      "state": "GU",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 10
+    },
+    {
+      "country": "US",
+      "state": "HI",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 11
+    },
+    {
+      "country": "US",
+      "state": "ID",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 12
+    },
+    {
+      "country": "US",
+      "state": "IL",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 13
+    },
+    {
+      "country": "US",
+      "state": "IN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 14
+    },
+    {
+      "country": "US",
+      "state": "IA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 15
+    },
+    {
+      "country": "US",
+      "state": "KS",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 16
+    },
+    {
+      "country": "US",
+      "state": "KY",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 17
+    },
+    {
+      "country": "US",
+      "state": "LA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 18
+    },
+    {
+      "country": "US",
+      "state": "ME",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 19
+    },
+    {
+      "country": "US",
+      "state": "MD",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 20
+    },
+    {
+      "country": "US",
+      "state": "MA",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 21
+    },
+    {
+      "country": "US",
+      "state": "MI",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 22
+    },
+    {
+      "country": "US",
+      "state": "MN",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 23
+    },
+    {
+      "country": "US",
+      "state": "MS",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 24
+    },
+    {
+      "country": "US",
+      "state": "MO",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 25
+    },
+    {
+      "country": "US",
+      "state": "NE",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 26
+    },
+    {
+      "country": "US",
+      "state": "NV",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 27
+    },
+    {
+      "country": "US",
+      "state": "NJ",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 28
+    },
+    {
+      "country": "US",
+      "state": "NM",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 29
+    },
+    {
+      "country": "US",
+      "state": "NY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 30
+    },
+    {
+      "country": "US",
+      "state": "NC",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 31
+    },
+    {
+      "country": "US",
+      "state": "ND",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 32
+    },
+    {
+      "country": "US",
+      "state": "OH",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 33
+    },
+    {
+      "country": "US",
+      "state": "OK",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 34
+    },
+    {
+      "country": "US",
+      "state": "PA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 35
+    },
+    {
+      "country": "US",
+      "state": "PR",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 36
+    },
+    {
+      "country": "US",
+      "state": "RI",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 37
+    },
+    {
+      "country": "US",
+      "state": "SC",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 38
+    },
+    {
+      "country": "US",
+      "state": "SD",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 39
+    },
+    {
+      "country": "US",
+      "state": "TN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 40
+    },
+    {
+      "country": "US",
+      "state": "TX",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 41
+    },
+    {
+      "country": "US",
+      "state": "UT",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 42
+    },
+    {
+      "country": "US",
+      "state": "VT",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 43
+    },
+    {
+      "country": "US",
+      "state": "VA",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 44
+    },
+    {
+      "country": "US",
+      "state": "WA",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 45
+    },
+    {
+      "country": "US",
+      "state": "WV",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 46
+    },
+    {
+      "country": "US",
+      "state": "WI",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 47
+    },
+    {
+      "country": "US",
+      "state": "WY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 48
+    }
+  ]
+}'
+
var data = {
+  taxes: [
+    {
+      country: 'US',
+      state: 'AL',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 1
+    },
+    {
+      country: 'US',
+      state: 'AZ',
+      rate: '5.6000',
+      name: 'State Tax',
+      shipping: false,
+      order: 2
+    },
+    {
+      country: 'US',
+      state: 'AR',
+      rate: '6.5000',
+      name: 'State Tax',
+      shipping: true,
+      order: 3
+    },
+    {
+      country: 'US',
+      state: 'CA',
+      rate: '7.5000',
+      name: 'State Tax',
+      shipping: false,
+      order: 4
+    },
+    {
+      country: 'US',
+      state: 'CO',
+      rate: '2.9000',
+      name: 'State Tax',
+      shipping: false,
+      order: 5
+    },
+    {
+      country: 'US',
+      state: 'CT',
+      rate: '6.3500',
+      name: 'State Tax',
+      shipping: true,
+      order: 6
+    },
+    {
+      country: 'US',
+      state: 'DC',
+      rate: '5.7500',
+      name: 'State Tax',
+      shipping: true,
+      order: 7
+    },
+    {
+      country: 'US',
+      state: 'FL',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 8
+    },
+    {
+      country: 'US',
+      state: 'GA',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 9
+    },
+    {
+      country: 'US',
+      state: 'GU',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 10
+    },
+    {
+      country: 'US',
+      state: 'HI',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 11
+    },
+    {
+      country: 'US',
+      state: 'ID',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 12
+    },
+    {
+      country: 'US',
+      state: 'IL',
+      rate: '6.2500',
+      name: 'State Tax',
+      shipping: false,
+      order: 13
+    },
+    {
+      country: 'US',
+      state: 'IN',
+      rate: '7.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 14
+    },
+    {
+      country: 'US',
+      state: 'IA',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 15
+    },
+    {
+      country: 'US',
+      state: 'KS',
+      rate: '6.1500',
+      name: 'State Tax',
+      shipping: true,
+      order: 16
+    },
+    {
+      country: 'US',
+      state: 'KY',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 17
+    },
+    {
+      country: 'US',
+      state: 'LA',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 18
+    },
+    {
+      country: 'US',
+      state: 'ME',
+      rate: '5.5000',
+      name: 'State Tax',
+      shipping: false,
+      order: 19
+    },
+    {
+      country: 'US',
+      state: 'MD',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 20
+    },
+    {
+      country: 'US',
+      state: 'MA',
+      rate: '6.2500',
+      name: 'State Tax',
+      shipping: false,
+      order: 21
+    },
+    {
+      country: 'US',
+      state: 'MI',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 22
+    },
+    {
+      country: 'US',
+      state: 'MN',
+      rate: '6.8750',
+      name: 'State Tax',
+      shipping: true,
+      order: 23
+    },
+    {
+      country: 'US',
+      state: 'MS',
+      rate: '7.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 24
+    },
+    {
+      country: 'US',
+      state: 'MO',
+      rate: '4.2250',
+      name: 'State Tax',
+      shipping: false,
+      order: 25
+    },
+    {
+      country: 'US',
+      state: 'NE',
+      rate: '5.5000',
+      name: 'State Tax',
+      shipping: true,
+      order: 26
+    },
+    {
+      country: 'US',
+      state: 'NV',
+      rate: '6.8500',
+      name: 'State Tax',
+      shipping: false,
+      order: 27
+    },
+    {
+      country: 'US',
+      state: 'NJ',
+      rate: '7.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 28
+    },
+    {
+      country: 'US',
+      state: 'NM',
+      rate: '5.1250',
+      name: 'State Tax',
+      shipping: true,
+      order: 29
+    },
+    {
+      country: 'US',
+      state: 'NY',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 30
+    },
+    {
+      country: 'US',
+      state: 'NC',
+      rate: '4.7500',
+      name: 'State Tax',
+      shipping: true,
+      order: 31
+    },
+    {
+      country: 'US',
+      state: 'ND',
+      rate: '5.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 32
+    },
+    {
+      country: 'US',
+      state: 'OH',
+      rate: '5.7500',
+      name: 'State Tax',
+      shipping: true,
+      order: 33
+    },
+    {
+      country: 'US',
+      state: 'OK',
+      rate: '4.5000',
+      name: 'State Tax',
+      shipping: false,
+      order: 34
+    },
+    {
+      country: 'US',
+      state: 'PA',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 35
+    },
+    {
+      country: 'US',
+      state: 'PR',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 36
+    },
+    {
+      country: 'US',
+      state: 'RI',
+      rate: '7.0000',
+      name: 'State Tax',
+      shipping: false,
+      order: 37
+    },
+    {
+      country: 'US',
+      state: 'SC',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 38
+    },
+    {
+      country: 'US',
+      state: 'SD',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 39
+    },
+    {
+      country: 'US',
+      state: 'TN',
+      rate: '7.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 40
+    },
+    {
+      country: 'US',
+      state: 'TX',
+      rate: '6.2500',
+      name: 'State Tax',
+      shipping: true,
+      order: 41
+    },
+    {
+      country: 'US',
+      state: 'UT',
+      rate: '5.9500',
+      name: 'State Tax',
+      shipping: false,
+      order: 42
+    },
+    {
+      country: 'US',
+      state: 'VT',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 43
+    },
+    {
+      country: 'US',
+      state: 'VA',
+      rate: '5.3000',
+      name: 'State Tax',
+      shipping: false,
+      order: 44
+    },
+    {
+      country: 'US',
+      state: 'WA',
+      rate: '6.5000',
+      name: 'State Tax',
+      shipping: true,
+      order: 45
+    },
+    {
+      country: 'US',
+      state: 'WV',
+      rate: '6.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 46
+    },
+    {
+      country: 'US',
+      state: 'WI',
+      rate: '5.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 47
+    },
+    {
+      country: 'US',
+      state: 'WY',
+      rate: '4.0000',
+      name: 'State Tax',
+      shipping: true,
+      order: 48
+    }
+  ]
+};
+
+WooCommerce.post('taxes/bulk', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'taxes' => [
+        [
+            'country' => 'US',
+            'state' => 'AL',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 1
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AZ',
+            'rate' => '5.6000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 2
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AR',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 3
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CA',
+            'rate' => '7.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 4
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CO',
+            'rate' => '2.9000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 5
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CT',
+            'rate' => '6.3500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 6
+        ],
+        [
+            'country' => 'US',
+            'state' => 'DC',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 7
+        ],
+        [
+            'country' => 'US',
+            'state' => 'FL',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 8
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 9
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GU',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 10
+        ],
+        [
+            'country' => 'US',
+            'state' => 'HI',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 11
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ID',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 12
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IL',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 13
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 14
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 15
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KS',
+            'rate' => '6.1500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 16
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KY',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 17
+        ],
+        [
+            'country' => 'US',
+            'state' => 'LA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 18
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ME',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 19
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MD',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 20
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MA',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 21
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MI',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 22
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MN',
+            'rate' => '6.8750',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 23
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MS',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 24
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MO',
+            'rate' => '4.2250',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 25
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NE',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 26
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NV',
+            'rate' => '6.8500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 27
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NJ',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 28
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NM',
+            'rate' => '5.1250',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 29
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 30
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NC',
+            'rate' => '4.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 31
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ND',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 32
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OH',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 33
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OK',
+            'rate' => '4.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 34
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 35
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PR',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 36
+        ],
+        [
+            'country' => 'US',
+            'state' => 'RI',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 37
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SC',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 38
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SD',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 39
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 40
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TX',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 41
+        ],
+        [
+            'country' => 'US',
+            'state' => 'UT',
+            'rate' => '5.9500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 42
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VT',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 43
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VA',
+            'rate' => '5.3000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 44
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WA',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 45
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WV',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 46
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WI',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 47
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 48
+        ]
+    ]
+];
+
+print_r($woocommerce->post('taxes/bulk', $data));
+?>
+
data = {
+    "taxes": [
+        {
+            "country": "US",
+            "state": "AL",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 1
+        },
+        {
+            "country": "US",
+            "state": "AZ",
+            "rate": "5.6000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 2
+        },
+        {
+            "country": "US",
+            "state": "AR",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 3
+        },
+        {
+            "country": "US",
+            "state": "CA",
+            "rate": "7.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 4
+        },
+        {
+            "country": "US",
+            "state": "CO",
+            "rate": "2.9000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 5
+        },
+        {
+            "country": "US",
+            "state": "CT",
+            "rate": "6.3500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 6
+        },
+        {
+            "country": "US",
+            "state": "DC",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 7
+        },
+        {
+            "country": "US",
+            "state": "FL",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 8
+        },
+        {
+            "country": "US",
+            "state": "GA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 9
+        },
+        {
+            "country": "US",
+            "state": "GU",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 10
+        },
+        {
+            "country": "US",
+            "state": "HI",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 11
+        },
+        {
+            "country": "US",
+            "state": "ID",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 12
+        },
+        {
+            "country": "US",
+            "state": "IL",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 13
+        },
+        {
+            "country": "US",
+            "state": "IN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 14
+        },
+        {
+            "country": "US",
+            "state": "IA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 15
+        },
+        {
+            "country": "US",
+            "state": "KS",
+            "rate": "6.1500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 16
+        },
+        {
+            "country": "US",
+            "state": "KY",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 17
+        },
+        {
+            "country": "US",
+            "state": "LA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 18
+        },
+        {
+            "country": "US",
+            "state": "ME",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 19
+        },
+        {
+            "country": "US",
+            "state": "MD",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 20
+        },
+        {
+            "country": "US",
+            "state": "MA",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 21
+        },
+        {
+            "country": "US",
+            "state": "MI",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 22
+        },
+        {
+            "country": "US",
+            "state": "MN",
+            "rate": "6.8750",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 23
+        },
+        {
+            "country": "US",
+            "state": "MS",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 24
+        },
+        {
+            "country": "US",
+            "state": "MO",
+            "rate": "4.2250",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 25
+        },
+        {
+            "country": "US",
+            "state": "NE",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 26
+        },
+        {
+            "country": "US",
+            "state": "NV",
+            "rate": "6.8500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 27
+        },
+        {
+            "country": "US",
+            "state": "NJ",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 28
+        },
+        {
+            "country": "US",
+            "state": "NM",
+            "rate": "5.1250",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 29
+        },
+        {
+            "country": "US",
+            "state": "NY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 30
+        },
+        {
+            "country": "US",
+            "state": "NC",
+            "rate": "4.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 31
+        },
+        {
+            "country": "US",
+            "state": "ND",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 32
+        },
+        {
+            "country": "US",
+            "state": "OH",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 33
+        },
+        {
+            "country": "US",
+            "state": "OK",
+            "rate": "4.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 34
+        },
+        {
+            "country": "US",
+            "state": "PA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 35
+        },
+        {
+            "country": "US",
+            "state": "PR",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 36
+        },
+        {
+            "country": "US",
+            "state": "RI",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 37
+        },
+        {
+            "country": "US",
+            "state": "SC",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 38
+        },
+        {
+            "country": "US",
+            "state": "SD",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 39
+        },
+        {
+            "country": "US",
+            "state": "TN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 40
+        },
+        {
+            "country": "US",
+            "state": "TX",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 41
+        },
+        {
+            "country": "US",
+            "state": "UT",
+            "rate": "5.9500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 42
+        },
+        {
+            "country": "US",
+            "state": "VT",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 43
+        },
+        {
+            "country": "US",
+            "state": "VA",
+            "rate": "5.3000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 44
+        },
+        {
+            "country": "US",
+            "state": "WA",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 45
+        },
+        {
+            "country": "US",
+            "state": "WV",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 46
+        },
+        {
+            "country": "US",
+            "state": "WI",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 47
+        },
+        {
+            "country": "US",
+            "state": "WY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 48
+        }
+    ]
+}
+
+print(wcapi.post("taxes/bulk", data).json())
+
data = {
+  taxes: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+}
+
+woocommerce.post("taxes/bulk", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "taxes": [
+    {
+      "id": 53,
+      "country": "US",
+      "state": "AL",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 1,
+      "class": "standard"
+    },
+    {
+      "id": 54,
+      "country": "US",
+      "state": "AZ",
+      "postcode": "",
+      "city": "",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 2,
+      "class": "standard"
+    },
+    {
+      "id": 55,
+      "country": "US",
+      "state": "AR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 3,
+      "class": "standard"
+    },
+    {
+      "id": 56,
+      "country": "US",
+      "state": "CA",
+      "postcode": "",
+      "city": "",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 4,
+      "class": "standard"
+    },
+    {
+      "id": 57,
+      "country": "US",
+      "state": "CO",
+      "postcode": "",
+      "city": "",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 5,
+      "class": "standard"
+    },
+    {
+      "id": 58,
+      "country": "US",
+      "state": "CT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 6,
+      "class": "standard"
+    },
+    {
+      "id": 59,
+      "country": "US",
+      "state": "DC",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 7,
+      "class": "standard"
+    },
+    {
+      "id": 60,
+      "country": "US",
+      "state": "FL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 8,
+      "class": "standard"
+    },
+    {
+      "id": 61,
+      "country": "US",
+      "state": "GA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 9,
+      "class": "standard"
+    },
+    {
+      "id": 62,
+      "country": "US",
+      "state": "GU",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 10,
+      "class": "standard"
+    },
+    {
+      "id": 63,
+      "country": "US",
+      "state": "HI",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 11,
+      "class": "standard"
+    },
+    {
+      "id": 64,
+      "country": "US",
+      "state": "ID",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 12,
+      "class": "standard"
+    },
+    {
+      "id": 65,
+      "country": "US",
+      "state": "IL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 13,
+      "class": "standard"
+    },
+    {
+      "id": 66,
+      "country": "US",
+      "state": "IN",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 14,
+      "class": "standard"
+    },
+    {
+      "id": 67,
+      "country": "US",
+      "state": "IA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 15,
+      "class": "standard"
+    },
+    {
+      "id": 68,
+      "country": "US",
+      "state": "KS",
+      "postcode": "",
+      "city": "",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 16,
+      "class": "standard"
+    },
+    {
+      "id": 69,
+      "country": "US",
+      "state": "KY",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 17,
+      "class": "standard"
+    },
+    {
+      "id": 70,
+      "country": "US",
+      "state": "LA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 18,
+      "class": "standard"
+    },
+    {
+      "id": 71,
+      "country": "US",
+      "state": "ME",
+      "postcode": "",
+      "city": "",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 19,
+      "class": "standard"
+    },
+    {
+      "id": 72,
+      "country": "US",
+      "state": "MD",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 20,
+      "class": "standard"
+    },
+    {
+      "id": 73,
+      "country": "US",
+      "state": "MA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 21,
+      "class": "standard"
+    },
+    {
+      "id": 74,
+      "country": "US",
+      "state": "MI",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 22,
+      "class": "standard"
+    },
+    {
+      "id": 75,
+      "country": "US",
+      "state": "MN",
+      "postcode": "",
+      "city": "",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 23,
+      "class": "standard"
+    },
+    {
+      "id": 76,
+      "country": "US",
+      "state": "MS",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 24,
+      "class": "standard"
+    },
+    {
+      "id": 77,
+      "country": "US",
+      "state": "MO",
+      "postcode": "",
+      "city": "",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 25,
+      "class": "standard"
+    },
+    {
+      "id": 78,
+      "country": "US",
+      "state": "NE",
+      "postcode": "",
+      "city": "",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 26,
+      "class": "standard"
+    },
+    {
+      "id": 79,
+      "country": "US",
+      "state": "NV",
+      "postcode": "",
+      "city": "",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 27,
+      "class": "standard"
+    },
+    {
+      "id": 80,
+      "country": "US",
+      "state": "NJ",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 28,
+      "class": "standard"
+    },
+    {
+      "id": 81,
+      "country": "US",
+      "state": "NM",
+      "postcode": "",
+      "city": "",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 29,
+      "class": "standard"
+    },
+    {
+      "id": 82,
+      "country": "US",
+      "state": "NY",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 30,
+      "class": "standard"
+    },
+    {
+      "id": 83,
+      "country": "US",
+      "state": "NC",
+      "postcode": "",
+      "city": "",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 31,
+      "class": "standard"
+    },
+    {
+      "id": 84,
+      "country": "US",
+      "state": "ND",
+      "postcode": "",
+      "city": "",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 32,
+      "class": "standard"
+    },
+    {
+      "id": 85,
+      "country": "US",
+      "state": "OH",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 33,
+      "class": "standard"
+    },
+    {
+      "id": 86,
+      "country": "US",
+      "state": "OK",
+      "postcode": "",
+      "city": "",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 34,
+      "class": "standard"
+    },
+    {
+      "id": 87,
+      "country": "US",
+      "state": "PA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 35,
+      "class": "standard"
+    },
+    {
+      "id": 88,
+      "country": "US",
+      "state": "PR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 36,
+      "class": "standard"
+    },
+    {
+      "id": 89,
+      "country": "US",
+      "state": "RI",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 37,
+      "class": "standard"
+    },
+    {
+      "id": 90,
+      "country": "US",
+      "state": "SC",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 38,
+      "class": "standard"
+    },
+    {
+      "id": 91,
+      "country": "US",
+      "state": "SD",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 39,
+      "class": "standard"
+    },
+    {
+      "id": 92,
+      "country": "US",
+      "state": "TN",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 40,
+      "class": "standard"
+    },
+    {
+      "id": 93,
+      "country": "US",
+      "state": "TX",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 41,
+      "class": "standard"
+    },
+    {
+      "id": 94,
+      "country": "US",
+      "state": "UT",
+      "postcode": "",
+      "city": "",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 42,
+      "class": "standard"
+    },
+    {
+      "id": 95,
+      "country": "US",
+      "state": "VT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 43,
+      "class": "standard"
+    },
+    {
+      "id": 96,
+      "country": "US",
+      "state": "VA",
+      "postcode": "",
+      "city": "",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": false,
+      "order": 44,
+      "class": "standard"
+    },
+    {
+      "id": 97,
+      "country": "US",
+      "state": "WA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 45,
+      "class": "standard"
+    },
+    {
+      "id": 98,
+      "country": "US",
+      "state": "WV",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 46,
+      "class": "standard"
+    },
+    {
+      "id": 99,
+      "country": "US",
+      "state": "WI",
+      "postcode": "",
+      "city": "",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 47,
+      "class": "standard"
+    },
+    {
+      "id": 100,
+      "country": "US",
+      "state": "WY",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 1,
+      "compound": false,
+      "shipping": true,
+      "order": 48,
+      "class": "standard"
+    }
+  ]
+}
+
+ +

Delete a Tax Rate

+

This API helps you delete a tax rate.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/taxes/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/taxes/53 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('taxes/53', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('taxes/53')); ?>
+
print(wcapi.delete("taxes/53").json())
+
woocommerce.delete("taxes/53").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted tax"
+}
+
+ +

View Tax Rate Count

+

This API lets you retrieve a count of all tax rates.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/taxes/count
+
+
+
curl https://example.com/wc-api/v3/taxes/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('taxes/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('taxes/53')); ?>
+
print(wcapi.get("taxes/count").json())
+
woocommerce.get("taxes/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 48
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
tax_rate_classstringTax rates by class. eg: standard, reduced-rate or zero-rate
+ + +

Tax - Classes

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate tax classes.

+

Taxes Properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringTax class slug read-only
namestringTax class name
+

Create a Tax Class

+

This API helps you to create a new tax class.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/taxes/classes
+
+
+
curl -X POST https://example.com/wc-api/v3/taxes/classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "tax_class": {
+    "name": "Zero Rate"
+  }
+}'
+
var data = {
+  tax_class: {
+    name: 'Zero Rate'
+  }
+};
+
+WooCommerce.post('taxes/classes', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'tax_class' => [
+        'name' => 'Zero Rate'
+    ]
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+
data = {
+    "tax_class": {
+        "name": "Zero Rate"
+    }
+}
+
+print(wcapi.post("taxes/classes", data).json())
+
data = {
+  tax_class: {
+    name: "Zero Rate"
+  }
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "tax_class": {
+    "slug": "zero-rate",
+    "name": "Zero Rate"
+  }
+}
+
+ +

View List of Tax Classes

+

This API helps you to view all the tax classes.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/taxes/classes
+
+
+
curl https://example.com/wc-api/v3/taxes/classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('taxes/classes', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('taxes/classes')); ?>
+
print(wcapi.get("taxes/classes").json())
+
woocommerce.get("taxes/classes").parsed_response
+
+
+

JSON response example:

+
+
{
+  "tax_classes": [
+    {
+      "slug": "standard",
+      "name": "Standard Rate"
+    },
+    {
+      "slug": "reduced-rate",
+      "name": "Reduced Rate"
+    },
+    {
+      "slug": "zero-rate",
+      "name": "Zero Rate"
+    }
+  ]
+}
+
+ +

Delete a Tax Class

+

This API helps you delete a tax class.

+ + +

HTTP Request

+
+
+ DELETE +
/wc-api/v3/taxes/classes/<slug>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/taxes/classes/zero-rate \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('taxes/classes/zero-rate', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('taxes/classes/zero-rate')); ?>
+
print(wcapi.delete("taxes/classes/zero-rate").json())
+
woocommerce.delete("taxes/classes/zero-rate").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Deleted tax_class"
+}
+
+ +

View Tax Rate Count

+

This API lets you retrieve a count of all tax rates.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/taxes/classes/count
+
+
+
curl https://example.com/wc-api/v3/taxes/classes/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('taxes/classes/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('taxes/classes/count')); ?>
+
print(wcapi.get("taxes/classes/count").json())
+
woocommerce.get("taxes/classes/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 3
+}
+
+ +

Webhooks

+

This section lists all API endpoints that can be used to create, edit or otherwise manipulate webhooks.

+

Webhooks Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerThe webhook ID (post ID) read-only
namestringA friendly name for the webhook, defaults to "Webhook created on <date>"
statusstringWebhook status, options are active (delivers payload), paused (does not deliver), or disabled (does not deliver due delivery failures). Default is active
topicstringWebhook topic, e.g. coupon.updated. See the complete list
resourcestringWebhook resource, e.g. coupon read-only
eventstringWebhook event, e.g. updated read-only
hooksarrayWooCommerce action names associated with the webhook read-only
delivery_urlstringThe URL where the webhook payload is delivered
secretstringSecret key used to generate a hash of the delivered webhook and provided in the request headers. required write-only
created_atstringUTC DateTime when the webhook was created read-only
updated_atstringUTC DateTime when the webhook was last updated read-only
+

Delivery Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerThe delivery ID (comment ID)
durationstringThe delivery duration, in seconds
summarystringA friendly summary of the response including the HTTP response code, message, and body
request_urlstringThe URL where the webhook was delivered
request_headersarrayArray of request headers (see Request Headers Attributes)
request_bodystringThe request body, this matches the API response for the given resource (e.g. for the coupon.updated topic, the request body would match the response for GET /coupons/{id})
response_codestringThe HTTP response code from the receiving server
response_messagestringThe HTTP response message from the receiving server
response_headersarrayArray of the response headers from the receiving server
response_bodystringThe response body from the receiving server
created_atstringA DateTime of when the delivery was logged
+

Request Headers Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
User-AgentstringThe request user agent, defaults to "WooCommerce/{version} Hookshot (WordPress/{version})"
Content-TypestringThe request content-type, defaults to "application/json"
X-WC-Webhook-TopicstringThe webhook topic
X-WC-Webhook-ResourcestringThe webhook resource
X-WC-Webhook-EventstringThe webhook event
X-WC-Webhook-SignaturestringA base64 encoded HMAC-SHA256 hash of the payload
X-WC-Webhook-IDintegerThe webhook's ID
X-WC-Webhook-Delivery-IDintegerThe delivery ID
+

Create a Webhook

+

This API helps you to create a new webhook.

+

HTTP Request

+
+
+ POST +
/wc-api/v3/webhooks
+
+
+
curl -X POST https://example.com/wc-api/v3/webhooks \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "webhook": {
+    "name": "An add to cart webhook",
+    "secret": "my-super-secret-private-key",
+    "topic": "action.woocommerce_add_to_cart",
+    "delivery_url": "http://requestb.in/1exdwip1"
+  }
+}'
+
var data = {
+  webhook: {
+    name: 'An add to cart webhook',
+    secret: 'my-super-secret-private-key',
+    topic: 'action.woocommerce_add_to_cart',
+    delivery_url: 'http://requestb.in/1exdwip1'
+  }
+};
+
+WooCommerce.post('webhooks', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'webhook' => [
+        'name' => 'An add to cart webhook',
+        'secret' => 'my-super-secret-private-key',
+        'topic' => 'action.woocommerce_add_to_cart',
+        'delivery_url' => 'http://requestb.in/1exdwip1'
+    ]
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+
data = {
+    "webhook": {
+        "name": "An add to cart webhook",
+        "secret": "my-super-secret-private-key",
+        "topic": "action.woocommerce_add_to_cart",
+        "delivery_url": "http://requestb.in/1exdwip1"
+    }
+}
+
+print(wcapi.post("webhooks", data).json())
+
data = {
+  webhook: {
+    name: "An add to cart webhook",
+    secret: "my-super-secret-private-key",
+    topic: "action.woocommerce_add_to_cart",
+    delivery_url: "http://requestb.in/1exdwip1"
+  }
+}
+
+woocommerce.post("webhooks", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook": {
+    "id": 535,
+    "name": "An add to cart webhook",
+    "status": "active",
+    "topic": "action.woocommerce_add_to_cart",
+    "resource": "action",
+    "event": "woocommerce_add_to_cart",
+    "hooks": [
+      "woocommerce_add_to_cart"
+    ],
+    "delivery_url": "http://requestb.in/1exdwip1",
+    "created_at": "2015-01-21T13:19:58Z",
+    "updated_at": "2015-01-21T13:19:58Z"
+  }
+}
+

View a Webhook

+

This API lets you retrieve and view a specific webhook.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/webhooks/<id>
+
+
+
curl https://example.com/wc-api/v3/webhooks/535 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/535', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('webhooks/535')); ?>
+
print(wcapi.get("webhooks/535").json())
+
woocommerce.get("webhooks/535").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook": {
+    "id": 535,
+    "name": "An add to cart webhook",
+    "status": "active",
+    "topic": "action.woocommerce_add_to_cart",
+    "resource": "action",
+    "event": "woocommerce_add_to_cart",
+    "hooks": [
+      "woocommerce_add_to_cart"
+    ],
+    "delivery_url": "http://requestb.in/1exdwip1",
+    "created_at": "2015-01-21T13:19:58Z",
+    "updated_at": "2015-01-21T13:19:58Z"
+  }
+}
+

View List of Webhooks

+

This API helps you to view all the webhooks.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/webhooks
+
+
+
curl https://example.com/wc-api/v3/webhooks \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('webhooks')); ?>
+
print(wcapi.get("webhooks").json())
+
woocommerce.get("webhooks").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhooks": [
+    {
+      "id": 535,
+      "name": "An add to cart webhook",
+      "status": "active",
+      "topic": "action.woocommerce_add_to_cart",
+      "resource": "action",
+      "event": "woocommerce_add_to_cart",
+      "hooks": [
+        "woocommerce_add_to_cart"
+      ],
+      "delivery_url": "http://requestb.in/1exdwip1",
+      "created_at": "2015-01-21T13:19:58Z",
+      "updated_at": "2015-01-21T13:19:58Z"
+    },
+    {
+      "id": 313,
+      "name": "Webhook created on Jan 17, 2015 @ 11:45 AM",
+      "status": "active",
+      "topic": "order.created",
+      "resource": "order",
+      "event": "created",
+      "hooks": [
+        "woocommerce_checkout_order_processed",
+        "woocommerce_process_shop_order_meta",
+        "woocommerce_api_create_order"
+      ],
+      "delivery_url": "http://requestb.in/1exdwip1",
+      "created_at": "2014-12-17T11:45:05Z",
+      "updated_at": "2015-01-10T00:41:08Z"
+    }
+  ]
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringWebhooks by status. The following options are available: active or paused and disabled. Default is active
+

Update a Webhook

+

This API lets you make changes to a webhook.

+

HTTP Request

+
+
+ PUT +
/wc-api/v3/webhook/<id>
+
+
+
curl -X PUT https://example.com/wc-api/v3/webhook/535 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "webhook": {
+    "status": "paused"
+  }
+}'
+
var data = {
+  webhook: {
+    status: 'paused'
+  }
+}
+
+WooCommerce.put('webhooks/535', data, function(err, data, res) {
+  console.log(res);
+});
+
<?php
+$data = [
+    'webhook' => [
+        'status' => 'paused'
+    ]
+];
+
+print_r($woocommerce->put('webhooks/535', $data));
+?>
+
data = {
+    "webhook": {
+        "status": "paused"
+    }
+}
+
+print(wcapi.put("webhooks/535", data).json())
+
data = {
+  webhook: {
+    status: "paused"
+  }
+}
+
+woocommerce.put("webhooks/535", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook": {
+    "id": 535,
+    "name": "An add to cart webhook",
+    "status": "paused",
+    "topic": "action.woocommerce_add_to_cart",
+    "resource": "action",
+    "event": "woocommerce_add_to_cart",
+    "hooks": [
+      "woocommerce_add_to_cart"
+    ],
+    "delivery_url": "http://requestb.in/1exdwip1",
+    "created_at": "2015-01-21T13:19:58Z",
+    "updated_at": "2015-01-21T13:19:58Z"
+  }
+}
+

Delete a Webhook

+

This API helps you delete a webhook.

+

HTTP Request

+
+
+ DELETE +
/wc-api/v3/webhooks/<id>
+
+
+
curl -X DELETE https://example.com/wc-api/v3/webhooks/535 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete('webhooks/535', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->delete('webhooks/535')); ?>
+
print(wcapi.delete("webhooks/535").json())
+
woocommerce.delete("webhooks/535").parsed_response
+
+
+

JSON response example:

+
+
{
+  "message": "Permanently deleted webhook"
+}
+

View Webhooks Count

+

This API lets you retrieve a count of all webhooks.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/webhooks/count
+
+
+
curl https://example.com/wc-api/v3/webhooks/count \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/count', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('webhooks/count')); ?>
+
print(wcapi.get("webhooks/count").json())
+
woocommerce.get("webhooks/count").parsed_response
+
+
+

JSON response example:

+
+
{
+  "count": 4
+}
+

Available Filters

+ + + + + + + + + + + + +
FilterTypeDescription
statusstringWebhooks by status. The following options are available: active or paused and disabled
+

View a Webhooks Delivery

+

This API lets you retrieve and view a specific webhook delivery.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/webhooks/<id>/deliveries/<delivery_id>
+
+
+
curl https://example.com/wc-api/v3/webhooks/535/deliveries/378 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/535/deliveries/378', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('webhooks/535/deliveries/378')); ?>
+
print(wcapi.get("webhooks/535/deliveries/378").json())
+
woocommerce.get("webhooks/535/deliveries/378").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook_delivery": {
+    "id": 378,
+    "duration": "0.90226",
+    "summary": "HTTP 200 OK: ok",
+    "request_method": "POST",
+    "request_url": "http://requestb.in/125q7ns1",
+    "request_headers": {
+      "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
+      "Content-Type": "application/json",
+      "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
+      "X-WC-Webhook-Resource": "action",
+      "X-WC-Webhook-Event": "woocommerce_add_to_cart",
+      "X-WC-Webhook-Signature": "geC1akFhCtsO7fbXz5XiGUsMsRa4Mt0IJsZ96nTaHjI=",
+      "X-WC-Webhook-ID": 535,
+      "X-WC-Webhook-Delivery-ID": 378
+    },
+    "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"7cbbc409ec990f19c78c75bd1e06f215\"}",
+    "response_code": "200",
+    "response_message": "OK",
+    "response_headers": {
+      "connection": "close",
+      "server": "gunicorn/18.0",
+      "date": "Wed, 21 Jan 2015 16:22:49 GMT",
+      "content-type": "text/html; charset=utf-8",
+      "content-length": "2",
+      "sponsored-by": "https://www.runscope.com",
+      "via": "1.1 vegur"
+    },
+    "response_body": "ok",
+    "created_at": "2015-01-21T16:26:12Z"
+  }
+}
+
+ +

View List of Webhooks Deliveries

+

This API helps you to view all deliveries from a specific webhooks.

+

HTTP Request

+
+
+ GET +
/wc-api/v3/webhooks/<id>/deliveries
+
+
+
curl https://example.com/wc-api/v3/webhooks/535/deliveries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get('webhooks/535/deliveries', function(err, data, res) {
+  console.log(res);
+});
+
<?php print_r($woocommerce->get('webhooks/535/deliveries')); ?>
+
print(wcapi.get("webhooks/535/deliveries").json())
+
woocommerce.get("webhooks/535/deliveries").parsed_response
+
+
+

JSON response example:

+
+
{
+  "webhook_deliveries": [
+    {
+      "id": 380,
+      "duration": "0.58635",
+      "summary": "HTTP 200 OK: ok",
+      "request_method": "POST",
+      "request_url": "http://requestb.in/125q7ns1",
+      "request_headers": {
+        "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
+        "Content-Type": "application/json",
+        "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
+        "X-WC-Webhook-Resource": "action",
+        "X-WC-Webhook-Event": "woocommerce_add_to_cart",
+        "X-WC-Webhook-Signature": "st4egVCTwG1JMfxmxe7MZYEuj9Y6Euge4SOTNfCUCWY=",
+        "X-WC-Webhook-ID": 535,
+        "X-WC-Webhook-Delivery-ID": 380
+      },
+      "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"c16a5320fa475530d9583c34fd356ef5\"}",
+      "response_code": "200",
+      "response_message": "OK",
+      "response_headers": {
+        "connection": "close",
+        "server": "gunicorn/18.0",
+        "date": "Wed, 21 Jan 2015 16:23:05 GMT",
+        "content-type": "text/html; charset=utf-8",
+        "content-length": "2",
+        "sponsored-by": "https://www.runscope.com",
+        "via": "1.1 vegur"
+      },
+      "response_body": "ok",
+      "created_at": "2015-01-21T16:26:28Z"
+    },
+    {
+      "id": 378,
+      "duration": "0.90226",
+      "summary": "HTTP 200 OK: ok",
+      "request_method": "POST",
+      "request_url": "http://requestb.in/125q7ns1",
+      "request_headers": {
+        "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
+        "Content-Type": "application/json",
+        "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
+        "X-WC-Webhook-Resource": "action",
+        "X-WC-Webhook-Event": "woocommerce_add_to_cart",
+        "X-WC-Webhook-Signature": "geC1akFhCtsO7fbXz5XiGUsMsRa4Mt0IJsZ96nTaHjI=",
+        "X-WC-Webhook-ID": 535,
+        "X-WC-Webhook-Delivery-ID": 378
+      },
+      "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"7cbbc409ec990f19c78c75bd1e06f215\"}",
+      "response_code": "200",
+      "response_message": "OK",
+      "response_headers": {
+        "connection": "close",
+        "server": "gunicorn/18.0",
+        "date": "Wed, 21 Jan 2015 16:22:49 GMT",
+        "content-type": "text/html; charset=utf-8",
+        "content-length": "2",
+        "sponsored-by": "https://www.runscope.com",
+        "via": "1.1 vegur"
+      },
+      "response_body": "ok",
+      "created_at": "2015-01-21T16:26:12Z"
+    }
+  ]
+}
+

Authentication Endpoint

+

Starting in WooCommerce 2.4 we introduced an Authentication Endpoint, This can be used by any app to allow users to generate API keys. This makes integration with WooCommerce API simpler because the user only needs to access a URL and click "accept". After being redirected back to the app, the API keys will be sent in a POST request.

+ +

The following image illustrates how it's done:

+ +

Authentication Endpoint flow

+ + +

URL parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
app_namestringYour app name mandatory
scopestringLevel of access. Available: read, write and read_write mandatory
user_idstringUser ID in your app. For your internal reference, used when the user is redirected back to your app. NOT THE USER ID IN WOOCOMMERCE mandatory
return_urlstringURL the user will be redirected to after authentication mandatory
callback_urlstringURL that will receive the generated API key. Note: this URL should be over HTTPS mandatory
+

Creating Authentication Endpoint URL

+

You must use the /wc-auth/v1/authorize endpoint and pass the above parameters as a query string.

+ +
+

Example of how to build an authentication URL:

+
+
# Bash example
+STORE_URL='http://example.com'
+ENDPOINT='/wc-auth/v1/authorize'
+PARAMS="app_name=My App Name&scope=read_write&user_id=123&return_url=http://app.com/return-page&callback_url=https://app.com/callback-endpoint"
+QUERY_STRING="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$PARAMS")"
+QUERY_STRING=$(echo $QUERY_STRING | sed -e "s/%20/\+/g" -e "s/%3D/\=/g" -e "s/%26/\&/g")
+
+echo "$STORE_URL$ENDPOINT?$QUERY_STRING"
+
var querystring = require('querystring');
+
+var store_url = 'http://example.com';
+var endpoint = '/wc-auth/v1/authorize';
+var params = {
+  app_name: 'My App Name',
+  scope: 'read_write',
+  user_id: 123,
+  return_url: 'http://app.com/return-page',
+  callback_url: 'https://app.com/callback-endpoint'
+};
+var query_string = querystring.stringify(params).replace(/%20/g, '+');
+
+console.log(store_url + endpoint + '?' + query_string);
+
<?php
+$store_url = 'http://example.com';
+$endpoint = '/wc-auth/v1/authorize';
+$params = [
+    'app_name' => 'My App Name',
+    'scope' => 'write',
+    'user_id' => 123,
+    'return_url' => 'http://app.com',
+    'callback_url' => 'https://app.com'
+];
+$query_string = http_build_query( $params );
+
+echo $store_url . $endpoint . '?' . $query_string;
+?>
+
from urllib.parse import urlencode
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+    "app_name": "My App Name",
+    "scope": "read_write",
+    "user_id": 123,
+    "return_url": "http://app.com/return-page",
+    "callback_url": "https://app.com/callback-endpoint"
+}
+query_string = urlencode(params)
+
+print("%s%s?%s" % (store_url, endpoint, query_string))
+
require "uri"
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+  app_name: "My App Name",
+  scope: "read_write",
+  user_id: 123,
+  return_url: "http://app.com/return-page",
+  callback_url: "https://app.com/callback-endpoint"
+}
+query_string = URI.encode_www_form(params)
+
+puts "#{store_url}#{endpoint}?#{query_string}"
+
+
+

Example of JSON posted with the API Keys

+
+
{
+    "key_id": 1,
+    "user_id": 123,
+    "consumer_key": "ck_xxxxxxxxxxxxxxxx",
+    "consumer_secret": "cs_xxxxxxxxxxxxxxxx",
+    "key_permissions": "read_write"
+}
+
+

Example of the screen that the user will see:

+ +

Authentication Endpoint example

+

Notes and Tips

+
    +
  • While redirecting the user using return_url, you are also sent success and user_id parameters as query strings.
  • +
  • success sends 0 if the user denied, or 1 if authenticated successfully.
  • +
  • Use user_id to identify the user when redirected back to the (return_url) and also remember to save the API Keys when your callback_url is posted to after auth.
  • +
  • The auth endpoint will send the API Keys in JSON format to the callback_url, so it's important to remember that some languages such as PHP will not display it inside the $_POST global variable, in PHP you can access it using $HTTP_RAW_POST_DATA (for old PHP versions) or file_get_contents('php://input');.
  • +
  • This authentication endpoint is used only to make easy integration with WooCommerce REST API. THIS NOT INTENDED TO BE USED AS A LOGIN ENDPOINT FOR CUSTOMERS!
  • +
+ +
+
+
+ cURL + Node.js + PHP + Python + Ruby +
+
+
+ +
+ This documentation is for the WooCommerce API v3 API which is now deprecated. Please use the latest REST API version. +
+ + + diff --git a/wp-api-v1.html b/wp-api-v1.html new file mode 100644 index 00000000..64fc4798 --- /dev/null +++ b/wp-api-v1.html @@ -0,0 +1,25368 @@ + + + + + + + + WooCommerce REST API Documentation - WP REST API v1 + + + + + + + + + + + + + + + + + + + NAV + + + +
+ +
+ cURL + Node.js + PHP + Python + Ruby +
+ + +
+
+
+
+

Introduction

+

WooCommerce (WC) 2.6+ is fully integrated with the WordPress REST API. This allows WC data to be created, read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients.

+ +

The current WP REST API integration version is v1 which takes a first-order position in endpoints.

+ +

The following table shows API versions present in each major version of WooCommerce:

+ + + + + + + + + + + + + +
API VersionWC VersionWP Version
v12.6.x or later4.4 or later
+ +

Prior to 2.6, WooCommerce had a REST API separate from WordPress which is now known as the legacy API. You can find the documentation for the legacy API separately.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
API VersionWC VersionWP VersionDocumentation
Legacy v32.4.x or later4.1 or laterLegacy v3 docs
Legacy v22.2.x or later4.1 or laterLegacy v2 docs
Legacy v12.1.x or later4.1 or laterLegacy v1 docs
+

Requirements

+

To use the latest version of the REST API you must be using:

+ +
    +
  • WooCommerce 2.6+.
  • +
  • WordPress 4.4+.
  • +
  • Pretty permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work.
  • +
  • You may access the API over either HTTP or HTTPS, but HTTPS is recommended where possible.
  • +
+ +

If you use ModSecurity and see 501 Method Not Implemented errors, see this issue for details.

+ + +

Request/Response Format

+

The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

+ +

Some general information about responses:

+ +
    +
  • Dates are returned in ISO8601 format: YYYY-MM-DDTHH:MM:SS
  • +
  • Resource IDs are returned as integers.
  • +
  • Any decimal monetary amount, such as prices or totals, will be returned as strings with two decimal places.
  • +
  • Other amounts, such as item counts, are returned as integers.
  • +
  • Blank fields are generally included as null or emtpy string instead of being omitted.
  • +
+

JSONP Support

+

The WP REST API supports JSONP by default. JSONP responses use the application/javascript content-type. You can specify the callback using the ?_jsonp parameter for GET requests to have the response wrapped in a JSON function:

+ +
+
+ GET +
/wp-json/wc/v1?_jsonp=callback
+
+
+
curl https://example.com/wp-json/wc/v1/products/tags/34?_jsonp=tagDetails \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags/34", {
+  _jsonp: "tagDetails"
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags/34', ['_jsonp' => 'tagDetails'])); ?>
+
print(wcapi.get("products/tags/34?_jsonp=tagDetails").json())
+
woocommerce.get("products/tags/34", _jsonp: "tagDetails").parsed_response
+
+
+

Response:

+
+
/**/tagDetails({"id":34,"name":"Leather Shoes","slug":"leather-shoes","description":"","count":0,"_links":{"self":[{"href":"https://example.com/wp-json/wc/v1/products/tags/34"}],"collection":[{"href":"https://example.com/wp-json/wc/v1/products/tags"}]}})%
+

Errors

+

Occasionally you might encounter errors when accessing the REST API. There are four possible types:

+ + + + + + + + + + + + + + + + + + + + + + + +
Error CodeError Type
400 Bad RequestInvalid request, e.g. using an unsupported HTTP method
401 UnauthorizedAuthentication or permission error, e.g. incorrect API keys
404 Not FoundRequests to resources that don't exist or are missing
500 Internal Server ErrorServer error
+ +
+

WP REST API error example:

+
+
{
+  "code": "rest_no_route",
+  "message": "No route was found matching the URL and request method",
+  "data": {
+    "status": 404
+  }
+}
+
+
+

WooCommerce REST API error example:

+
+
{
+  "code": "woocommerce_rest_term_invalid",
+  "message": "Resource doesn't exist.",
+  "data": {
+    "status": 404
+  }
+}
+
+

Errors return both an appropriate HTTP status code and response object which contains a code, message and data attribute.

+

Parameters

+

Almost all endpoints accept optional parameters which can be passed as a HTTP query string parameter, e.g. GET /orders?status=completed. All parameters are documented along each endpoint.

+

Pagination

+

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specified with the ?per_page parameter:

+ +

GET /orders?per_page=15

+ +

You can specify further pages with the ?page parameter:

+ +

GET /orders?page=2

+ +

You may also specify the offset from the first resource using the ?offset parameter:

+ +

GET /orders?offset=5

+ +

Page number is 1-based and omitting the ?page parameter will return the first page.

+ +

The total number of resources and pages are always included in the X-WP-Total and X-WP-TotalPages HTTP headers.

+ +

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

+
Link: <https://www.example.com/wp-json/wc/v1/products?page=2>; rel="next",
+<https://www.example.com/wp-json/wc/v1/products?page=3>; rel="last"`
+
+

The possible rel values are:

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
nextShows the URL of the immediate next page of results.
lastShows the URL of the last page of results.
firstShows the URL of the first page of results.
prevShows the URL of the immediate previous page of results.
+

Libraries and Tools

Official libraries

+ +
// Install:
+// npm install --save @woocommerce/woocommerce-rest-api
+
+// Setup:
+const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'http://example.com', // Your store URL
+  consumerKey: 'consumer_key', // Your consumer key
+  consumerSecret: 'consumer_secret', // Your consumer secret
+  version: 'wc/v1' // WooCommerce WP REST API version
+});
+
<?php
+// Install:
+// composer require automattic/woocommerce
+
+// Setup:
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'http://example.com', // Your store URL
+    'consumer_key', // Your consumer key
+    'consumer_secret', // Your consumer secret
+    [
+        'wp_api' => true, // Enable the WP REST API integration
+        'version' => 'wc/v1' // WooCommerce WP REST API version
+    ]
+);
+?>
+
# Install:
+# pip install woocommerce
+
+# Setup:
+from woocommerce import API
+
+wcapi = API(
+    url="http://example.com", # Your store URL
+    consumer_key="consumer_key", # Your consumer key
+    consumer_secret="consumer_secret", # Your consumer secret
+    wp_api=True, # Enable the WP REST API integration
+    version="wc/v1" # WooCommerce WP REST API version
+)
+
# Install:
+# gem install woocommerce_api
+
+# Setup:
+require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "http://example.com", # Your store URL
+  "consumer_key", # Your consumer key
+  "consumer_secret", # Your consumer secret
+  {
+    wp_json: true, # Enable the WP REST API integration
+    version: "v3" # WooCommerce WP REST API version
+  }
+)
+
+ +

Third party libraries

+ + + +

Tools

+

Some useful tools you can use to access the API include:

+ +
    +
  • Insomnia - Cross-platform GraphQL and REST client, available for Mac, Windows, and Linux.
  • +
  • Postman - Cross-platform REST client, available for Mac, Windows, and Linux.
  • +
  • RequestBin - Allows you test webhooks.
  • +
  • Hookbin - Another tool to test webhooks.
  • +
+

Authentication

+

WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any WP REST API authentication plugin or method.

+

REST API keys

+

Pre-generated keys can be used to authenticate use of the REST API endpoints. New keys can be generated either through the WordPress admin interface or they can be auto-generated through an endpoint.

+

Generating API keys in the WordPress admin interface

+

To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > API > Keys/Apps.

+ +

WooCommerce REST API keys settings

+ +

Click the "Add Key" button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user's WordPress roles and capabilities.

+ +

Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the "Generate API Key" button and WooCommerce will generate REST API keys for the selected user.

+ +

Creating a new REST API key

+ +

Now that keys have been generated, you should see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.

+ +

Generated REST API key

+

Auto generating API keys using our Application Authentication Endpoint

+

This endpoint can be used by any APP to allow users to generate API keys for your APP. This makes integration with WooCommerce API easier because the user only needs to grant access to your APP via a URL. After being redirected back to your APP, the API keys will be sent back in a separate POST request.

+ +

The following image illustrates how this works:

+ +

Authentication Endpoint flow

+ + +

URL parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
app_namestringYour APP name mandatory
scopestringLevel of access. Available: read, write and read_write mandatory
user_idstringUser ID in your APP. For your internal reference, used when the user is redirected back to your APP. NOT THE USER ID IN WOOCOMMERCE mandatory
return_urlstringURL the user will be redirected to after authentication mandatory
callback_urlstringURL that will receive the generated API key. Note: this URL should be over HTTPS mandatory
+

Creating an authentication endpoint URL

+

You must use the /wc-auth/v1/authorize endpoint and pass the above parameters as a query string.

+ +
+

Example of how to build an authentication URL:

+
+
# Bash example
+STORE_URL='http://example.com'
+ENDPOINT='/wc-auth/v1/authorize'
+PARAMS="app_name=My App Name&scope=read_write&user_id=123&return_url=http://app.com/return-page&callback_url=https://app.com/callback-endpoint"
+QUERY_STRING="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$PARAMS")"
+QUERY_STRING=$(echo $QUERY_STRING | sed -e "s/%20/\+/g" -e "s/%3D/\=/g" -e "s/%26/\&/g")
+
+echo "$STORE_URL$ENDPOINT?$QUERY_STRING"
+
const querystring = require("querystring");
+
+const store_url = "http://example.com";
+const endpoint = "/wc-auth/v1/authorize";
+const params = {
+  app_name: "My App Name",
+  scope: "read_write",
+  user_id: 123,
+  return_url: "http://app.com/return-page",
+  callback_url: "https://app.com/callback-endpoint"
+};
+const query_string = querystring.stringify(params).replace(/%20/g, "+");
+
+console.log(store_url + endpoint + "?" + query_string);
+
<?php
+$store_url = 'http://example.com';
+$endpoint = '/wc-auth/v1/authorize';
+$params = [
+    'app_name' => 'My App Name',
+    'scope' => 'write',
+    'user_id' => 123,
+    'return_url' => 'http://app.com',
+    'callback_url' => 'https://app.com'
+];
+$query_string = http_build_query( $params );
+
+echo $store_url . $endpoint . '?' . $query_string;
+?>
+
from urllib.parse import urlencode
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+    "app_name": "My App Name",
+    "scope": "read_write",
+    "user_id": 123,
+    "return_url": "http://app.com/return-page",
+    "callback_url": "https://app.com/callback-endpoint"
+}
+query_string = urlencode(params)
+
+print("%s%s?%s" % (store_url, endpoint, query_string))
+
require "uri"
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+  app_name: "My App Name",
+  scope: "read_write",
+  user_id: 123,
+  return_url: "http://app.com/return-page",
+  callback_url: "https://app.com/callback-endpoint"
+}
+query_string = URI.encode_www_form(params)
+
+puts "#{store_url}#{endpoint}?#{query_string}"
+
+
+

Example of JSON posted with the API Keys

+
+
{
+    "key_id": 1,
+    "user_id": 123,
+    "consumer_key": "ck_xxxxxxxxxxxxxxxx",
+    "consumer_secret": "cs_xxxxxxxxxxxxxxxx",
+    "key_permissions": "read_write"
+}
+
+

Example of the screen that the user will see:

+ +

Authentication Endpoint example

+

Notes

+
    +
  • While redirecting the user using return_url, you are also sent success and user_id parameters as query strings.
  • +
  • success sends 0 if the user denied, or 1 if authenticated successfully.
  • +
  • Use user_id to identify the user when redirected back to the (return_url) and also remember to save the API Keys when your callback_url is posted to after auth.
  • +
  • The auth endpoint will send the API Keys in JSON format to the callback_url, so it's important to remember that some languages such as PHP will not display it inside the $_POST global variable, in PHP you can access it using $HTTP_RAW_POST_DATA (for old PHP versions) or file_get_contents('php://input');.
  • +
  • The URL generated must have all query string values encoded.
  • +
+

Authentication over HTTPS

+

You may use HTTP Basic Auth by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.

+ +
+

HTTP Basic Auth example

+
+
curl https://www.example.com/wp-json/wc/v1/orders \
+    -u consumer_key:consumer_secret
+
const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: "https://example.com",
+  consumerKey: "consumer_key",
+  consumerSecret: "consumer_secret",
+  version: "wc/v1"
+});
+
<?php
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'https://example.com',
+    'consumer_key',
+    'consumer_secret',
+    [
+        'wp_api' => true,
+        'version' => 'wc/v1'
+    ]
+);
+?>
+
from woocommerce import API
+
+wcapi = API(
+    url="https://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    wp_api=True,
+    version="wc/v1"
+)
+
require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    wp_json: true,
+    version: "wc/v1"
+  }
+)
+
+

Occasionally some servers may not parse the Authorization header correctly (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters instead.

+ +
+

Example for servers that not properly parse the Authorization header:

+
+
curl https://www.example.com/wp-json/wc/v1/orders?consumer_key=123&consumer_secret=abc
+
const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: "https://example.com",
+  consumerKey: "consumer_key",
+  consumerSecret: "consumer_secret",
+  version: "wc/v1",
+  queryStringAuth: true // Force Basic Authentication as query string true and using under HTTPS
+});
+
<?php
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'https://example.com',
+    'consumer_key',
+    'consumer_secret',
+    [
+        'wp_api' => true,
+        'version' => 'wc/v1',
+        'query_string_auth' => true // Force Basic Authentication as query string true and using under HTTPS
+    ]
+);
+?>
+
from woocommerce import API
+
+wcapi = API(
+    url="https://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    wp_api=True,
+    version="wc/v1",
+    query_string_auth=True // Force Basic Authentication as query string true and using under HTTPS
+)
+
require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    wp_json: true,
+    version: "wc/v1",
+    query_string_auth: true // Force Basic Authentication as query string true and using under HTTPS
+  }
+)
+

Authentication over HTTP

+

You must use OAuth 1.0a "one-legged" authentication to ensure REST API credentials cannot be intercepted by an attacker. Typically you will use any standard OAuth 1.0a library in the language of your choice to handle the authentication, or generate the necessary parameters by following the following instructions.

+

Creating a signature

Collect the request method and URL

+

First you need to determine the HTTP method you will be using for the request, and the URL of the request.

+ +

The HTTP method will be GET in our case.

+ +

The Request URL will be the endpoint you are posting to, e.g. http://www.example.com/wp-json/wc/v1/orders.

+

Collect parameters

+

Collect and normalize your query string parameters. This includes all oauth_* parameters except for the oauth_signature itself.

+ +

These values need to be encoded into a single string which will be used later on. The process to build the string is very specific:

+ +
    +
  1. Percent encode every key and value that will be signed.
  2. +
  3. Sort the list of parameters alphabetically by encoded key.
  4. +
  5. For each key/value pair: + +
      +
    • Append the encoded key to the output string.
    • +
    • Append the = character to the output string.
    • +
    • Append the encoded value to the output string.
    • +
    • If there are more key/value pairs remaining, append a & character to the output string.
    • +
  6. +
+ +

When percent encoding in PHP for example, you would use rawurlencode().

+ +

When sorting parameters in PHP for example, you would use uksort( $params, 'strcmp' ).

+ +
+

Parameters example:

+
+
oauth_consumer_key=abc123&oauth_signature_method=HMAC-SHA1
+

Create the signature base string

+

The above values collected so far must be joined to make a single string, from which the signature will be generated. This is called the signature base string in the OAuth specification.

+ +

To encode the HTTP method, request URL, and parameter string into a single string:

+ +
    +
  1. Set the output string equal to the uppercase HTTP Method.
  2. +
  3. Append the & character to the output string.
  4. +
  5. Percent encode the URL and append it to the output string.
  6. +
  7. Append the & character to the output string.
  8. +
  9. Percent encode the parameter string and append it to the output string.
  10. +
+ +
+

Example signature base string:

+
+
GET&http%3A%2F%2Fwww.example.com%2Fwp-json%2Fwc%2Fv1%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1
+

Generate the signature

+

Generate the signature using the signature base string and your consumer secret key with a & character with the HMAC-SHA1 hashing algorithm.

+ +

In PHP you can use the hash_hmac function.

+ +

HMAC-SHA1 or HMAC-SHA256 are the only accepted hash algorithms.

+ +

If you are having trouble generating a correct signature, you'll want to review the string you are signing for encoding errors. The authentication source can also be helpful in understanding how to properly generate the signature.

+

OAuth tips

+
    +
  • The OAuth parameters may be added as query string parameters or included in the Authorization header.
  • +
  • Note there is no reliable cross-platform way to get the raw request headers in WordPress, so query string should be more reliable in some cases.
  • +
  • The required parameters are: oauth_consumer_key, oauth_timestamp, oauth_nonce, oauth_signature, and oauth_signature_method. oauth_version is not required and should be omitted.
  • +
  • The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key.
  • +
  • The OAuth timestamp should be the unix timestamp at the time of the request. The REST API will deny any requests that include a timestamp outside of a 15 minute window to prevent replay attacks.
  • +
  • You must use the store URL provided by the index when forming the base string used for the signature, as this is what the server will use. (e.g. if the store URL includes a www sub-domain, you should use it for requests)
  • +
  • Note that the request body is not signed as per the OAuth spec.
  • +
  • If including parameters in your request, it saves a lot of trouble if you can order your items alphabetically.
  • +
  • Authorization header is supported starting WooCommerce 3.0.
  • +
+

Index

+

By default, the API provides information about all available endpoints on the site. Authentication is not required to access the API index.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1
+
+
+
curl https://example.com/wp-json/wc/v1
+
WooCommerce.get("")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('')); ?>
+
print(wcapi.get("").json())
+
woocommerce.get("").parsed_response
+
+
+

JSON response example:

+
+
{
+  "namespace": "wc/v1",
+  "routes": {
+    "/wc/v1": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "namespace": {
+              "required": false,
+              "default": "wc/v1"
+            },
+            "context": {
+              "required": false,
+              "default": "view"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1"
+      }
+    },
+    "/wc/v1/coupons": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date."
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to posts with a specific slug."
+            },
+            "filter": {
+              "required": false,
+              "description": "Use WP Query arguments to modify the response; private query vars require appropriate authorization."
+            },
+            "code": {
+              "required": false,
+              "description": "Limit result set to resources with a specific code."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "code": {
+              "required": true
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description."
+            },
+            "discount_type": {
+              "required": false,
+              "default": "fixed_cart",
+              "enum": [
+                "fixed_cart",
+                "percent",
+                "fixed_product",
+                "percent_product"
+              ],
+              "description": "Determines the type of discount that will be applied."
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount."
+            },
+            "expiry_date": {
+              "required": false,
+              "description": "UTC DateTime when the coupon expires."
+            },
+            "individual_use": {
+              "required": false,
+              "default": false,
+              "description": "Whether coupon can only be used individually."
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product ID's the coupon can be used on."
+            },
+            "exclude_product_ids": {
+              "required": false,
+              "description": "List of product ID's the coupon cannot be used on."
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used."
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer."
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to."
+            },
+            "free_shipping": {
+              "required": false,
+              "default": false,
+              "description": "Define if can be applied for free shipping."
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category ID's the coupon applies to."
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category ID's the coupon does not apply to."
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "default": false,
+              "description": "Define if should not apply when have sale items."
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies."
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon."
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/coupons"
+      }
+    },
+    "/wc/v1/coupons/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "code": {
+              "required": false,
+              "description": "Coupon code."
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description."
+            },
+            "discount_type": {
+              "required": false,
+              "enum": [
+                "fixed_cart",
+                "percent",
+                "fixed_product",
+                "percent_product"
+              ],
+              "description": "Determines the type of discount that will be applied."
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount."
+            },
+            "expiry_date": {
+              "required": false,
+              "description": "UTC DateTime when the coupon expires."
+            },
+            "individual_use": {
+              "required": false,
+              "description": "Whether coupon can only be used individually."
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product ID's the coupon can be used on."
+            },
+            "exclude_product_ids": {
+              "required": false,
+              "description": "List of product ID's the coupon cannot be used on."
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used."
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer."
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to."
+            },
+            "free_shipping": {
+              "required": false,
+              "description": "Define if can be applied for free shipping."
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category ID's the coupon applies to."
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category ID's the coupon does not apply to."
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "description": "Define if should not apply when have sale items."
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies."
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon."
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/coupons/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "code": {
+              "required": false,
+              "description": "Coupon code."
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description."
+            },
+            "discount_type": {
+              "required": false,
+              "enum": [
+                "fixed_cart",
+                "percent",
+                "fixed_product",
+                "percent_product"
+              ],
+              "description": "Determines the type of discount that will be applied."
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount."
+            },
+            "expiry_date": {
+              "required": false,
+              "description": "UTC DateTime when the coupon expires."
+            },
+            "individual_use": {
+              "required": false,
+              "description": "Whether coupon can only be used individually."
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product ID's the coupon can be used on."
+            },
+            "exclude_product_ids": {
+              "required": false,
+              "description": "List of product ID's the coupon cannot be used on."
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used."
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer."
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to."
+            },
+            "free_shipping": {
+              "required": false,
+              "description": "Define if can be applied for free shipping."
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category ID's the coupon applies to."
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category ID's the coupon does not apply to."
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "description": "Define if should not apply when have sale items."
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies."
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon."
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/coupons/batch"
+      }
+    },
+    "/wc/v1/customers/(?P<customer_id>[\\d]+)/downloads": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/customers": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "registered_date"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "email": {
+              "required": false,
+              "description": "Limit result set to resources with a specific email."
+            },
+            "role": {
+              "required": false,
+              "default": "customer",
+              "enum": [
+                "all",
+                "administrator",
+                "editor",
+                "author",
+                "contributor",
+                "subscriber",
+                "customer",
+                "shop_manager"
+              ],
+              "description": "Limit result set to resources with a specific role."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "email": {
+              "required": true
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name."
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name."
+            },
+            "username": {
+              "required": false
+            },
+            "password": {
+              "required": true
+            },
+            "billing_address": {
+              "required": false,
+              "description": "List of billing address data."
+            },
+            "shipping_address": {
+              "required": false,
+              "description": "List of shipping address data."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/customers"
+      }
+    },
+    "/wc/v1/customers/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "email": {
+              "required": false,
+              "description": "The email address for the customer."
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name."
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name."
+            },
+            "username": {
+              "required": false,
+              "description": "Customer login name."
+            },
+            "password": {
+              "required": false,
+              "description": "Customer password."
+            },
+            "billing_address": {
+              "required": false,
+              "description": "List of billing address data."
+            },
+            "shipping_address": {
+              "required": false,
+              "description": "List of shipping address data."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            },
+            "reassign": {
+              "required": false
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/customers/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "email": {
+              "required": false,
+              "description": "The email address for the customer."
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name."
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name."
+            },
+            "username": {
+              "required": false,
+              "description": "Customer login name."
+            },
+            "password": {
+              "required": false,
+              "description": "Customer password."
+            },
+            "billing_address": {
+              "required": false,
+              "description": "List of billing address data."
+            },
+            "shipping_address": {
+              "required": false,
+              "description": "List of shipping address data."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/customers/batch"
+      }
+    },
+    "/wc/v1/orders/(?P<order_id>[\\d]+)/notes": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "note": {
+              "required": true
+            },
+            "customer_note": {
+              "required": false,
+              "default": false,
+              "description": "Shows/define if the note is only for reference or for the customer (the user will be notified)."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/orders/(?P<order_id>[\\d]+)/notes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/orders/(?P<order_id>[\\d]+)/refunds": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date."
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to posts with a specific slug."
+            },
+            "filter": {
+              "required": false,
+              "description": "Use WP Query arguments to modify the response; private query vars require appropriate authorization."
+            },
+            "dp": {
+              "required": false,
+              "default": 2,
+              "description": "Number of decimal points to use in each resource."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "amount": {
+              "required": false,
+              "description": "Refund amount."
+            },
+            "reason": {
+              "required": false,
+              "description": "Reason for refund"
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data."
+            },
+            "email": {
+              "required": true
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/orders/(?P<order_id>[\\d]+)/refunds/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            },
+            "reassign": {
+              "required": false
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/orders": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date."
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to posts with a specific slug."
+            },
+            "filter": {
+              "required": false,
+              "description": "Use WP Query arguments to modify the response; private query vars require appropriate authorization."
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Limit result set to orders assigned a specific status."
+            },
+            "customer": {
+              "required": false,
+              "description": "Limit result set to orders assigned a specific customer."
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to orders assigned a specific product."
+            },
+            "dp": {
+              "required": false,
+              "default": 2,
+              "description": "Number of decimal points to use in each resource."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID."
+            },
+            "status": {
+              "required": false,
+              "default": "pending",
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status."
+            },
+            "currency": {
+              "required": false,
+              "default": "BRL",
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format."
+            },
+            "customer_id": {
+              "required": false,
+              "default": 0,
+              "description": "User ID who owns the order. 0 for guests."
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address."
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address."
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID."
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title."
+            },
+            "set_paid": {
+              "required": false,
+              "default": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items."
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID."
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout."
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data."
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data."
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data."
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/orders"
+      }
+    },
+    "/wc/v1/orders/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID."
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status."
+            },
+            "currency": {
+              "required": false,
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format."
+            },
+            "customer_id": {
+              "required": false,
+              "description": "User ID who owns the order. 0 for guests."
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address."
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address."
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID."
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title."
+            },
+            "set_paid": {
+              "required": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items."
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID."
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout."
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data."
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data."
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data."
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion."
+            },
+            "reassign": {
+              "required": false
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/orders/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID."
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status."
+            },
+            "currency": {
+              "required": false,
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format."
+            },
+            "customer_id": {
+              "required": false,
+              "description": "User ID who owns the order. 0 for guests."
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address."
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address."
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID."
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title."
+            },
+            "set_paid": {
+              "required": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items."
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID."
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout."
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data."
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data."
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data."
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/orders/batch"
+      }
+    },
+    "/wc/v1/products/attributes/(?P<attribute_id>[\\d]+)/terms": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute."
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products."
+            },
+            "parent": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific parent."
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Term name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/attributes/(?P<attribute_id>[\\d]+)/terms/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Term name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/attributes": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "type": {
+              "required": false,
+              "default": "select",
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute."
+            },
+            "order_by": {
+              "required": false,
+              "default": "menu_order",
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order."
+            },
+            "has_archives": {
+              "required": false,
+              "default": false,
+              "description": "Enable/Disable attribute archives."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/attributes"
+      }
+    },
+    "/wc/v1/products/attributes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Attribute name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute."
+            },
+            "order_by": {
+              "required": false,
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order."
+            },
+            "has_archives": {
+              "required": false,
+              "description": "Enable/Disable attribute archives."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/categories": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute."
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products."
+            },
+            "parent": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific parent."
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "parent": {
+              "required": false,
+              "description": "The id for the parent of the resource."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            },
+            "display": {
+              "required": false,
+              "default": "default",
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type."
+            },
+            "image": {
+              "required": false,
+              "description": "Image URL."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/categories"
+      }
+    },
+    "/wc/v1/products/categories/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Category name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "parent": {
+              "required": false,
+              "description": "The id for the parent of the resource."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            },
+            "display": {
+              "required": false,
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type."
+            },
+            "image": {
+              "required": false,
+              "description": "Image URL."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/categories/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Category name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "parent": {
+              "required": false,
+              "description": "The id for the parent of the resource."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            },
+            "display": {
+              "required": false,
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type."
+            },
+            "image": {
+              "required": false,
+              "description": "Image URL."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/categories/batch"
+      }
+    },
+    "/wc/v1/products/(?P<product_id>[\\d]+)/reviews": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/(?P<product_id>[\\d]+)/reviews/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/shipping_classes": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute."
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products."
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "parent": {
+              "required": false,
+              "description": "The id for the parent of the resource."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+      }
+    },
+    "/wc/v1/products/shipping_classes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Shipping class name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "parent": {
+              "required": false,
+              "description": "The id for the parent of the resource."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/shipping_classes/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Shipping class name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "parent": {
+              "required": false,
+              "description": "The id for the parent of the resource."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/shipping_classes/batch"
+      }
+    },
+    "/wc/v1/products/tags": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute."
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products."
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/tags"
+      }
+    },
+    "/wc/v1/products/tags/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Tag name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/tags/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Tag name."
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type."
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/tags/batch"
+      }
+    },
+    "/wc/v1/products": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date."
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to posts with a specific slug."
+            },
+            "filter": {
+              "required": false,
+              "description": "Use WP Query arguments to modify the response; private query vars require appropriate authorization."
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Limit result set to products assigned a specific status."
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Limit result set to products assigned a specific type."
+            },
+            "category": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific category."
+            },
+            "tag": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific tag."
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific shipping class."
+            },
+            "attribute": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute."
+            },
+            "attribute_term": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute term (required an assigned attribute)."
+            },
+            "sku": {
+              "required": false,
+              "description": "Limit result set to products with a specific SKU."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name."
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug."
+            },
+            "type": {
+              "required": false,
+              "default": "simple",
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type."
+            },
+            "status": {
+              "required": false,
+              "default": "publish",
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status)."
+            },
+            "featured": {
+              "required": false,
+              "default": false,
+              "description": "Featured product."
+            },
+            "catalog_visibility": {
+              "required": false,
+              "default": "visible",
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility."
+            },
+            "description": {
+              "required": false,
+              "description": "Product description."
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description."
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier."
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price."
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price."
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price."
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End data of sale price."
+            },
+            "virtual": {
+              "required": false,
+              "default": false,
+              "description": "If the product is virtual."
+            },
+            "downloadable": {
+              "required": false,
+              "default": false,
+              "description": "If the product is downloadable."
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files."
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Amount of times the product can be downloaded."
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days that the customer has up to be able to download the product."
+            },
+            "download_type": {
+              "required": false,
+              "default": "standard",
+              "enum": [
+                "standard",
+                "application",
+                "music"
+              ],
+              "description": "Download type, this controls the schema on the front-end."
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products."
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products."
+            },
+            "tax_status": {
+              "required": false,
+              "default": "taxable",
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status."
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class."
+            },
+            "manage_stock": {
+              "required": false,
+              "default": false,
+              "description": "Stock management at product level."
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity."
+            },
+            "in_stock": {
+              "required": false,
+              "default": true,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend."
+            },
+            "backorders": {
+              "required": false,
+              "default": "no",
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed."
+            },
+            "sold_individually": {
+              "required": false,
+              "default": false,
+              "description": "Allow one item to be bought in a single order."
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg)."
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions."
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug."
+            },
+            "reviews_allowed": {
+              "required": false,
+              "default": true,
+              "description": "Allow reviews."
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs."
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs."
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID."
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase."
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories."
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags."
+            },
+            "images": {
+              "required": false,
+              "description": "List of images."
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes."
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes."
+            },
+            "variations": {
+              "required": false,
+              "description": "List of variations."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products"
+      }
+    },
+    "/wc/v1/products/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name."
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug."
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type."
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status)."
+            },
+            "featured": {
+              "required": false,
+              "description": "Featured product."
+            },
+            "catalog_visibility": {
+              "required": false,
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility."
+            },
+            "description": {
+              "required": false,
+              "description": "Product description."
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description."
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier."
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price."
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price."
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price."
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End data of sale price."
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the product is virtual."
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the product is downloadable."
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files."
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Amount of times the product can be downloaded."
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days that the customer has up to be able to download the product."
+            },
+            "download_type": {
+              "required": false,
+              "enum": [
+                "standard",
+                "application",
+                "music"
+              ],
+              "description": "Download type, this controls the schema on the front-end."
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products."
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products."
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status."
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class."
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at product level."
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity."
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend."
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed."
+            },
+            "sold_individually": {
+              "required": false,
+              "description": "Allow one item to be bought in a single order."
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg)."
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions."
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug."
+            },
+            "reviews_allowed": {
+              "required": false,
+              "description": "Allow reviews."
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs."
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs."
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID."
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase."
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories."
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags."
+            },
+            "images": {
+              "required": false,
+              "description": "List of images."
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes."
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes."
+            },
+            "variations": {
+              "required": false,
+              "description": "List of variations."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion."
+            },
+            "reassign": {
+              "required": false
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/products/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name."
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug."
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type."
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status)."
+            },
+            "featured": {
+              "required": false,
+              "description": "Featured product."
+            },
+            "catalog_visibility": {
+              "required": false,
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility."
+            },
+            "description": {
+              "required": false,
+              "description": "Product description."
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description."
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier."
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price."
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price."
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price."
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End data of sale price."
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the product is virtual."
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the product is downloadable."
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files."
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Amount of times the product can be downloaded."
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days that the customer has up to be able to download the product."
+            },
+            "download_type": {
+              "required": false,
+              "enum": [
+                "standard",
+                "application",
+                "music"
+              ],
+              "description": "Download type, this controls the schema on the front-end."
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products."
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products."
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status."
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class."
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at product level."
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity."
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend."
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed."
+            },
+            "sold_individually": {
+              "required": false,
+              "description": "Allow one item to be bought in a single order."
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg)."
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions."
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug."
+            },
+            "reviews_allowed": {
+              "required": false,
+              "description": "Allow reviews."
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs."
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs."
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID."
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase."
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories."
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags."
+            },
+            "images": {
+              "required": false,
+              "description": "List of images."
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes."
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes."
+            },
+            "variations": {
+              "required": false,
+              "description": "List of variations."
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/products/batch"
+      }
+    },
+    "/wc/v1/reports/sales": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "period": {
+              "required": false,
+              "enum": [
+                "week",
+                "month",
+                "last_month",
+                "year"
+              ],
+              "description": "Report period."
+            },
+            "date_min": {
+              "required": false,
+              "description": "Return sales for a specific start date, the date need to be in the YYYY-MM-DD format."
+            },
+            "date_max": {
+              "required": false,
+              "description": "Return sales for a specific end date, the date need to be in the YYYY-MM-DD format."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/reports/sales"
+      }
+    },
+    "/wc/v1/reports/top_sellers": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "period": {
+              "required": false,
+              "enum": [
+                "week",
+                "month",
+                "last_month",
+                "year"
+              ],
+              "description": "Report period."
+            },
+            "date_min": {
+              "required": false,
+              "description": "Return sales for a specific start date, the date need to be in the YYYY-MM-DD format."
+            },
+            "date_max": {
+              "required": false,
+              "description": "Return sales for a specific end date, the date need to be in the YYYY-MM-DD format."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/reports/top_sellers"
+      }
+    },
+    "/wc/v1/reports": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/reports"
+      }
+    },
+    "/wc/v1/taxes/classes": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Tax class name."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/taxes/classes"
+      }
+    },
+    "/wc/v1/taxes/classes/(?P<slug>\\w[\\w\\s\\-]*)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/taxes": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "order",
+              "enum": [
+                "id",
+                "order"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Sort by tax class."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code."
+            },
+            "state": {
+              "required": false,
+              "description": "State code."
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode/ZIP."
+            },
+            "city": {
+              "required": false,
+              "description": "City name."
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate."
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name."
+            },
+            "priority": {
+              "required": false,
+              "default": 1,
+              "description": "Tax priority."
+            },
+            "compound": {
+              "required": false,
+              "default": false,
+              "description": "Whether or not this is a compound rate."
+            },
+            "shipping": {
+              "required": false,
+              "default": true,
+              "description": "Whether or not this tax rate also gets applied to shipping."
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries."
+            },
+            "class": {
+              "required": false,
+              "default": "standard",
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/taxes"
+      }
+    },
+    "/wc/v1/taxes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code."
+            },
+            "state": {
+              "required": false,
+              "description": "State code."
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode/ZIP."
+            },
+            "city": {
+              "required": false,
+              "description": "City name."
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate."
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name."
+            },
+            "priority": {
+              "required": false,
+              "description": "Tax priority."
+            },
+            "compound": {
+              "required": false,
+              "description": "Whether or not this is a compound rate."
+            },
+            "shipping": {
+              "required": false,
+              "description": "Whether or not this tax rate also gets applied to shipping."
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries."
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/taxes/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code."
+            },
+            "state": {
+              "required": false,
+              "description": "State code."
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode/ZIP."
+            },
+            "city": {
+              "required": false,
+              "description": "City name."
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate."
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name."
+            },
+            "priority": {
+              "required": false,
+              "description": "Tax priority."
+            },
+            "compound": {
+              "required": false,
+              "description": "Whether or not this is a compound rate."
+            },
+            "shipping": {
+              "required": false,
+              "description": "Whether or not this tax rate also gets applied to shipping."
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries."
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/taxes/batch"
+      }
+    },
+    "/wc/v1/webhooks/(?P<webhook_id>[\\d]+)/deliveries": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/webhooks/(?P<webhook_id>[\\d]+)/deliveries/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/webhooks": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection."
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set."
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string."
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date."
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date."
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids."
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids."
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items."
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending."
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute."
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to posts with a specific slug."
+            },
+            "filter": {
+              "required": false,
+              "description": "Use WP Query arguments to modify the response; private query vars require appropriate authorization."
+            },
+            "status": {
+              "required": false,
+              "default": "all",
+              "enum": [
+                "all",
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Limit result set to webhooks assigned a specific status."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook."
+            },
+            "status": {
+              "required": false,
+              "default": "active",
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status."
+            },
+            "topic": {
+              "required": true
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided."
+            },
+            "delivery_url": {
+              "required": true
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/webhooks"
+      }
+    },
+    "/wc/v1/webhooks/(?P<id>[\\d]+)": {
+      "namespace": "wc/v1",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response."
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook."
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status."
+            },
+            "topic": {
+              "required": false,
+              "description": "Webhook topic."
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided."
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v1/webhooks/batch": {
+      "namespace": "wc/v1",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook."
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status."
+            },
+            "topic": {
+              "required": false,
+              "description": "Webhook topic."
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided."
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v1/webhooks/batch"
+      }
+    }
+  },
+  "_links": {
+    "up": [
+      {
+        "href": "https://example.com/wp-json/"
+      }
+    ]
+  }
+}
+

Coupons

+

The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.

+

Coupon properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the object. read-only
codestringCoupon code. mandatory
date_createddate-timeThe date the coupon was created, in the site's timezone. read-only
date_modifieddate-timeThe date the coupon was last modified, in the site's timezone. read-only
descriptionstringCoupon description.
discount_typestringDetermines the type of discount that will be applied. Options: fixed_cart, percent, fixed_product and percent_product. Default: fixed_cart.
amountstringThe amount of discount.
expiry_datestringUTC DateTime when the coupon expires.
usage_countintegerNumber of times the coupon has been used already. read-only
individual_usebooleanWhether coupon can only be used individually.
product_idsarrayList of product ID's the coupon can be used on.
exclude_product_idsarrayList of product ID's the coupon cannot be used on.
usage_limitintegerHow many times the coupon can be used.
usage_limit_per_userintegerHow many times the coupon can be used per customer.
limit_usage_to_x_itemsintegerMax number of items in the cart the coupon can be applied to.
free_shippingbooleanDefine if can be applied for free shipping.
product_categoriesarrayList of category ID's the coupon applies to.
excluded_product_categoriesarrayList of category ID's the coupon does not apply to.
exclude_sale_itemsbooleanDefine if should not apply when have sale items.
minimum_amountstringMinimum order amount that needs to be in the cart before coupon applies.
maximum_amountstringMaximum order amount allowed when using the coupon.
email_restrictionsarrayList of email addresses that can use this coupon.
used_byarrayList of user IDs who have used the coupon. read-only
+

Create a coupon

+

This API helps you to create a new coupon.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/coupons
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/coupons \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "code": "10off",
+  "discount_type": "percent",
+  "amount": 10,
+  "individual_use": true,
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00"
+}'
+
const data = {
+  code: "10off",
+  discount_type: "percent",
+  amount: 10,
+  individual_use: true,
+  exclude_sale_items: true,
+  minimum_amount: "100.00"
+};
+
+WooCommerce.get("coupons")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
+
<?php
+$data = [
+    'code' => '10off',
+    'discount_type' => 'percent',
+    'amount' => 10,
+    'individual_use' => true,
+    'exclude_sale_items' => true,
+    'minimum_amount' => '100.00'
+];
+
+print_r($woocommerce->post('coupons', $data));
+?>
+
data = {
+    "code": "10off",
+    "discount_type": "percent",
+    "amount": 10,
+    "individual_use": True,
+    "exclude_sale_items": True,
+    "minimum_amount": "100.00"
+}
+
+print(wcapi.post("coupons", data).json())
+
data = {
+  code: "10off",
+  discount_type: "percent",
+  amount: 10,
+  individual_use: true,
+  exclude_sale_items: true,
+  minimum_amount: "100.00"
+}
+
+woocommerce.post("coupons", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 113,
+  "code": "10off",
+  "date_created": "2016-04-28T21:55:54",
+  "date_modified": "2016-04-28T21:55:54",
+  "discount_type": "percent",
+  "description": "",
+  "amount": "10.00",
+  "expiry_date": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "exclude_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": 0,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons/113"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons"
+      }
+    ]
+  }
+}
+

Retrieve a coupon

+

This API lets you retrieve and view a specific coupon by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/coupons/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/coupons/113 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("coupons/113")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('coupons/113')); ?>
+
print(wcapi.get("coupons/113").json())
+
woocommerce.get("coupons/113").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 113,
+  "code": "10off",
+  "date_created": "2016-04-28T21:55:54",
+  "date_modified": "2016-04-28T21:55:54",
+  "discount_type": "percent",
+  "description": "",
+  "amount": "10.00",
+  "expiry_date": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "exclude_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": 0,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons/113"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons"
+      }
+    ]
+  }
+}
+

List all coupons

+

This API helps you to list all the coupons that have been created.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/coupons
+
+
+
curl https://example.com/wp-json/wc/v1/coupons \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("coupons")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('coupons')); ?>
+
print(wcapi.get("coupons").json())
+
woocommerce.get("coupons").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 114,
+    "code": "free-shipping",
+    "date_created": "2016-04-28T21:58:25",
+    "date_modified": "2016-04-28T21:58:25",
+    "discount_type": "fixed_cart",
+    "description": "",
+    "amount": "0.00",
+    "expiry_date": null,
+    "usage_count": 0,
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "free_shipping": false,
+    "product_categories": [],
+    "excluded_product_categories": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "50.00",
+    "maximum_amount": "0.00",
+    "email_restrictions": [],
+    "used_by": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/coupons/114"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/coupons"
+        }
+      ]
+    }
+  },
+  {
+    "id": 113,
+    "code": "10off",
+    "date_created": "2016-04-28T21:55:54",
+    "date_modified": "2016-04-28T21:55:54",
+    "discount_type": "percent",
+    "description": "",
+    "amount": "10.00",
+    "expiry_date": null,
+    "usage_count": 0,
+    "individual_use": true,
+    "product_ids": [],
+    "exclude_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": 0,
+    "free_shipping": false,
+    "product_categories": [],
+    "excluded_product_categories": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "email_restrictions": [],
+    "used_by": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/coupons/113"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/coupons"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is date, Options: date, id, include, title and slug.
codestringLimit result set to resources with a specific code.
+

Update a coupon

+

This API lets you make changes to a coupon.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/coupons/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/coupons/113 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "amount": 5
+}'
+
const data = {
+  amount: 5
+};
+
+WooCommerce.put("coupons/113", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'amount' => 5
+];
+
+print_r($woocommerce->put('coupons/113', $data)); 
+?>
+
data = {
+    "amount": 5
+}
+
+print(wcapi.put("coupons/113", data).json())
+
data = {
+  amount: 5
+}
+
+woocommerce.put("coupons/113", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 113,
+  "code": "10off",
+  "date_created": "2016-04-28T21:55:54",
+  "date_modified": "2016-04-28T22:00:49",
+  "discount_type": "percent",
+  "description": "",
+  "amount": "5.00",
+  "expiry_date": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "exclude_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": 0,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons/113"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons"
+      }
+    ]
+  }
+}
+

Delete a coupon

+

This API helps you delete a coupon.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/coupons/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/coupons/113?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("coupons/113", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('coupons/113', ['force' => true])); ?>
+
print(wcapi.delete("coupons/113", params={"force": True}).json())
+
woocommerce.delete("coupons/113", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 113,
+  "code": "10off",
+  "date_created": "2016-04-28T21:55:54",
+  "date_modified": "2016-04-28T22:00:49",
+  "discount_type": "percent",
+  "description": "",
+  "amount": "5.00",
+  "expiry_date": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "exclude_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": 0,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons/113"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/coupons"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the coupon, Default is false.
+

Batch update coupons

+

This API helps you to batch create, update and delete multiple coupons.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/coupons/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/coupons/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "code": "20off",
+      "discount_type": "percent",
+      "amount": 20,
+      "individual_use": true,
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00"
+    },
+    {
+      "code": "30off",
+      "discount_type": "percent",
+      "amount": 30,
+      "individual_use": true,
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00"
+    }
+  ],
+  "update": [
+    {
+      "id": 113,
+      "minimum_amount": "50.00"
+    }
+  ],
+  "delete": [
+    137
+  ]
+}'
+
const data = {
+  create: [
+    {
+      code: "20off",
+      discount_type: "percent",
+      amount: 20,
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    },
+    {
+      code: "30off",
+      discount_type: "percent",
+      amount: 30,
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    }
+  ],
+  update: [
+    {
+      id: 113,
+      minimum_amount: "50.00"
+    }
+  ],
+  delete: [
+    137
+  ]
+};
+
+WooCommerce.post("customers/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'code' => '20off',
+            'discount_type' => 'percent',
+            'amount' => 20,
+            'individual_use' => true,
+            'exclude_sale_items' => true,
+            'minimum_amount' => '100.00'
+        ],
+        [
+            'code' => '30off',
+            'discount_type' => 'percent',
+            'amount' => 30,
+            'individual_use' => true,
+            'exclude_sale_items' => true,
+            'minimum_amount' => '100.00'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 113,
+            'minimum_amount' => '50.00'
+        ]
+    ],
+    'delete' => [
+        137
+    ]
+];
+
+print_r($woocommerce->post('customers/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "code": "20off",
+            "discount_type": "percent",
+            "amount": 20,
+            "individual_use": True,
+            "exclude_sale_items": True,
+            "minimum_amount": "100.00"
+        },
+        {
+            "code": "30off",
+            "discount_type": "percent",
+            "amount": 30,
+            "individual_use": True,
+            "exclude_sale_items": True,
+            "minimum_amount": "100.00"
+        }
+    ],
+    "update": [
+        {
+            "id": 113,
+            "minimum_amount": "50.00"
+        }
+    ],
+    "delete": [
+        137
+    ]
+}
+
+print(wcapi.post("customers/batch", data).json())
+
data = {
+  create: [
+    {
+      code: "20off",
+      discount_type: "percent",
+      amount: 20,
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    },
+    {
+      code: "30off",
+      discount_type: "percent",
+      amount: 30,
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    }
+  ],
+  update: [
+    {
+      id: 113,
+      minimum_amount: "50.00"
+    }
+  ],
+  delete: [
+    137
+  ]
+}
+
+woocommerce.post("customers/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 138,
+      "code": "20off",
+      "date_created": "2016-05-17T20:52:21",
+      "date_modified": "2016-05-17T20:52:21",
+      "discount_type": "percent",
+      "description": "",
+      "amount": "20.00",
+      "expiry_date": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons/138"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons"
+          }
+        ]
+      }
+    },
+    {
+      "id": 139,
+      "code": "30off",
+      "date_created": "2016-05-17T20:52:22",
+      "date_modified": "2016-05-17T20:52:22",
+      "discount_type": "percent",
+      "description": "",
+      "amount": "30.00",
+      "expiry_date": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons/139"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 113,
+      "code": "10off",
+      "date_created": "2016-04-28T21:55:54",
+      "date_modified": "2016-05-17T20:52:23",
+      "discount_type": "percent",
+      "description": "",
+      "amount": "5.00",
+      "expiry_date": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "50.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons/113"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 137,
+      "code": "50off",
+      "date_created": "2016-05-17T20:49:12",
+      "date_modified": "2016-05-17T20:50:30",
+      "discount_type": "fixed_cart",
+      "description": "",
+      "amount": "50.00",
+      "expiry_date": null,
+      "usage_count": 0,
+      "individual_use": false,
+      "product_ids": [],
+      "exclude_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": 0,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": false,
+      "minimum_amount": "0.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons/137"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/coupons"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Customers

+

The customer API allows you to create, view, update, and delete individual, or a batch, of customers.

+

Customer properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the customer was created, in the site's timezone. read-only
date_modifieddate-timeThe date the customer was last modified, in the site's timezone. read-only
emailstringThe email address for the customer. mandatory
first_namestringCustomer first name.
last_namestringCustomer last name.
usernamestringCustomer login name. Can be generated automatically from the customer's email address if the option woocommerce_registration_generate_username is equal to yes cannot be changed maybe mandatory
passwordstringCustomer password. Can be generated automatically with wp_generate_password() if the "Automatically generate customer password" option is enabled, check the index meta for generate_password write-only maybe mandatory
last_orderarrayLast order data. See Customer Last Order properties. read-only
orders_countintegerQuantity of orders made by the customer. read-only
total_spentstringTotal amount spent. read-only
avatar_urlstringAvatar URL.
billingarrayList of billing address data. See Billing Address properties.
shippingarrayList of shipping address data. See Shipping Address properties.
+

Customer last order properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerLast order ID. read-only
datedate-timeUTC DateTime of the customer last order. read-only
+

Billing address properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1.
address_2stringAddress line 2.
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringISO code of the country.
emailstringEmail address.
phonestringPhone number.
+

Shipping address properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1.
address_2stringAddress line 2.
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringISO code of the country.
+

Create a customer

+

This API helps you to create a new customer.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/customers
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/customers \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  }
+}'
+
const data = {
+  email: "john.doe@example.com",
+  first_name: "John",
+  last_name: "Doe",
+  username: "john.doe",
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  }
+};
+
+WooCommerce.post("customers", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'email' => 'john.doe@example.com',
+    'first_name' => 'John',
+    'last_name' => 'Doe',
+    'username' => 'john.doe',
+    'billing' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'company' => '',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US',
+        'email' => 'john.doe@example.com',
+        'phone' => '(555) 555-5555'
+    ],
+    'shipping' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'company' => '',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US'
+    ]
+];
+
+print_r($woocommerce->post('customers', $data));
+?>
+
data = {
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+    },
+    "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+    }
+}
+
+print(wcapi.post("customers", data).json())
+
data = {
+  email: "john.doe@example.com",
+  first_name: "John",
+  last_name: "Doe",
+  username: "john.doe",
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  }
+}
+
+woocommerce.post("customers", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 2,
+  "date_created": "2016-05-03T17:58:35",
+  "date_modified": "2016-05-11T21:34:43",
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "last_order": {
+    "id": 118,
+    "date": "2016-05-03T18:10:43"
+  },
+  "orders_count": 3,
+  "total_spent": "28.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers/2"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers"
+      }
+    ]
+  }
+}
+

Retrieve a customer

+

This API lets you retrieve and view a specific customer by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/customers/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/customers/2 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers/2")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers/2')); ?>
+
print(wcapi.get("customers/2").json())
+
woocommerce.get("customers/2").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 2,
+  "date_created": "2016-05-03T17:58:35",
+  "date_modified": "2016-05-11T21:34:43",
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "last_order": {
+    "id": 118,
+    "date": "2016-05-03T18:10:43"
+  },
+  "orders_count": 3,
+  "total_spent": "28.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers/2"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers"
+      }
+    ]
+  }
+}
+

List all customers

+

This API helps you to view all the customers.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/customers
+
+
+
curl https://example.com/wp-json/wc/v1/customers \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers')); ?>
+
print(wcapi.get("customers").json())
+
woocommerce.get("customers").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 5,
+    "date_created": "2016-05-11T21:39:01",
+    "date_modified": "2016-05-11T21:40:02",
+    "email": "joao.silva@example.com",
+    "first_name": "João",
+    "last_name": "Silva",
+    "username": "joao.silva",
+    "last_order": {
+      "id": null,
+      "date": null
+    },
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+    "billing": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR",
+      "email": "joao.silva@example.com",
+      "phone": "(55) 5555-5555"
+    },
+    "shipping": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/customers/5"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/customers"
+        }
+      ]
+    }
+  },
+  {
+    "id": 2,
+    "date_created": "2016-05-03T17:58:35",
+    "date_modified": "2016-05-11T21:34:43",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "last_order": {
+      "id": 118,
+      "date": "2016-05-03T18:10:43"
+    },
+    "orders_count": 3,
+    "total_spent": "28.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/customers/2"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/customers"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc, Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name and registered_date.
emailstringLimit result set to resources with a specific email.
rolestringLimit result set to resources with a specific role. Default: customer. Options (some plugins can add more user roles): all, administrator, editor, author, contributor, subscriber, customer and shop_manager
+

Update a customer

+

This API lets you make changes to a customer.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/customers/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/customers/2 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "first_name": "James",
+  "billing": {
+    "first_name": "James"
+  },
+  "shipping": {
+    "first_name": "James"
+  }
+}'
+
const data = {
+  first_name: "James",
+  billing: {
+    first_name: "James"
+  },
+  shipping: {
+    first_name: "James"
+  }
+};
+
+WooCommerce.put("customers/2", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'first_name' => 'James',
+    'billing' => [
+        'first_name' => 'James'
+    ],
+    'shipping' => [
+        'first_name' => 'James'
+    ]
+];
+
+print_r($woocommerce->put('customers/2', $data));
+?>
+
data = {
+    "first_name": "James",
+    "billing": {
+        "first_name": "James"
+    },
+    "shipping": {
+        "first_name": "James"
+    }
+}
+
+print(wcapi.put("customers/2", data).json())
+
data = {
+  first_name: "James",
+  billing: {
+    first_name: "James"
+  },
+  shipping: {
+    first_name: "James"
+  }
+}
+
+woocommerce.put("customers/2", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 2,
+  "date_created": "2016-05-03T17:58:35",
+  "date_modified": "2016-05-11T21:43:45",
+  "email": "john.doe@example.com",
+  "first_name": "James",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "last_order": {
+    "id": 118,
+    "date": "2016-05-03T18:10:43"
+  },
+  "orders_count": 3,
+  "total_spent": "28.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+  "billing": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers/2"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers"
+      }
+    ]
+  }
+}
+

Delete a customer

+

This API helps you delete a customer.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/customers/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/customers/2?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("customers/2", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('customers/2', ['force' => true])); ?>
+
print(wcapi.delete("customers/2", params={"force": True}).json())
+
woocommerce.delete("customers/2", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 2,
+  "date_created": "2016-05-03T17:58:35",
+  "date_modified": "2016-05-11T21:43:45",
+  "email": "john.doe@example.com",
+  "first_name": "James",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "last_order": {
+    "id": 118,
+    "date": "2016-05-03T18:10:43"
+  },
+  "orders_count": 3,
+  "total_spent": "28.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+  "billing": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers/2"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/customers"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update customers

+

This API helps you to batch create, update and delete multiple customers.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/customers/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/customers/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe2",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva2",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 5,
+      "billing": {
+        "phone": "(11) 1111-1111"
+      }
+    }
+  ],
+  "delete": [
+    2
+  ]
+}'
+
const data = {
+  create: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ],
+  update: [
+    {
+      id: 5,
+      billing: {
+        phone: "(11) 1111-1111"
+      }
+    }
+  ],
+  delete: [
+    2
+  ]
+};
+
+WooCommerce.post("customers/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'create' => [
+        [
+            'email' => 'john.doe2@example.com',
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'username' => 'john.doe2',
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'company' => '',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'company' => '',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ]
+        ],
+        [
+            'email' => 'joao.silva2@example.com',
+            'first_name' => 'João',
+            'last_name' => 'Silva',
+            'username' => 'joao.silva2',
+            'billing' => [
+                'first_name' => 'João',
+                'last_name' => 'Silva',
+                'company' => '',
+                'address_1' => 'Av. Brasil, 432',
+                'address_2' => '',
+                'city' => 'Rio de Janeiro',
+                'state' => 'RJ',
+                'postcode' => '12345-000',
+                'country' => 'BR',
+                'email' => 'joao.silva@example.com',
+                'phone' => '(55) 5555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'João',
+                'last_name' => 'Silva',
+                'company' => '',
+                'address_1' => 'Av. Brasil, 432',
+                'address_2' => '',
+                'city' => 'Rio de Janeiro',
+                'state' => 'RJ',
+                'postcode' => '12345-000',
+                'country' => 'BR'
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 5,
+            'billing' => [
+                'phone' => '(11) 1111-1111'
+            ]
+        ]
+    ],
+    'delete' => [
+        2
+    ]
+];
+
+print_r($woocommerce->post('customers/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "email": "john.doe2@example.com",
+            "first_name": "John",
+            "last_name": "Doe",
+            "username": "john.doe2",
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            }
+        },
+        {
+            "email": "joao.silva2@example.com",
+            "first_name": "João",
+            "last_name": "Silva",
+            "username": "joao.silva2",
+            "billing": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR",
+                "email": "joao.silva@example.com",
+                "phone": "(55) 5555-5555"
+            },
+            "shipping": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR"
+            }
+        }
+    ],
+    "update": [
+        {
+            "id": 5,
+            "billing": {
+                "phone": "(11) 1111-1111"
+            }
+        }
+    ],
+    "delete": [
+        2
+    ]
+}
+
+print(wcapi.post("customers/batch", data).json())
+
data = {
+  create: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ],
+  update: [
+    {
+      id: 5,
+      billing: {
+        phone: "(11) 1111-1111"
+      }
+    }
+  ],
+  delete: [
+    2
+  ]
+}
+
+woocommerce.post("customers/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 6,
+      "date_created": "2016-05-11T22:06:32",
+      "date_modified": "2016-05-11T22:07:31",
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe2",
+      "last_order": {
+        "id": null,
+        "date": null
+      },
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers/6"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers"
+          }
+        ]
+      }
+    },
+    {
+      "id": 7,
+      "date_created": "2016-05-11T22:07:33",
+      "date_modified": "2016-05-11T22:07:37",
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva2",
+      "last_order": {
+        "id": null,
+        "date": null
+      },
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers/7"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 5,
+      "date_created": "2016-05-11T21:39:01",
+      "date_modified": "2016-05-11T22:04:36",
+      "email": "joao.silva@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva",
+      "last_order": {
+        "id": null,
+        "date": null
+      },
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(11) 1111-1111"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers/5"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 2,
+      "date_created": "2016-05-03T17:58:35",
+      "date_modified": "2016-05-11T21:43:45",
+      "email": "john.doe@example.com",
+      "first_name": "James",
+      "last_name": "Doe",
+      "username": "john.doe",
+      "last_order": {
+        "id": 118,
+        "date": "2016-05-03T18:10:43"
+      },
+      "orders_count": 3,
+      "total_spent": "28.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/?s=96",
+      "billing": {
+        "first_name": "James",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "James",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers/2"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/customers"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve customer downloads

+

This API lets you retrieve customer downloads permissions.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/customers/<id>/downloads
+
+
+
curl https://example.com/wp-json/wc/v1/customers/2/downloads \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers/2/downloads")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers/2/downloads')); ?>
+
print(wcapi.get("customers/2/downloads").json())
+
woocommerce.get("customers/2/downloads").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "download_url": "https://example.com/?download_file=96&order=wc_order_571a7260c0da5&email=john.dow@xanmple.com&key=1789931e0c14ad9909a50c826f10c169",
+    "download_id": "1789931e0c14ad9909a50c826f10c169",
+    "product_id": 96,
+    "download_name": "Woo Album #4 &ndash; Testing",
+    "order_id": 105,
+    "order_key": "wc_order_571a7260c0da5",
+    "downloads_remaining": "unlimited",
+    "access_expires": "never",
+    "file": {
+      "name": "Testing",
+      "file": "http://example.com/wp-content/uploads/2013/06/cd_5_angle.jpg"
+    },
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/customers/1/downloads"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/96"
+        }
+      ],
+      "order": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/105"
+        }
+      ]
+    }
+  }
+]
+

Customer downloads properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
download_urlstringDownload file URL. read-only
download_idstringDownload ID (MD5). read-only
product_idintegerDownloadable product ID. read-only
download_namestringDownloadable file name. read-only
order_idintegerOrder ID. read-only
order_keystringOrder key. read-only
downloads_remainingstringAmount of downloads remaining. read-only
access_expiresstringThe date when the download access expires, in the site's timezone. read-only
filearrayFile details with name (file name) and file (file URL) attributes. read-only
+

Orders

+

The orders API allows you to create, view, update, and delete individual, or a batch, of orders.

+

Order properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
parent_idintegerParent order ID.
statusstringOrder status. Default is pending. Options (plugins may include new status): pending, processing, on-hold, completed, cancelled, refunded and failed.
order_keystringOrder key. read-only
numberstringOrder number. read-only
currencystringCurrency the order was created with, in ISO format, e.g USD. Default is the current store currency.
versionstringVersion of WooCommerce when the order was made. read-only
prices_include_taxbooleanShows if the prices included tax during checkout. read-only
date_createddate-timeThe date the order was created, in the site's timezone. read-only
date_modifieddate-timeThe date the order was last modified, in the site's timezone. read-only
customer_idintegerUser ID who owns the order. Use 0 for guests. Default is 0.
discount_totalstringTotal discount amount for the order. read-only
discount_taxstringTotal discount tax amount for the order. read-only
shipping_totalstringTotal shipping amount for the order. read-only
shipping_taxstringTotal shipping tax amount for the order. read-only
cart_taxstringSum of line item taxes only. read-only
totalstringGrand total. read-only
total_taxstringSum of all taxes. read-only
billingobjectBilling address. See Customer Billing Address properties.
shippingobjectShipping address. See Customer Shipping Address properties.
payment_methodstringPayment method ID.
payment_method_titlestringPayment method title.
set_paidbooleanDefine if the order is paid. It will set the status to processing and reduce stock items. Default is false. write-only
transaction_idstringUnique transaction ID. In write-mode only is available if set_paid is true.
customer_ip_addressstringCustomer's IP address. read-only
customer_user_agentstringUser agent of the customer. read-only
created_viastringShows where the order was created. read-only
customer_notestringNote left by customer during checkout.
date_completeddate-timeThe date the order was completed, in the site's timezone. read-only
date_paiddate-timeThe date the order has been paid, in the site's timezone. read-only
cart_hashstringMD5 hash of cart items to ensure orders are not modified. read-only
line_itemsarrayLine items data. See Line Items properties.
tax_linesarrayTax lines data. See Tax Lines properties. read-only
shipping_linesarrayShipping lines data. See Shipping Lines properties.
fee_linesarrayFee lines data. See Fee Lines Properties.
coupon_linesarrayCoupons line data. See Coupon Lines properties.
refundsarrayList of refunds. See Refunds Lines properties. read-only
+

Line item properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringProduct name. read-only
skustringProduct SKU. read-only
product_idintegerProduct ID.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classstringTax class of product. read-only
pricestringProduct price. read-only
subtotalstringLine subtotal (before discounts).
subtotal_taxstringLine subtotal tax (before discounts).
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts).
taxesarrayLine taxes with id, total and subtotal. read-only
metaarrayLine item meta data with key, label and value. read-only
+

Tax line properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
rate_codestringTax rate code. read-only
rate_idstringTax rate ID. read-only
labelstringTax rate label. read-only
compoundbooleanShow if is a compound tax rate. Compound tax rates are applied on top of other tax rates. read-only
tax_totalstringTax total (not including shipping taxes). read-only
shipping_tax_totalstringShipping tax total. read-only
+

Shipping line properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
method_titlestringShipping method name.
method_idstringShipping method ID. required
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes with id and total. read-only
+

Fee line properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringFee name. required
tax_classstringTax class. required if the fee is taxable
tax_statusstringTax status of fee. Set to taxable if need apply taxes.
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts).
taxesarrayLine taxes with id, total and subtotal. read-only
+

Coupon line properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
codestringCoupon code. required
discountstringDiscount total. required
discount_taxstringDiscount total tax. read-only
+

Refund line properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerRefund ID. read-only
reasonstringRefund reason. read-only
totalstringRefund total. read-only
+

Create an order

+

This API helps you to create a new order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/orders
+
+
+ +
+

Example of create a paid order:

+
+
curl -X POST https://example.com/wp-json/wc/v1/orders \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "set_paid": true,
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "line_items": [
+    {
+      "product_id": 93,
+      "quantity": 2
+    },
+    {
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1
+    }
+  ],
+  "shipping_lines": [
+    {
+      "method_id": "flat_rate",
+      "method_title": "Flat Rate",
+      "total": "10.00"
+    }
+  ]
+}'
+
const data = {
+  payment_method: "bacs",
+  payment_method_title: "Direct Bank Transfer",
+  set_paid: true,
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  },
+  line_items: [
+    {
+      product_id: 93,
+      quantity: 2
+    },
+    {
+      product_id: 22,
+      variation_id: 23,
+      quantity: 1
+    }
+  ],
+  shipping_lines: [
+    {
+      method_id: "flat_rate",
+      method_title: "Flat Rate",
+      total: "10.00"
+    }
+  ]
+};
+
+WooCommerce.post("orders", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'payment_method' => 'bacs',
+    'payment_method_title' => 'Direct Bank Transfer',
+    'set_paid' => true,
+    'billing' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US',
+        'email' => 'john.doe@example.com',
+        'phone' => '(555) 555-5555'
+    ],
+    'shipping' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US'
+    ],
+    'line_items' => [
+        [
+            'product_id' => 93,
+            'quantity' => 2
+        ],
+        [
+            'product_id' => 22,
+            'variation_id' => 23,
+            'quantity' => 1
+        ]
+    ],
+    'shipping_lines' => [
+        [
+            'method_id' => 'flat_rate',
+            'method_title' => 'Flat Rate',
+            'total' => '10.00'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('orders', $data));
+?>
+
data = {
+    "payment_method": "bacs",
+    "payment_method_title": "Direct Bank Transfer",
+    "set_paid": True,
+    "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+    },
+    "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+    },
+    "line_items": [
+        {
+            "product_id": 93,
+            "quantity": 2
+        },
+        {
+            "product_id": 22,
+            "variation_id": 23,
+            "quantity": 1
+        }
+    ],
+    "shipping_lines": [
+        {
+            "method_id": "flat_rate",
+            "method_title": "Flat Rate",
+            "total": "10.00"
+        }
+    ]
+}
+
+print(wcapi.post("orders", data).json())
+
data = {
+  payment_method: "bacs",
+  payment_method_title: "Direct Bank Transfer",
+  set_paid: true,
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  },
+  line_items: [
+    {
+      product_id: 93,
+      quantity: 2
+    },
+    {
+      product_id: 22,
+      variation_id: 23,
+      quantity: 1
+    }
+  ],
+  shipping_lines: [
+    {
+      method_id: "flat_rate",
+      method_title: "Flat Rate",
+      total: "10.00"
+    }
+  ]
+}
+
+woocommerce.post("orders", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 154,
+  "parent_id": 0,
+  "status": "processing",
+  "order_key": "wc_order_574cc02467274",
+  "number": "154",
+  "currency": "USD",
+  "version": "2.6.0",
+  "prices_include_tax": false,
+  "date_created": "2016-05-30T22:35:16",
+  "date_modified": "2016-05-30T22:35:16",
+  "customer_id": 0,
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.95",
+  "total": "37.95",
+  "total_tax": "1.95",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "bacs",
+  "transaction_id": "",
+  "customer_ip_address": "127.0.0.1",
+  "customer_user_agent": "curl/7.47.0",
+  "created_via": "rest-api",
+  "customer_note": "",
+  "date_completed": "2016-05-30T19:35:16",
+  "date_paid": "2016-05-30 19:35:25",
+  "cart_hash": "",
+  "line_items": [
+    {
+      "id": 18,
+      "name": "Woo Single #1",
+      "sku": "",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "price": "3.00",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 0.45,
+          "subtotal": 0.45
+        }
+      ],
+      "meta": []
+    },
+    {
+      "id": 19,
+      "name": "Ship Your Idea",
+      "sku": "",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "price": "20.00",
+      "subtotal": "20.00",
+      "subtotal_tax": "1.50",
+      "total": "20.00",
+      "total_tax": "1.50",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 1.5,
+          "subtotal": 1.5
+        }
+      ],
+      "meta": [
+        {
+          "key": "pa_color",
+          "label": "Color",
+          "value": "Black"
+        }
+      ]
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 21,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": "75",
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.95",
+      "shipping_tax_total": "0.00"
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 20,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/154"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders"
+      }
+    ]
+  }
+}
+

Retrieve an order

+

This API lets you retrieve and view a specific order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/orders/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/orders/154 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/154")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/154')); ?>
+
print(wcapi.get("orders/154").json())
+
woocommerce.get("orders/154").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 154,
+  "parent_id": 0,
+  "status": "processing",
+  "order_key": "wc_order_574cc02467274",
+  "number": "154",
+  "currency": "USD",
+  "version": "2.6.0",
+  "prices_include_tax": false,
+  "date_created": "2016-05-30T22:35:16",
+  "date_modified": "2016-05-30T22:35:16",
+  "customer_id": 0,
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.95",
+  "total": "37.95",
+  "total_tax": "1.95",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "bacs",
+  "transaction_id": "",
+  "customer_ip_address": "127.0.0.1",
+  "customer_user_agent": "curl/7.47.0",
+  "created_via": "rest-api",
+  "customer_note": "",
+  "date_completed": "2016-05-30T19:35:16",
+  "date_paid": "2016-05-30 19:35:25",
+  "cart_hash": "",
+  "line_items": [
+    {
+      "id": 18,
+      "name": "Woo Single #1",
+      "sku": "",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "price": "3.00",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 0.45,
+          "subtotal": 0.45
+        }
+      ],
+      "meta": []
+    },
+    {
+      "id": 19,
+      "name": "Ship Your Idea",
+      "sku": "",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "price": "20.00",
+      "subtotal": "20.00",
+      "subtotal_tax": "1.50",
+      "total": "20.00",
+      "total_tax": "1.50",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 1.5,
+          "subtotal": 1.5
+        }
+      ],
+      "meta": [
+        {
+          "key": "pa_color",
+          "label": "Color",
+          "value": "Black"
+        }
+      ]
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 21,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": "75",
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.95",
+      "shipping_tax_total": "0.00"
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 20,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/154"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
dpstringNumber of decimal points to use in each resource.
+

List all orders

+

This API helps you to view all the orders.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/orders
+
+
+
curl https://example.com/wp-json/wc/v1/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders')); ?>
+
print(wcapi.get("orders").json())
+
woocommerce.get("orders").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 154,
+    "parent_id": 0,
+    "status": "processing",
+    "order_key": "wc_order_574cc02467274",
+    "number": "154",
+    "currency": "USD",
+    "version": "2.6.0",
+    "prices_include_tax": false,
+    "date_created": "2016-05-30T22:35:16",
+    "date_modified": "2016-05-30T22:35:16",
+    "customer_id": 0,
+    "discount_total": "0.00",
+    "discount_tax": "0.00",
+    "shipping_total": "10.00",
+    "shipping_tax": "0.00",
+    "cart_tax": "1.95",
+    "total": "37.95",
+    "total_tax": "1.95",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "payment_method": "bacs",
+    "payment_method_title": "bacs",
+    "transaction_id": "",
+    "customer_ip_address": "127.0.0.1",
+    "customer_user_agent": "curl/7.47.0",
+    "created_via": "rest-api",
+    "customer_note": "",
+    "date_completed": "2016-05-30T19:35:16",
+    "date_paid": "2016-05-30 19:35:25",
+    "cart_hash": "",
+    "line_items": [
+      {
+        "id": 18,
+        "name": "Woo Single #1",
+        "sku": "",
+        "product_id": 93,
+        "variation_id": 0,
+        "quantity": 2,
+        "tax_class": "",
+        "price": "3.00",
+        "subtotal": "6.00",
+        "subtotal_tax": "0.45",
+        "total": "6.00",
+        "total_tax": "0.45",
+        "taxes": [
+          {
+            "id": 75,
+            "total": 0.45,
+            "subtotal": 0.45
+          }
+        ],
+        "meta": []
+      },
+      {
+        "id": 19,
+        "name": "Ship Your Idea",
+        "sku": "",
+        "product_id": 22,
+        "variation_id": 23,
+        "quantity": 1,
+        "tax_class": "",
+        "price": "20.00",
+        "subtotal": "20.00",
+        "subtotal_tax": "1.50",
+        "total": "20.00",
+        "total_tax": "1.50",
+        "taxes": [
+          {
+            "id": 75,
+            "total": 1.5,
+            "subtotal": 1.5
+          }
+        ],
+        "meta": [
+          {
+            "key": "pa_color",
+            "label": "Color",
+            "value": "Black"
+          }
+        ]
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 21,
+        "rate_code": "US-CA-STATE TAX",
+        "rate_id": "75",
+        "label": "State Tax",
+        "compound": false,
+        "tax_total": "1.95",
+        "shipping_tax_total": "0.00"
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 20,
+        "method_title": "Flat Rate",
+        "method_id": "flat_rate",
+        "total": "10.00",
+        "total_tax": "0.00",
+        "taxes": []
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "refunds": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/154"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders"
+        }
+      ]
+    }
+  },
+  {
+    "id": 116,
+    "parent_id": 0,
+    "status": "processing",
+    "order_key": "wc_order_5728e6e53d2a4",
+    "number": "116",
+    "currency": "USD",
+    "version": "2.6.0",
+    "prices_include_tax": false,
+    "date_created": "2016-05-03T17:59:00",
+    "date_modified": "2016-05-30T22:37:31",
+    "customer_id": 1,
+    "discount_total": "0.00",
+    "discount_tax": "0.00",
+    "shipping_total": "10.00",
+    "shipping_tax": "0.00",
+    "cart_tax": "0.00",
+    "total": "14.00",
+    "total_tax": "0.00",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@claudiosmweb.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "payment_method": "bacs",
+    "payment_method_title": "Direct Bank Transfer",
+    "transaction_id": "",
+    "customer_ip_address": "127.0.0.1",
+    "customer_user_agent": "curl/7.47.0",
+    "created_via": "",
+    "customer_note": "",
+    "date_completed": "2016-05-30T19:35:16",
+    "date_paid": "2016-05-03 14:59:12",
+    "cart_hash": "",
+    "line_items": [
+      {
+        "id": 6,
+        "name": "Woo Single #2",
+        "sku": "12345",
+        "product_id": 99,
+        "variation_id": 0,
+        "quantity": 2,
+        "tax_class": "",
+        "price": "2.00",
+        "subtotal": "4.00",
+        "subtotal_tax": "0.00",
+        "total": "4.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta": []
+      }
+    ],
+    "tax_lines": [],
+    "shipping_lines": [
+      {
+        "id": 7,
+        "method_title": "Flat Rate",
+        "method_id": "flat_rate",
+        "total": "10.00",
+        "total_tax": "0.00",
+        "taxes": []
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "refunds": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders"
+        }
+      ],
+      "customer": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/customers/1"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is date, Options: date, id, include, title and slug.
statusstringLimit result set to orders assigned a specific status. Default is any. Options (plugins may add new status): any, pending, processing, on-hold, completed, cancelled, refunded and failed.
customerstringLimit result set to orders assigned a specific customer.
productstringLimit result set to orders assigned a specific product.
dpstringNumber of decimal points to use in each resource.
+

Update an Order

+

This API lets you make changes to an order.

+

HTTP Request

+
+
+ PUT +
/wp-json/wc/v1/orders/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/orders/154 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "status": "completed"
+}'
+
const data = {
+  status: "completed"
+};
+
+WooCommerce.put("orders/154", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'status' => 'completed'
+];
+
+print_r($woocommerce->put('orders/154', $data));
+?>
+
data = {
+    "status": "completed"
+}
+
+print(wcapi.put("orders/154", data).json())
+
data = {
+  status: "completed"
+}
+
+woocommerce.put("orders/154", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 154,
+  "parent_id": 0,
+  "status": "completed",
+  "order_key": "wc_order_574cc02467274",
+  "number": "154",
+  "currency": "USD",
+  "version": "2.6.0",
+  "prices_include_tax": false,
+  "date_created": "2016-05-30T22:35:16",
+  "date_modified": "2016-05-30T22:46:16",
+  "customer_id": 0,
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.95",
+  "total": "37.95",
+  "total_tax": "1.95",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "bacs",
+  "transaction_id": "",
+  "customer_ip_address": "127.0.0.1",
+  "customer_user_agent": "curl/7.47.0",
+  "created_via": "rest-api",
+  "customer_note": "",
+  "date_completed": "2016-05-30T19:47:46",
+  "date_paid": "2016-05-30 19:35:25",
+  "cart_hash": "",
+  "line_items": [
+    {
+      "id": 18,
+      "name": "Woo Single #1",
+      "sku": "",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "price": "3.00",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 0.45,
+          "subtotal": 0.45
+        }
+      ],
+      "meta": []
+    },
+    {
+      "id": 19,
+      "name": "Ship Your Idea",
+      "sku": "",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "price": "20.00",
+      "subtotal": "20.00",
+      "subtotal_tax": "1.50",
+      "total": "20.00",
+      "total_tax": "1.50",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 1.5,
+          "subtotal": 1.5
+        }
+      ],
+      "meta": [
+        {
+          "key": "pa_color",
+          "label": "Color",
+          "value": "Black"
+        }
+      ]
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 21,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": "75",
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.95",
+      "shipping_tax_total": "0.00"
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 20,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/154"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders"
+      }
+    ]
+  }
+}
+

Delete an order

+

This API helps you delete an order.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/orders/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/orders/154?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/154", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/154', ['force' => true])); ?>
+
print(wcapi.delete("orders/154", params={"force": True}).json())
+
woocommerce.delete("orders/154", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 154,
+  "parent_id": 0,
+  "status": "completed",
+  "order_key": "wc_order_574cc02467274",
+  "number": "154",
+  "currency": "USD",
+  "version": "2.6.0",
+  "prices_include_tax": false,
+  "date_created": "2016-05-30T22:35:16",
+  "date_modified": "2016-05-30T22:46:16",
+  "customer_id": 0,
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.95",
+  "total": "37.95",
+  "total_tax": "1.95",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "bacs",
+  "transaction_id": "",
+  "customer_ip_address": "127.0.0.1",
+  "customer_user_agent": "curl/7.47.0",
+  "created_via": "rest-api",
+  "customer_note": "",
+  "date_completed": "2016-05-30T19:47:46",
+  "date_paid": "2016-05-30 19:35:25",
+  "cart_hash": "",
+  "line_items": [
+    {
+      "id": 18,
+      "name": "Woo Single #1",
+      "sku": "",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "price": "3.00",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 0.45,
+          "subtotal": 0.45
+        }
+      ],
+      "meta": []
+    },
+    {
+      "id": 19,
+      "name": "Ship Your Idea",
+      "sku": "",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "price": "20.00",
+      "subtotal": "20.00",
+      "subtotal_tax": "1.50",
+      "total": "20.00",
+      "total_tax": "1.50",
+      "taxes": [
+        {
+          "id": 75,
+          "total": 1.5,
+          "subtotal": 1.5
+        }
+      ],
+      "meta": [
+        {
+          "key": "pa_color",
+          "label": "Color",
+          "value": "Black"
+        }
+      ]
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 21,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": "75",
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.95",
+      "shipping_tax_total": "0.00"
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 20,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/154"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the order, Default is false.
+

Batch update orders

+

This API helps you to batch create, update and delete multiple orders.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/orders/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/orders/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "line_items": [
+        {
+          "product_id": 79,
+          "quantity": 1
+        },
+        {
+          "product_id": 93,
+          "quantity": 1
+        },
+        {
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1
+        }
+      ],
+      "shipping_lines": [
+        {
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "30.00"
+        }
+      ]
+    },
+    {
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "set_paid": true,
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "line_items": [
+        {
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1
+        },
+        {
+          "product_id": 22,
+          "variation_id": 24,
+          "quantity": 1
+        }
+      ],
+      "shipping_lines": [
+        {
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "20.00"
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 154,
+      "shipping_methods": "Local Delivery"
+    }
+  ],
+  "delete": [
+    154
+  ]
+}'
+
const data = {
+  create: [
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 79,
+          quantity: 1
+        },
+        {
+          product_id: 93,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "30.00"
+        }
+      ]
+    },
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      set_paid: true,
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 24,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "20.00"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 154,
+      shipping_methods: "Local Delivery"
+    }
+  ],
+  delete: [
+    154
+  ]
+};
+
+WooCommerce.post("orders/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'payment_method' => 'bacs',
+            'payment_method_title' => 'Direct Bank Transfer',
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ],
+            'line_items' => [
+                [
+                    'product_id' => 79,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 93,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 22,
+                    'variation_id' => 23,
+                    'quantity' => 1
+                ]
+            ],
+            'shipping_lines' => [
+                [
+                    'method_id' => 'flat_rate',
+                    'method_title' => 'Flat Rate',
+                    'total' => '30.00'
+                ]
+            ]
+        ],
+        [
+            'payment_method' => 'bacs',
+            'payment_method_title' => 'Direct Bank Transfer',
+            'set_paid' => true,
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ],
+            'line_items' => [
+                [
+                    'product_id' => 22,
+                    'variation_id' => 23,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 22,
+                    'variation_id' => 24,
+                    'quantity' => 1
+                ]
+            ],
+            'shipping_lines' => [
+                [
+                    'method_id' => 'flat_rate',
+                    'method_title' => 'Flat Rate',
+                    'total' => '20.00'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 154,
+            'shipping_methods' => 'Local Delivery'
+        ]
+    ],
+    'delete' => [
+        154
+    ]
+];
+
+print_r($woocommerce->post('orders/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "payment_method": "bacs",
+            "payment_method_title": "Direct Bank Transfer",
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            },
+            "line_items": [
+                {
+                    "product_id": 79,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 93,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 22,
+                    "variation_id": 23,
+                    "quantity": 1
+                }
+            ],
+            "shipping_lines": [
+                {
+                    "method_id": "flat_rate",
+                    "method_title": "Flat Rate",
+                    "total": "30.00"
+                }
+            ]
+        },
+        {
+            "payment_method": "bacs",
+            "payment_method_title": "Direct Bank Transfer",
+            "set_paid": True,
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            },
+            "line_items": [
+                {
+                    "product_id": 22,
+                    "variation_id": 23,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 22,
+                    "variation_id": 24,
+                    "quantity": 1
+                }
+            ],
+            "shipping_lines": [
+                {
+                    "method_id": "flat_rate",
+                    "method_title": "Flat Rate",
+                    "total": "20.00"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 154,
+            "shipping_methods": "Local Delivery"
+        }
+    ],
+    "delete": [
+        154
+    ]
+}
+
+print(wcapi.post("orders/batch", data).json())
+
data = {
+  create: [
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 79,
+          quantity: 1
+        },
+        {
+          product_id: 93,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "30.00"
+        }
+      ]
+    },
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      set_paid: true,
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 24,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "20.00"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 154,
+      shipping_methods: "Local Delivery"
+    }
+  ],
+  delete: [
+    154
+  ]
+}
+
+woocommerce.post("orders/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 155,
+      "parent_id": 0,
+      "status": "pending",
+      "order_key": "wc_order_574cc9541cea3",
+      "number": "155",
+      "currency": "USD",
+      "version": "2.6.0",
+      "prices_include_tax": false,
+      "date_created": "2016-05-30T23:14:28",
+      "date_modified": "2016-05-30T23:14:28",
+      "customer_id": 0,
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "30.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "2.85",
+      "total": "70.85",
+      "total_tax": "2.85",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "bacs",
+      "transaction_id": "",
+      "customer_ip_address": "127.0.0.1",
+      "customer_user_agent": "curl/7.47.0",
+      "created_via": "rest-api",
+      "customer_note": "",
+      "date_completed": "2016-05-30T20:14:28",
+      "date_paid": "",
+      "cart_hash": "",
+      "line_items": [
+        {
+          "id": 22,
+          "name": "Woo Logo",
+          "sku": "",
+          "product_id": 79,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "15.00",
+          "subtotal": "15.00",
+          "subtotal_tax": "1.13",
+          "total": "15.00",
+          "total_tax": "1.13",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 1.125,
+              "subtotal": 1.125
+            }
+          ],
+          "meta": []
+        },
+        {
+          "id": 23,
+          "name": "Woo Single #1",
+          "sku": "",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "3.00",
+          "subtotal": "3.00",
+          "subtotal_tax": "0.23",
+          "total": "3.00",
+          "total_tax": "0.23",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 0.225,
+              "subtotal": 0.225
+            }
+          ],
+          "meta": []
+        },
+        {
+          "id": 24,
+          "name": "Ship Your Idea",
+          "sku": "",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "20.00",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 1.5,
+              "subtotal": 1.5
+            }
+          ],
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 26,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": "75",
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "2.85",
+          "shipping_tax_total": "0.00"
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 25,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "30.00",
+          "total_tax": "0.00",
+          "taxes": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders/155"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders"
+          }
+        ]
+      }
+    },
+    {
+      "id": 156,
+      "parent_id": 0,
+      "status": "processing",
+      "order_key": "wc_order_574cc95465214",
+      "number": "156",
+      "currency": "USD",
+      "version": "2.6.0",
+      "prices_include_tax": false,
+      "date_created": "2016-05-30T23:14:28",
+      "date_modified": "2016-05-30T23:14:28",
+      "customer_id": 0,
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "20.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "3.00",
+      "total": "63.00",
+      "total_tax": "3.00",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "bacs",
+      "transaction_id": "",
+      "customer_ip_address": "127.0.0.1",
+      "customer_user_agent": "curl/7.47.0",
+      "created_via": "rest-api",
+      "customer_note": "",
+      "date_completed": "2016-05-30T20:14:28",
+      "date_paid": "2016-05-30 20:14:37",
+      "cart_hash": "",
+      "line_items": [
+        {
+          "id": 27,
+          "name": "Ship Your Idea",
+          "sku": "",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "20.00",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 1.5,
+              "subtotal": 1.5
+            }
+          ],
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        },
+        {
+          "id": 28,
+          "name": "Ship Your Idea",
+          "sku": "",
+          "product_id": 22,
+          "variation_id": 24,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "20.00",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 1.5,
+              "subtotal": 1.5
+            }
+          ],
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Green"
+            }
+          ]
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 30,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": "75",
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "3.00",
+          "shipping_tax_total": "0.00"
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 29,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "taxes": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders/156"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 154,
+      "parent_id": 0,
+      "status": "completed",
+      "order_key": "wc_order_574cc02467274",
+      "number": "154",
+      "currency": "USD",
+      "version": "2.6.0",
+      "prices_include_tax": false,
+      "date_created": "2016-05-30T22:35:16",
+      "date_modified": "2016-05-30T22:55:19",
+      "customer_id": 0,
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "10.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "1.95",
+      "total": "37.95",
+      "total_tax": "1.95",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "bacs",
+      "transaction_id": "",
+      "customer_ip_address": "127.0.0.1",
+      "customer_user_agent": "curl/7.47.0",
+      "created_via": "rest-api",
+      "customer_note": "",
+      "date_completed": "2016-05-30T19:47:46",
+      "date_paid": "2016-05-30 19:35:25",
+      "cart_hash": "",
+      "line_items": [
+        {
+          "id": 18,
+          "name": "Woo Single #1",
+          "sku": "",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 2,
+          "tax_class": "",
+          "price": "3.00",
+          "subtotal": "6.00",
+          "subtotal_tax": "0.45",
+          "total": "6.00",
+          "total_tax": "0.45",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 0.45,
+              "subtotal": 0.45
+            }
+          ],
+          "meta": []
+        },
+        {
+          "id": 19,
+          "name": "Ship Your Idea",
+          "sku": "",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "20.00",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 1.5,
+              "subtotal": 1.5
+            }
+          ],
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 21,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": "75",
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "1.95",
+          "shipping_tax_total": "0.00"
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 20,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "10.00",
+          "total_tax": "0.00",
+          "taxes": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders/154"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 154,
+      "parent_id": 0,
+      "status": "completed",
+      "order_key": "wc_order_574cc02467274",
+      "number": "154",
+      "currency": "USD",
+      "version": "2.6.0",
+      "prices_include_tax": false,
+      "date_created": "2016-05-30T22:35:16",
+      "date_modified": "2016-05-30T22:55:19",
+      "customer_id": 0,
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "10.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "1.95",
+      "total": "37.95",
+      "total_tax": "1.95",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "bacs",
+      "transaction_id": "",
+      "customer_ip_address": "127.0.0.1",
+      "customer_user_agent": "curl/7.47.0",
+      "created_via": "rest-api",
+      "customer_note": "",
+      "date_completed": "2016-05-30T19:47:46",
+      "date_paid": "2016-05-30 19:35:25",
+      "cart_hash": "",
+      "line_items": [
+        {
+          "id": 18,
+          "name": "Woo Single #1",
+          "sku": "",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 2,
+          "tax_class": "",
+          "price": "3.00",
+          "subtotal": "6.00",
+          "subtotal_tax": "0.45",
+          "total": "6.00",
+          "total_tax": "0.45",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 0.45,
+              "subtotal": 0.45
+            }
+          ],
+          "meta": []
+        },
+        {
+          "id": 19,
+          "name": "Ship Your Idea",
+          "sku": "",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "price": "20.00",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": 1.5,
+              "subtotal": 1.5
+            }
+          ],
+          "meta": [
+            {
+              "key": "pa_color",
+              "label": "Color",
+              "value": "Black"
+            }
+          ]
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 21,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": "75",
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "1.95",
+          "shipping_tax_total": "0.00"
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 20,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "10.00",
+          "total_tax": "0.00",
+          "taxes": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders/154"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/orders"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Order notes

+

The order notes API allows you to create, view, and delete individual order notes.
+Order notes are added by administrators and programmatically to store data about an order, or order events.

+

Order note properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the order note was created, in the site's timezone. read-only
notestringOrder note. required
customer_notebooleanShows/define if the note is only for reference or for the customer (the user will be notified). Default is false.
+

Create an order note

+

This API helps you to create a new note for an order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/orders/<id>/notes
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/orders/645/notes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "note": "Order ok!!!"
+}'
+
const data = {
+  note: "Order ok!!!"
+};
+
+WooCommerce.post("orders/645/notes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'note' => 'Order ok!!!'
+];
+
+print_r($woocommerce->post('orders/645/notes', $data));
+?>
+
data = {
+    "note": "Order ok!!!"
+}
+
+print(wcapi.post("orders/645/notes", data).json())
+
data = {
+  note: "Order ok!!!"
+}
+
+woocommerce.post("orders/645/notes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 51,
+  "date_created": "2016-05-13T20:51:55",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118/notes/51"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118"
+      }
+    ]
+  }
+}
+

Retrieve an order note

+

This API lets you retrieve and view a specific note from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/orders/<id>/notes/<note_id>
+
+
+
curl https://example.com/wp-json/wc/v1/orders/645/notes/51 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/645/notes/51")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/645/notes/51')); ?>
+
print(wcapi.get("orders/645/notes/51").json())
+
woocommerce.get("orders/645/notes/51").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 51,
+  "date_created": "2016-05-13T20:51:55",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118/notes/51"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118"
+      }
+    ]
+  }
+}
+

List all order notes

+

This API helps you to view all the notes from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/orders/<id>/notes
+
+
+
curl https://example.com/wp-json/wc/v1/orders/645/notes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/645/notes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/645/notes')); ?>
+
print(wcapi.get("orders/645/notes").json())
+
woocommerce.get("orders/645/notes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 51,
+    "date_created": "2016-05-13T20:51:55",
+    "note": "Order ok!!!",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/118/notes/51"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/118/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/118"
+        }
+      ]
+    }
+  },
+  {
+    "id": 46,
+    "date_created": "2016-05-03T18:10:43",
+    "note": "Order status changed from Pending Payment to Processing.",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/118/notes/46"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/118/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/118"
+        }
+      ]
+    }
+  }
+]
+

Delete an order note

+

This API helps you delete an order note.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/orders/<id>/notes/<note_id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/orders/645/notes/51?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/645/notes/51", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/645/notes/51', ['force' => true])); ?>
+
print(wcapi.delete("orders/645/notes/51", params={"force": True}).json())
+
woocommerce.delete("orders/645/notes/51", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 51,
+  "date_created": "2016-05-13T20:51:55",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118/notes/51"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/118"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Refunds

+

The refunds API allows you to create, view, and delete individual refunds.

+

Refund properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the order refund was created, in the site's timezone. read-only
amountstringRefund amount. required
reasonstringReason for refund.
line_itemsarrayLine items data. See Refunds Line Items properties.
+

Refund line item properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringProduct name. read-only
skustringProduct SKU. read-only
product_idintegerProduct ID.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classstringTax class of product. read-only
pricestringProduct price. read-only
subtotalstringLine subtotal (before discounts).
subtotal_taxstringLine subtotal tax (before discounts).
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts).
taxesarrayLine total tax with id, total and subtotal. read-only
metaarrayLine item meta data with key, label and value. read-only
+

Create a refund

+

This API helps you to create a new refund for an order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/orders/<id>/refunds
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/orders/116/refunds \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "amount": "10"
+}'
+
const data = {
+  amount: "10"
+};
+
+WooCommerce.post("orders/116/refunds", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'amount' => '10'
+];
+
+print_r($woocommerce->post('orders/116/refunds', $data));
+?>
+
data = {
+    "amount": "10"
+}
+
+print(wcapi.post("orders/116/refunds", data).json())
+
data = {
+  amount: "10"
+}
+
+woocommerce.post("orders/116/refunds", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 150,
+  "date_created": "2016-05-30T17:28:05",
+  "amount": "10.00",
+  "reason": "",
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116/refunds/150"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116"
+      }
+    ]
+  }
+}
+

Retrieve a refund

+

This API lets you retrieve and view a specific refund from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/orders/<id>/refunds/<refund_id>
+
+
+
curl https://example.com/wp-json/wc/v1/orders/116/refunds/150 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/116/refunds/150")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/116/refunds/150')); ?>
+
print(wcapi.get("orders/116/refunds/150").json())
+
woocommerce.get("orders/116/refunds/150").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 150,
+  "date_created": "2016-05-30T17:28:05",
+  "amount": "10.00",
+  "reason": "",
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116/refunds/150"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
dpstringNumber of decimal points to use in each resource.
+

List all refunds

+

This API helps you to view all the refunds from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/orders/<id>/refunds
+
+
+
curl https://example.com/wp-json/wc/v1/orders/116/refunds \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/116/refunds")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/116/refunds')); ?>
+
print(wcapi.get("orders/116/refunds").json())
+
woocommerce.get("orders/116/refunds").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 151,
+    "date_created": "2016-05-30T17:31:48",
+    "amount": "2.00",
+    "reason": "",
+    "line_items": [
+      {
+        "id": 11,
+        "name": "Woo Single #2",
+        "sku": "12345",
+        "product_id": 99,
+        "variation_id": 0,
+        "quantity": -1,
+        "tax_class": "",
+        "price": "-2.00",
+        "subtotal": "-2.00",
+        "subtotal_tax": "0.00",
+        "total": "-2.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta": []
+      }
+    ],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116/refunds/151"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116/refunds"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116"
+        }
+      ]
+    }
+  },
+  {
+    "id": 150,
+    "date_created": "2016-05-30T17:28:05",
+    "amount": "10.00",
+    "reason": "",
+    "line_items": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116/refunds/150"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116/refunds"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/orders/116"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is date, Options: date, id, include, title and slug.
dpstringNumber of decimal points to use in each resource.
+

Delete a refund

+

This API helps you delete an order refund.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/orders/<id>/refunds/<refund_id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/orders/116/refunds/150?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/116/refunds/150", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/116/refunds/150', ['force' => true])); ?>
+
print(wcapi.delete("orders/116/refunds/150", params={"force": True}).json())
+
woocommerce.delete("orders/116/refunds/150", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 150,
+  "date_created": "2016-05-30T17:28:05",
+  "amount": "10.00",
+  "reason": "",
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116/refunds/150"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/orders/116"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Products

+

The products API allows you to create, view, update, and delete individual, or a batch, of products.

+

Product properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringProduct name.
slugstringProduct slug.
permalinkstringProduct URL. read-only
date_createddate-timeThe date the product was created, in the site's timezone. read-only
date_modifieddate-timeThe date the product was last modified, in the site's timezone. read-only
typestringProduct type. Default is simple. Options (plugins may add new options): simple, grouped, external, variable.
statusstringProduct status (post status). Default is publish. Options (plugins may add new options): draft, pending, private and publish.
featuredbooleanFeatured product. Default is false.
catalog_visibilitystringCatalog visibility. Default is visible. Options: visible (Catalog and search), catalog (Only in catalog), search (Only in search) and hidden (Hidden from all).
descriptionstringProduct description.
short_descriptionstringProduct short description.
skustringUnique identifier.
pricestringCurrent product price. This is setted from regular_price and sale_price. read-only
regular_pricestringProduct regular price.
sale_pricestringProduct sale price.
date_on_sale_fromstringStart date of sale price. Date in the YYYY-MM-DD format.
date_on_sale_tostringSets the sale end date. Date in the YYYY-MM-DD format.
price_htmlstringPrice formatted in HTML, e.g. <del><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;&nbsp;3.00</span></span></del> <ins><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;&nbsp;2.00</span></span></ins> read-only
on_salebooleanShows if the product is on sale. read-only
purchasablebooleanShows if the product can be bought. read-only
total_salesintegerAmount of sales. read-only
virtualbooleanIf the product is virtual. Virtual products are intangible and aren't shipped. Default is false.
downloadablebooleanIf the product is downloadable. Downloadable products give access to a file upon purchase. Default is false.
downloadsarrayList of downloadable files. See Downloads properties.
download_limitintegerAmount of times the product can be downloaded, the -1 values means unlimited re-downloads. Default is -1.
download_expiryintegerNumber of days that the customer has up to be able to download the product, the -1 means that downloads never expires. Default is -1.
download_typestringDownload type, this controls the schema on the front-end. Default is standard. Options: 'standard' (Standard Product), application (Application/Software) and music (Music).
external_urlstringProduct external URL. Only for external products.
button_textstringProduct external button text. Only for external products.
tax_statusstringTax status. Default is taxable. Options: taxable, shipping (Shipping only) and none.
tax_classstringTax class.
manage_stockbooleanStock management at product level. Default is false.
stock_quantityintegerStock quantity. If is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.
in_stockbooleanControls whether or not the product is listed as "in stock" or "out of stock" on the frontend. Default is true.
backordersstringIf managing stock, this controls if backorders are allowed. If enabled, stock quantity can go below 0. Default is no. Options are: no (Do not allow), notify (Allow, but notify customer), and yes (Allow).
backorders_allowedbooleanShows if backorders are allowed. read-only
backorderedbooleanShows if a product is on backorder (if the product have the stock_quantity negative). read-only
sold_individuallybooleanAllow one item to be bought in a single order. Default is false.
weightstringProduct weight in decimal format.
dimensionsobjectProduct dimensions. See Dimensions properties.
shipping_requiredbooleanShows if the product need to be shipped. read-only
shipping_taxablebooleanShows whether or not the product shipping is taxable. read-only
shipping_classstringShipping class slug. Shipping classes are used by certain shipping methods to group similar products.
shipping_class_idintegerShipping class ID. read-only
reviews_allowedbooleanAllow reviews. Default is true.
average_ratingstringReviews average rating. read-only
rating_countintegerAmount of reviews that the product have. read-only
related_idsarrayList of related products IDs (integer). read-only
upsell_idsarrayList of up-sell products IDs (integer). Up-sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.
cross_sell_idsarrayList of cross-sell products IDs. Cross-sells are products which you promote in the cart, based on the current product.
parent_idintegerProduct parent ID (post_parent).
purchase_notestringOptional note to send the customer after purchase.
categoriesarrayList of categories. See Categories properties.
tagsarrayList of tags. See Tags properties.
imagesarrayList of images. See Images properties
attributesarrayList of attributes. See Attributes properties.
default_attributesarrayDefaults variation attributes, used only for variations and pre-selected attributes on the frontend. See Default Attributes properties.
variationsarrayList of variations. See Variations properties
grouped_productsarrayList of grouped products ID, only for group type products. read-only
menu_orderintegerMenu order, used to custom sort products.
+

Download properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID.
namestringFile name.
filestringFile URL. In write-mode you can use this property to send new files.
+

Dimension properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringProduct length in decimal format.
widthstringProduct width in decimal format.
heightstringProduct height in decimal format.
+

Category properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCategory ID.
namestringCategory name. read-only
slugstringCategory slug. read-only
+

Tag properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTag ID.
namestringTag name. read-only
slugstringTag slug. read-only
+

Image properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID (attachment ID). In write-mode used to attach pre-existing images.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
srcstringImage URL. In write-mode used to upload new images.
namestringImage name.
altstringImage alternative text.
positionintegerImage position. 0 means that the image is featured.
+

Attribute properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID (required if is a global attribute).
namestringAttribute name (required if is a non-global attribute).
positionintegerAttribute position.
visiblebooleanDefine if the attribute is visible on the "Additional Information" tab in the product's page. Default is false.
variationbooleanDefine if the attribute can be used as variation. Default is false.
optionsarrayList of available term names of the attribute.
+

Default attribute properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID (required if is a global attribute).
namestringAttribute name (required if is a non-global attribute).
optionstringSelected attribute term name.
+

Variation properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerVariation ID. read-only
date_createddate-timeThe date the variation was created, in the site's timezone. read-only
date_modifieddate-timeThe date the variation was last modified, in the site's timezone. read-only
permalinkstringVariation URL. read-only
skustringUnique identifier.
pricestringCurrent variation price. This is setted from regular_price and sale_price. read-only
regular_pricestringVariation regular price.
sale_pricestringVariation sale price.
date_on_sale_fromstringStart date of sale price. Date in the YYYY-MM-DD format.
date_on_sale_tostringStart date of sale price. Date in the YYYY-MM-DD format.
on_salebooleanShows if the variation is on sale. read-only
purchasablebooleanShows if the variation can be bought. read-only
visiblebooleanIf the variation is visible.
virtualbooleanIf the variation is virtual. Virtual variations are intangible and aren't shipped. Default is false.
downloadablebooleanIf the variation is downloadable. Downloadable variations give access to a file upon purchase. Default is false.
downloadsarrayList of downloadable files. See Downloads properties.
download_limitintegerAmount of times the variation can be downloaded, the -1 values means unlimited re-downloads. Default is -1.
download_expiryintegerNumber of days that the customer has up to be able to download the variation, the -1 means that downloads never expires. Default is -1.
tax_statusstringTax status. Default is taxable. Options: taxable, shipping (Shipping only) and none.
tax_classstringTax class.
manage_stockbooleanStock management at variation level. Default is false.
stock_quantityintegerStock quantity. If is a variable variation this value will be used to control stock for all variations, unless you define stock at variation level.
in_stockbooleanControls whether or not the variation is listed as "in stock" or "out of stock" on the frontend. Default is true.
backordersstringIf managing stock, this controls if backorders are allowed. If enabled, stock quantity can go below 0. Default is no. Options are: no (Do not allow), notify (Allow, but notify customer), and yes (Allow).
backorders_allowedbooleanShows if backorders are allowed." read-only
backorderedbooleanShows if a variation is on backorder (if the variation have the stock_quantity negative). read-only
weightstringVariation weight in decimal format.
dimensionsobjectVariation dimensions. See Dimensions properties.
shipping_classstringShipping class slug. Shipping classes are used by certain shipping methods to group similar products.
shipping_class_idintegerShipping class ID. read-only
imagearrayVariation featured image. Only position 0 will be used. See Images properties.
attributesarrayList of variation attributes. See Variation Attributes properties
+

Variation attribute properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID (required if is a global attribute).
namestringAttribute name (required if is a non-global attribute).
optionstringSelected attribute term name.
+

Create a product

+

This API helps you to create a new product.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products
+
+
+ +
+

Example of how to create a simple product:

+
+
curl -X POST https://example.com/wp-json/wc/v1/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Premium Quality",
+  "type": "simple",
+  "regular_price": "21.99",
+  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  "categories": [
+    {
+      "id": 9
+    },
+    {
+      "id": 14
+    }
+  ],
+  "images": [
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+      "position": 0
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+      "position": 1
+    }
+  ]
+}'
+
const data = {
+  name: "Premium Quality",
+  type: "simple",
+  regular_price: "21.99",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+      position: 1
+    }
+  ]
+};
+
+WooCommerce.post("products", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Premium Quality',
+    'type' => 'simple',
+    'regular_price' => '21.99',
+    'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    'categories' => [
+        [
+            'id' => 9
+        ],
+        [
+            'id' => 14
+        ]
+    ],
+    'images' => [
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg',
+            'position' => 0
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg',
+            'position' => 1
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "name": "Premium Quality",
+    "type": "simple",
+    "regular_price": "21.99",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+        {
+            "id": 9
+        },
+        {
+            "id": 14
+        }
+    ],
+    "images": [
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+            "position": 0
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+            "position": 1
+        }
+    ]
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  name: "Premium Quality",
+  type: "simple",
+  regular_price: "21.99",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+      position: 1
+    }
+  ]
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 162,
+  "name": "Premium Quality",
+  "slug": "premium-quality-3",
+  "permalink": "https://example.com/product/premium-quality-3/",
+  "date_created": "2016-05-31T23:40:07",
+  "date_modified": "2016-05-31T23:40:07",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "21.99",
+  "regular_price": "21.99",
+  "sale_price": "",
+  "date_on_sale_from": "",
+  "date_on_sale_to": "",
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>21,99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "download_type": "standard",
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 163,
+      "date_created": "2016-05-31T23:40:07",
+      "date_modified": "2016-05-31T23:40:07",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_front.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 164,
+      "date_created": "2016-05-31T23:40:10",
+      "date_modified": "2016-05-31T23:40:10",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_back.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products"
+      }
+    ]
+  }
+}
+
+
+

Example of how to create a variable product with global and non-global attributes:

+
+
curl -X POST https://example.com/wp-json/wc/v1/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Ship Your Idea",
+  "type": "variable",
+  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  "categories": [
+    {
+      "id": 9
+    },
+    {
+      "id": 14
+    }
+  ],
+  "images": [
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+      "position": 0
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+      "position": 1
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+      "position": 2
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+      "position": 3
+    }
+  ],
+  "attributes": [
+    {
+      "id": 6,
+      "position": 0,
+      "visible": false,
+      "variation": true,
+      "options": [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      "name": "Size",
+      "position": 0,
+      "visible": true,
+      "variation": true,
+      "options": [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  "default_attributes": [
+    {
+      "id": 6,
+      "option": "Black"
+    },
+    {
+      "name": "Size",
+      "option": "S"
+    }
+  ],
+  "variations": [
+    {
+      "regular_price": "19.99",
+      "image": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+          "position": 0
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "option": "black"
+        },
+        {
+          "name": "Size",
+          "option": "S"
+        }
+      ]
+    },
+    {
+      "regular_price": "19.99",
+      "image": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+          "position": 0
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "option": "green"
+        },
+        {
+          "name": "Size",
+          "option": "M"
+        }
+      ]
+    }
+  ]
+}'
+
const data = {
+  name: "Ship Your Idea",
+  type: "variable",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+      position: 1
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+      position: 2
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+      position: 3
+    }
+  ],
+  attributes: [
+    {
+      id: 6,
+      position: 0,
+      visible: true,
+      variation: true,
+      options: [
+        "Black",
+        "Green"
+      ]
+    }
+    {
+      name: "Size",
+      position: 0,
+      visible: false,
+      variation: true,
+      options: [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  default_attributes: [
+    {
+      id: 6,
+      option: "Black"
+    },
+    {
+      name: "Size",
+      option: "S"
+    }
+  ],
+  variations: [
+    {
+      regular_price: "19.99",
+      image: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+          position: 0
+        }
+      ],
+      attributes: [
+        {
+          id: 6,
+          option: "black"
+        },
+        {
+          name: "Size",
+          option: "S"
+        }
+      ]
+    },
+    {
+      regular_price: "19.99",
+      image: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+          position: 0
+        }
+      ],
+      attributes: [
+        {
+          id: 6,
+          option: "green"
+        },
+        {
+          name: "Size",
+          option: "M"
+        }
+      ]
+    }
+  ]
+};
+
+WooCommerce.post("products", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Ship Your Idea',
+    'type' => 'variable',
+    'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    'categories' => [
+        [
+            'id' => 9
+        ],
+        [
+            'id' => 14
+        ]
+    ],
+    'images' => [
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg',
+            'position' => 0
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg',
+            'position' => 1
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg',
+            'position' => 2
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg',
+            'position' => 3
+        ]
+    ],
+    'attributes' => [
+        [
+            'id' => 6,
+            'position' => 0,
+            'visible' => false,
+            'variation' => true,
+            'options' => [
+                'Black',
+                'Green'
+            ]
+        ],
+        [
+            'name' => 'Size',
+            'position' => 0,
+            'visible' => true,
+            'variation' => true,
+            'options' => [
+                'S',
+                'M'
+            ]
+        ]
+    ],
+    'default_attributes' => [
+        [
+            'id' => 6,
+            'option' => 'Black'
+        ],
+        [
+            'name' => 'Size',
+            'option' => 'S'
+        ]
+    ],
+    'variations' => [
+        [
+            'regular_price' => '19.99',
+            'image' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg',
+                    'position' => 0
+                ]
+            ],
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'black'
+                ],
+                [
+                    'name' => 'Size',
+                    'option' => 'S'
+                ]
+            ]
+        ],
+        [
+            'regular_price' => '19.99',
+            'image' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg',
+                    'position' => 0
+                ]
+            ],
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'green'
+                ],
+                [
+                    'name' => 'Size',
+                    'option' => 'M'
+                ]
+            ]
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "name": "Ship Your Idea",
+    "type": "variable",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+        {
+            "id": 9
+        },
+        {
+            "id": 14
+        }
+    ],
+    "images": [
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+            "position": 0
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+            "position": 1
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+            "position": 2
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+            "position": 3
+        }
+    ],
+    "attributes": [
+        {
+            "id": 6,
+            "position": 0,
+            "visible": False,
+            "variation": True,
+            "options": [
+                "Black",
+                "Green"
+            ]
+        },
+        {
+            "name": "Size",
+            "position": 0,
+            "visible": True,
+            "variation": True,
+            "options": [
+                "S",
+                "M"
+            ]
+        }
+    ],
+    "default_attributes": [
+        {
+            "id": 6,
+            "option": "Black"
+        },
+        {
+            "name": "Size",
+            "option": "S"
+        }
+    ],
+    "variations": [
+        {
+            "regular_price": "19.99",
+            "image": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+                    "position": 0
+                }
+            ],
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "black"
+                },
+                {
+                    "name": "Size",
+                    "option": "S"
+                }
+            ]
+        },
+        {
+            "regular_price": "19.99",
+            "image": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+                    "position": 0
+                }
+            ],
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "green"
+                },
+                {
+                    "name": "Size",
+                    "option": "M"
+                }
+            ]
+        }
+    ]
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  name: "Ship Your Idea",
+  type: "variable",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+      position: 1
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+      position: 2
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+      position: 3
+    }
+  ],
+  attributes: [
+    {
+      id: 6,
+      position: 0,
+      visible: false,
+      variation: true,
+      options: [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      name: "Size",
+      position: 0,
+      visible: true,
+      variation: true,
+      options: [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  default_attributes: [
+    {
+      id: 6,
+      option: "Black"
+    },
+    {
+      name: "Size",
+      option: "S"
+    }
+  ],
+  variations: [
+    {
+      regular_price: "19.99",
+      image: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+          position: 0
+        }
+      ],
+      attributes: [
+        {
+          id: 6,
+          option: "black"
+        },
+        {
+          name: "Size",
+          option: "S"
+        }
+      ]
+    },
+    {
+      regular_price: "19.99",
+      image: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+          position: 0
+        }
+      ],
+      attributes: [
+        {
+          id: 6,
+          option: "green"
+        },
+        {
+          name: "Size",
+          option: "M"
+        }
+      ]
+    }
+  ]
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 165,
+  "name": "Ship Your Idea",
+  "slug": "ship-your-idea-4",
+  "permalink": "https://example.com/product/ship-your-idea-4/",
+  "date_created": "2016-05-31T23:50:56",
+  "date_modified": "2016-06-02T23:11:41",
+  "type": "variable",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "19.99",
+  "regular_price": "",
+  "sale_price": "",
+  "date_on_sale_from": "",
+  "date_on_sale_to": "",
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>19,99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "download_type": "standard",
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    34,
+    37,
+    187,
+    205,
+    31
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 166,
+      "date_created": "2016-05-31T23:50:57",
+      "date_modified": "2016-05-31T23:50:57",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_4_front.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 167,
+      "date_created": "2016-05-31T23:50:57",
+      "date_modified": "2016-05-31T23:50:57",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_4_back.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    },
+    {
+      "id": 168,
+      "date_created": "2016-05-31T23:50:58",
+      "date_modified": "2016-05-31T23:50:58",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_3_front.jpg",
+      "name": "",
+      "alt": "",
+      "position": 2
+    },
+    {
+      "id": 169,
+      "date_created": "2016-05-31T23:50:59",
+      "date_modified": "2016-05-31T23:50:59",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_3_back.jpg",
+      "name": "",
+      "alt": "",
+      "position": 3
+    }
+  ],
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "position": 0,
+      "visible": false,
+      "variation": true,
+      "options": [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      "id": 0,
+      "name": "Size",
+      "position": 1,
+      "visible": true,
+      "variation": true,
+      "options": [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  "default_attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "black"
+    },
+    {
+      "id": 0,
+      "name": "size",
+      "option": "S"
+    }
+  ],
+  "variations": [
+    {
+      "id": 170,
+      "date_created": "2016-05-31T23:50:56",
+      "date_modified": "2016-06-02T23:11:41",
+      "permalink": "https://example.com/product/ship-your-idea-4/?attribute_pa_color=black&attribute_size=S",
+      "sku": "",
+      "price": "19.99",
+      "regular_price": "19.99",
+      "sale_price": "",
+      "date_on_sale_from": "",
+      "date_on_sale_to": "",
+      "on_sale": false,
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": [
+        {
+          "id": 171,
+          "date_created": "2016-05-31T23:51:01",
+          "date_modified": "2016-05-31T23:51:01",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_4_front-1.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "black"
+        },
+        {
+          "id": 0,
+          "name": "size",
+          "option": "S"
+        }
+      ]
+    },
+    {
+      "id": 172,
+      "date_created": "2016-05-31T23:50:56",
+      "date_modified": "2016-06-02T23:11:41",
+      "permalink": "https://example.com/product/ship-your-idea-4/?attribute_pa_color=green&attribute_size=M",
+      "sku": "",
+      "price": "19.99",
+      "regular_price": "19.99",
+      "sale_price": "",
+      "date_on_sale_from": "",
+      "date_on_sale_to": "",
+      "on_sale": false,
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": [
+        {
+          "id": 173,
+          "date_created": "2016-05-31T23:51:03",
+          "date_modified": "2016-05-31T23:51:03",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_3_front-1.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "green"
+        },
+        {
+          "id": 0,
+          "name": "size",
+          "option": "M"
+        }
+      ]
+    }
+  ],
+  "grouped_products": [],
+  "menu_order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/165"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products"
+      }
+    ]
+  }
+}
+

Retrieve a product

+

This API lets you retrieve and view a specific product by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/products/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/162 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/162")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/162')); ?>
+
print(wcapi.get("products/162").json())
+
woocommerce.get("products/162").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 162,
+  "name": "Premium Quality",
+  "slug": "premium-quality-3",
+  "permalink": "https://example.com/product/premium-quality-3/",
+  "date_created": "2016-05-31T23:40:07",
+  "date_modified": "2016-05-31T23:40:07",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "21.99",
+  "regular_price": "21.99",
+  "sale_price": "",
+  "date_on_sale_from": "",
+  "date_on_sale_to": "",
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>21,99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "download_type": "standard",
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 163,
+      "date_created": "2016-05-31T23:40:07",
+      "date_modified": "2016-05-31T23:40:07",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_front.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 164,
+      "date_created": "2016-05-31T23:40:10",
+      "date_modified": "2016-05-31T23:40:10",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_back.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products"
+      }
+    ]
+  }
+}
+

List all products

+

This API helps you to view all the products.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/products
+
+
+
curl https://example.com/wp-json/wc/v1/products \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products')); ?>
+
print(wcapi.get("products").json())
+
woocommerce.get("products").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 165,
+    "name": "Ship Your Idea",
+    "slug": "ship-your-idea-4",
+    "permalink": "https://example.com/product/ship-your-idea-4/",
+    "date_created": "2016-05-31T23:50:56",
+    "date_modified": "2016-06-02T23:11:41",
+    "type": "variable",
+    "status": "publish",
+    "featured": false,
+    "catalog_visibility": "visible",
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "sku": "",
+    "price": "19.99",
+    "regular_price": "",
+    "sale_price": "",
+    "date_on_sale_from": "",
+    "date_on_sale_to": "",
+    "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>19,99</span>",
+    "on_sale": false,
+    "purchasable": true,
+    "total_sales": 0,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "download_type": "standard",
+    "external_url": "",
+    "button_text": "",
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "in_stock": true,
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      34,
+      37,
+      187,
+      205,
+      31
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "purchase_note": "",
+    "categories": [
+      {
+        "id": 9,
+        "name": "Clothing",
+        "slug": "clothing"
+      },
+      {
+        "id": 14,
+        "name": "T-shirts",
+        "slug": "t-shirts"
+      }
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 166,
+        "date_created": "2016-05-31T23:50:57",
+        "date_modified": "2016-05-31T23:50:57",
+        "src": "https://example.com/wp-content/uploads/2016/05/T_4_front.jpg",
+        "name": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 167,
+        "date_created": "2016-05-31T23:50:57",
+        "date_modified": "2016-05-31T23:50:57",
+        "src": "https://example.com/wp-content/uploads/2016/05/T_4_back.jpg",
+        "name": "",
+        "alt": "",
+        "position": 1
+      },
+      {
+        "id": 168,
+        "date_created": "2016-05-31T23:50:58",
+        "date_modified": "2016-05-31T23:50:58",
+        "src": "https://example.com/wp-content/uploads/2016/05/T_3_front.jpg",
+        "name": "",
+        "alt": "",
+        "position": 2
+      },
+      {
+        "id": 169,
+        "date_created": "2016-05-31T23:50:59",
+        "date_modified": "2016-05-31T23:50:59",
+        "src": "https://example.com/wp-content/uploads/2016/05/T_3_back.jpg",
+        "name": "",
+        "alt": "",
+        "position": 3
+      }
+    ],
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "position": 0,
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      },
+      {
+        "id": 0,
+        "name": "Size",
+        "position": 1,
+        "visible": true,
+        "variation": true,
+        "options": [
+          "S",
+          "M"
+        ]
+      }
+    ],
+    "default_attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "black"
+      },
+      {
+        "id": 0,
+        "name": "size",
+        "option": "S"
+      }
+    ],
+    "variations": [
+      {
+        "id": 170,
+        "date_created": "2016-05-31T23:50:56",
+        "date_modified": "2016-06-02T23:11:41",
+        "permalink": "https://example.com/product/ship-your-idea-4/?attribute_pa_color=black&attribute_size=S",
+        "sku": "",
+        "price": "19.99",
+        "regular_price": "19.99",
+        "sale_price": "",
+        "date_on_sale_from": "",
+        "date_on_sale_to": "",
+        "on_sale": false,
+        "purchasable": true,
+        "virtual": false,
+        "downloadable": false,
+        "downloads": [],
+        "download_limit": -1,
+        "download_expiry": -1,
+        "tax_status": "taxable",
+        "tax_class": "",
+        "manage_stock": false,
+        "stock_quantity": null,
+        "in_stock": true,
+        "backorders": "no",
+        "backorders_allowed": false,
+        "backordered": false,
+        "weight": "",
+        "dimensions": {
+          "length": "",
+          "width": "",
+          "height": ""
+        },
+        "shipping_class": "",
+        "shipping_class_id": 0,
+        "image": [
+          {
+            "id": 171,
+            "date_created": "2016-05-31T23:51:01",
+            "date_modified": "2016-05-31T23:51:01",
+            "src": "https://example.com/wp-content/uploads/2016/05/T_4_front-1.jpg",
+            "name": "",
+            "alt": "",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "id": 6,
+            "name": "Color",
+            "option": "black"
+          },
+          {
+            "id": 0,
+            "name": "size",
+            "option": "S"
+          }
+        ]
+      },
+      {
+        "id": 172,
+        "date_created": "2016-05-31T23:50:56",
+        "date_modified": "2016-06-02T23:11:41",
+        "permalink": "https://example.com/product/ship-your-idea-4/?attribute_pa_color=green&attribute_size=M",
+        "sku": "",
+        "price": "19.99",
+        "regular_price": "19.99",
+        "sale_price": "",
+        "date_on_sale_from": "",
+        "date_on_sale_to": "",
+        "on_sale": false,
+        "purchasable": true,
+        "virtual": false,
+        "downloadable": false,
+        "downloads": [],
+        "download_limit": -1,
+        "download_expiry": -1,
+        "tax_status": "taxable",
+        "tax_class": "",
+        "manage_stock": false,
+        "stock_quantity": null,
+        "in_stock": true,
+        "backorders": "no",
+        "backorders_allowed": false,
+        "backordered": false,
+        "weight": "",
+        "dimensions": {
+          "length": "",
+          "width": "",
+          "height": ""
+        },
+        "shipping_class": "",
+        "shipping_class_id": 0,
+        "image": [
+          {
+            "id": 173,
+            "date_created": "2016-05-31T23:51:03",
+            "date_modified": "2016-05-31T23:51:03",
+            "src": "https://example.com/wp-content/uploads/2016/05/T_3_front-1.jpg",
+            "name": "",
+            "alt": "",
+            "position": 0
+          }
+        ],
+        "attributes": [
+          {
+            "id": 6,
+            "name": "Color",
+            "option": "green"
+          },
+          {
+            "id": 0,
+            "name": "size",
+            "option": "M"
+          }
+        ]
+      }
+    ],
+    "grouped_products": [],
+    "menu_order": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/165"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products"
+        }
+      ]
+    }
+  },
+  {
+    "id": 162,
+    "name": "Premium Quality",
+    "slug": "premium-quality-3",
+    "permalink": "https://example.com/product/premium-quality-3/",
+    "date_created": "2016-05-31T23:40:07",
+    "date_modified": "2016-05-31T23:40:07",
+    "type": "simple",
+    "status": "publish",
+    "featured": false,
+    "catalog_visibility": "visible",
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": "",
+    "date_on_sale_from": "",
+    "date_on_sale_to": "",
+    "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>21,99</span>",
+    "on_sale": false,
+    "purchasable": true,
+    "total_sales": 0,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "download_type": "standard",
+    "external_url": "",
+    "button_text": "",
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "in_stock": true,
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "purchase_note": "",
+    "categories": [
+      {
+        "id": 9,
+        "name": "Clothing",
+        "slug": "clothing"
+      },
+      {
+        "id": 14,
+        "name": "T-shirts",
+        "slug": "t-shirts"
+      }
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 163,
+        "date_created": "2016-05-31T23:40:07",
+        "date_modified": "2016-05-31T23:40:07",
+        "src": "https://example.com/wp-content/uploads/2016/05/T_2_front.jpg",
+        "name": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 164,
+        "date_created": "2016-05-31T23:40:10",
+        "date_modified": "2016-05-31T23:40:10",
+        "src": "https://example.com/wp-content/uploads/2016/05/T_2_back.jpg",
+        "name": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "attributes": [],
+    "default_attributes": [],
+    "variations": [],
+    "grouped_products": [],
+    "menu_order": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is date, Options: date, id, include, title and slug.
slugstringLimit result set to products with a specific slug.
statusstringLimit result set to products assigned a specific status. Default is any. Options: any, draft, pending, private and publish.
customerstringLimit result set to orders assigned a specific customer.
categorystringLimit result set to products assigned a specific category, e.g. ?category=9,14.
tagstringLimit result set to products assigned a specific tag, e.g. ?tag=9,14.
shipping_classstringLimit result set to products assigned a specific shipping class, e.g. ?shipping_class=9,14.
attributestringLimit result set to products with a specific attribute, e.g. ?attribute=pa_color.
attribute_termstringLimit result set to products with a specific attribute term (required an assigned attribute), e.g. ?attribute=pa_color&attribute_term=9,14.
skustringLimit result set to products with a specific SKU.
+

Update a product

+

This API lets you make changes to a product.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/products/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/products/162 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "24.54"
+}'
+
const data = {
+  regular_price: "24.54"
+};
+
+WooCommerce.put("products/162", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '24.54'
+];
+
+print_r($woocommerce->put('products/162', $data));
+?>
+
data = {
+    "regular_price": "24.54"
+}
+
+print(wcapi.put("products/162", data).json())
+
data = {
+  regular_price: "24.54"
+}
+
+woocommerce.put("products/162", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 162,
+  "name": "Premium Quality",
+  "slug": "premium-quality-3",
+  "permalink": "https://example.com/product/premium-quality-3/",
+  "date_created": "2016-05-31T23:40:07",
+  "date_modified": "2016-05-31T23:40:07",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "24.54",
+  "regular_price": "24.54",
+  "sale_price": "",
+  "date_on_sale_from": "",
+  "date_on_sale_to": "",
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>24,54</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "download_type": "standard",
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 163,
+      "date_created": "2016-05-31T23:40:07",
+      "date_modified": "2016-05-31T23:40:07",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_front.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 164,
+      "date_created": "2016-05-31T23:40:10",
+      "date_modified": "2016-05-31T23:40:10",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_back.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products"
+      }
+    ]
+  }
+}
+

Delete a product

+

This API helps you delete a product.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/products/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/products/162?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/162", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/162', ['force' => true])); ?>
+
print(wcapi.delete("products/162", params={"force": True}).json())
+
woocommerce.delete("products/162", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 162,
+  "name": "Premium Quality",
+  "slug": "premium-quality-3",
+  "permalink": "https://example.com/product/premium-quality-3/",
+  "date_created": "2016-05-31T23:40:07",
+  "date_modified": "2016-05-31T23:40:07",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "24.54",
+  "regular_price": "24.54",
+  "sale_price": "",
+  "date_on_sale_from": "",
+  "date_on_sale_to": "",
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>24,54</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "download_type": "standard",
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 163,
+      "date_created": "2016-05-31T23:40:07",
+      "date_modified": "2016-05-31T23:40:07",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_front.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 164,
+      "date_created": "2016-05-31T23:40:10",
+      "date_modified": "2016-05-31T23:40:10",
+      "src": "https://example.com/wp-content/uploads/2016/05/T_2_back.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the product, Default is false.
+

Batch update products

+

This API helps you to batch create, update and delete multiple products.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/products/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Woo Single #1",
+      "type": "simple",
+      "regular_price": "21.99",
+      "virtual": true,
+      "downloadable": true,
+      "downloads": [
+        {
+          "name": "Woo Single",
+          "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      "categories": [
+        {
+          "id": 11
+        },
+        {
+          "id": 13
+        }
+      ],
+      "images": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+          "position": 0
+        }
+      ]
+    },
+    {
+      "name": "New Premium Quality",
+      "type": "simple",
+      "regular_price": "21.99",
+      "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      "categories": [
+        {
+          "id": 9
+        },
+        {
+          "id": 14
+        }
+      ],
+      "images": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+          "position": 0
+        },
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+          "position": 1
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 165,
+      "variations": [
+        {
+          "id": 170,
+          "regular_price": "29.99"
+        },
+        {
+          "id": 172,
+          "regular_price": "29.99"
+        }
+      ]
+    }
+  ],
+  "delete": [
+    162
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Woo Single #1",
+      type: "simple",
+      regular_price: "21.99",
+      virtual: true,
+      downloadable: true,
+      downloads: [
+        {
+          name: "Woo Single",
+          file: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      categories: [
+        {
+          id: 11
+        },
+        {
+          id: 13
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+          position: 0
+        }
+      ]
+    },
+    {
+      name: "New Premium Quality",
+      type: "simple",
+      regular_price: "21.99",
+      description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      categories: [
+        {
+          id: 9
+        },
+        {
+          id: 14
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+          position: 0
+        },
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+          position: 1
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 165,
+      variations: [
+        {
+          id: 170,
+          regular_price: "29.99"
+        },
+        {
+          id: 172,
+          regular_price: "29.99"
+        }
+      ]
+    }
+  ],
+  delete: [
+    162
+  ]
+};
+
+WooCommerce.post("products/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Woo Single #1',
+            'type' => 'simple',
+            'regular_price' => '21.99',
+            'virtual' => true,
+            'downloadable' => true,
+            'downloads' => [
+                [
+                    'name' => 'Woo Single',
+                    'file' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg'
+                ]
+            ],
+            'categories' => [
+                [
+                    'id' => 11
+                ],
+                [
+                    'id' => 13
+                ]
+            ],
+            'images' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg',
+                    'position' => 0
+                ]
+            ]
+        ],
+        [
+            'name' => 'New Premium Quality',
+            'type' => 'simple',
+            'regular_price' => '21.99',
+            'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+            'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+            'categories' => [
+                [
+                    'id' => 9
+                ],
+                [
+                    'id' => 14
+                ]
+            ],
+            'images' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg',
+                    'position' => 0
+                ],
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg',
+                    'position' => 1
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 165,
+            'variations' => [
+                [
+                    'id' => 170,
+                    'regular_price' => '29.99'
+                ],
+                [
+                    'id' => 172,
+                    'regular_price' => '29.99'
+                ]
+            ]
+        ]
+    ],
+    'delete' => [
+        162
+    ]
+];
+
+print_r($woocommerce->post('products/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Woo Single #1",
+            "type": "simple",
+            "regular_price": "21.99",
+            "virtual": True,
+            "downloadable": True,
+            "downloads": [
+                {
+                    "name": "Woo Single",
+                    "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+                }
+            ],
+            "categories": [
+                {
+                    "id": 11
+                },
+                {
+                    "id": 13
+                }
+            ],
+            "images": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+                    "position": 0
+                }
+            ]
+        },
+        {
+            "name": "New Premium Quality",
+            "type": "simple",
+            "regular_price": "21.99",
+            "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+            "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+            "categories": [
+                {
+                    "id": 9
+                },
+                {
+                    "id": 14
+                }
+            ],
+            "images": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+                    "position": 0
+                },
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+                    "position": 1
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 165,
+            "variations": [
+                {
+                    "id": 170,
+                    "regular_price": "29.99"
+                },
+                {
+                    "id": 172,
+                    "regular_price": "29.99"
+                }
+            ]
+        }
+    ],
+    "delete": [
+        162
+    ]
+}
+
+print(wcapi.post("products/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Woo Single #1",
+      type: "simple",
+      regular_price: "21.99",
+      virtual: true,
+      downloadable: true,
+      downloads: [
+        {
+          name: "Woo Single",
+          file: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      categories: [
+        {
+          id: 11
+        },
+        {
+          id: 13
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+          position: 0
+        }
+      ]
+    },
+    {
+      name: "New Premium Quality",
+      type: "simple",
+      regular_price: "21.99",
+      description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      categories: [
+        {
+          id: 9
+        },
+        {
+          id: 14
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+          position: 0
+        },
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+          position: 1
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 165,
+      variations: [
+        {
+          id: 170,
+          regular_price: "29.99"
+        },
+        {
+          id: 172,
+          regular_price: "29.99"
+        }
+      ]
+    }
+  ],
+  delete: [
+    162
+  ]
+}
+
+woocommerce.post("products/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 174,
+      "name": "Woo Single #1",
+      "slug": "woo-single-1-2",
+      "permalink": "https://example.com/product/woo-single-1-2/",
+      "date_created": "2016-06-01T00:21:30",
+      "date_modified": "2016-06-01T00:21:30",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "",
+      "short_description": "",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": "",
+      "date_on_sale_from": "",
+      "date_on_sale_to": "",
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>21,99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": true,
+      "downloadable": true,
+      "downloads": [
+        {
+          "id": "7b5a304f737cfa35dc527c9e790399bf",
+          "name": "Woo Single",
+          "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "download_type": "standard",
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": false,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 11,
+          "name": "Music",
+          "slug": "music"
+        },
+        {
+          "id": 13,
+          "name": "Singles",
+          "slug": "singles"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 175,
+          "date_created": "2016-06-01T00:21:31",
+          "date_modified": "2016-06-01T00:21:31",
+          "src": "https://example.com/wp-content/uploads/2016/05/cd_4_angle.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/174"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products"
+          }
+        ]
+      }
+    },
+    {
+      "id": 176,
+      "name": "New Premium Quality",
+      "slug": "new-premium-quality",
+      "permalink": "https://example.com/product/new-premium-quality/",
+      "date_created": "2016-06-01T00:21:33",
+      "date_modified": "2016-06-01T00:21:33",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": "",
+      "date_on_sale_from": "",
+      "date_on_sale_to": "",
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>21,99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "download_type": "standard",
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 177,
+          "date_created": "2016-06-01T00:21:33",
+          "date_modified": "2016-06-01T00:21:33",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_2_front-1.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 178,
+          "date_created": "2016-06-01T00:21:34",
+          "date_modified": "2016-06-01T00:21:34",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_2_back-1.jpg",
+          "name": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/176"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 165,
+      "name": "Ship Your Idea",
+      "slug": "ship-your-idea-4",
+      "permalink": "https://example.com/product/ship-your-idea-4/",
+      "date_created": "2016-05-31T23:50:56",
+      "date_modified": "2016-06-02T23:11:41",
+      "type": "variable",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "29.99",
+      "regular_price": "",
+      "sale_price": "",
+      "date_on_sale_from": "",
+      "date_on_sale_to": "",
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>29,99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "download_type": "standard",
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        34,
+        37,
+        187,
+        205,
+        31
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 166,
+          "date_created": "2016-05-31T23:50:57",
+          "date_modified": "2016-05-31T23:50:57",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_4_front.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 167,
+          "date_created": "2016-05-31T23:50:57",
+          "date_modified": "2016-05-31T23:50:57",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_4_back.jpg",
+          "name": "",
+          "alt": "",
+          "position": 1
+        },
+        {
+          "id": 168,
+          "date_created": "2016-05-31T23:50:58",
+          "date_modified": "2016-05-31T23:50:58",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_3_front.jpg",
+          "name": "",
+          "alt": "",
+          "position": 2
+        },
+        {
+          "id": 169,
+          "date_created": "2016-05-31T23:50:59",
+          "date_modified": "2016-05-31T23:50:59",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_3_back.jpg",
+          "name": "",
+          "alt": "",
+          "position": 3
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "position": 0,
+          "visible": false,
+          "variation": true,
+          "options": [
+            "Black",
+            "Green"
+          ]
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "position": 1,
+          "visible": true,
+          "variation": true,
+          "options": [
+            "S",
+            "M"
+          ]
+        }
+      ],
+      "default_attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "black"
+        },
+        {
+          "id": 0,
+          "name": "size",
+          "option": "S"
+        }
+      ],
+      "variations": [
+        {
+          "id": 170,
+          "date_created": "2016-05-31T23:50:56",
+          "date_modified": "2016-06-02T23:11:41",
+          "permalink": "https://example.com/product/ship-your-idea-4/?attribute_pa_color=black&attribute_size=S",
+          "sku": "",
+          "price": "29.99",
+          "regular_price": "29.99",
+          "sale_price": "",
+          "date_on_sale_from": "",
+          "date_on_sale_to": "",
+          "on_sale": false,
+          "purchasable": true,
+          "virtual": false,
+          "downloadable": false,
+          "downloads": [],
+          "download_limit": -1,
+          "download_expiry": -1,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "manage_stock": false,
+          "stock_quantity": null,
+          "in_stock": true,
+          "backorders": "no",
+          "backorders_allowed": false,
+          "backordered": false,
+          "weight": "",
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": ""
+          },
+          "shipping_class": "",
+          "shipping_class_id": 0,
+          "image": [
+            {
+              "id": 171,
+              "date_created": "2016-05-31T23:51:01",
+              "date_modified": "2016-05-31T23:51:01",
+              "src": "https://example.com/wp-content/uploads/2016/05/T_4_front-1.jpg",
+              "name": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "id": 6,
+              "name": "Color",
+              "option": "black"
+            },
+            {
+              "id": 0,
+              "name": "size",
+              "option": "S"
+            }
+          ]
+        },
+        {
+          "id": 172,
+          "date_created": "2016-05-31T23:50:56",
+          "date_modified": "2016-06-02T23:11:41",
+          "permalink": "https://example.com/product/ship-your-idea-4/?attribute_pa_color=green&attribute_size=M",
+          "sku": "",
+          "price": "29.99",
+          "regular_price": "29.99",
+          "sale_price": "",
+          "date_on_sale_from": "",
+          "date_on_sale_to": "",
+          "on_sale": false,
+          "purchasable": true,
+          "virtual": false,
+          "downloadable": false,
+          "downloads": [],
+          "download_limit": -1,
+          "download_expiry": -1,
+          "tax_status": "taxable",
+          "tax_class": "",
+          "manage_stock": false,
+          "stock_quantity": null,
+          "in_stock": true,
+          "backorders": "no",
+          "backorders_allowed": false,
+          "backordered": false,
+          "weight": "",
+          "dimensions": {
+            "length": "",
+            "width": "",
+            "height": ""
+          },
+          "shipping_class": "",
+          "shipping_class_id": 0,
+          "image": [
+            {
+              "id": 173,
+              "date_created": "2016-05-31T23:51:03",
+              "date_modified": "2016-05-31T23:51:03",
+              "src": "https://example.com/wp-content/uploads/2016/05/T_3_front-1.jpg",
+              "name": "",
+              "alt": "",
+              "position": 0
+            }
+          ],
+          "attributes": [
+            {
+              "id": 6,
+              "name": "Color",
+              "option": "green"
+            },
+            {
+              "id": 0,
+              "name": "size",
+              "option": "M"
+            }
+          ]
+        }
+      ],
+      "grouped_products": [],
+      "menu_order": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/165"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 162,
+      "name": "Premium Quality",
+      "slug": "premium-quality-3",
+      "permalink": "https://example.com/product/premium-quality-3/",
+      "date_created": "2016-05-31T23:40:07",
+      "date_modified": "2016-06-01T00:13:45",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "24.54",
+      "regular_price": "24.54",
+      "sale_price": "",
+      "date_on_sale_from": "",
+      "date_on_sale_to": "",
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#82;&#36;</span>24,54</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "download_type": "standard",
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 163,
+          "date_created": "2016-05-31T23:40:07",
+          "date_modified": "2016-05-31T23:40:07",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_2_front.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 164,
+          "date_created": "2016-05-31T23:40:10",
+          "date_modified": "2016-05-31T23:40:10",
+          "src": "https://example.com/wp-content/uploads/2016/05/T_2_back.jpg",
+          "name": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/162"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve product reviews

+

This API lets you retrieve and view a specific product review by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/products/<product_id>/reviews/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/162/reviews/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/162/reviews/9")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/162')); ?>
+
print(wcapi.get("products/162/reviews/9").json())
+
woocommerce.get("products/162/reviews/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "date_created": "2015-05-07T13:01:25",
+  "review": "This will go great with my Hoodie that I ordered a few weeks ago.",
+  "rating": 5,
+  "name": "Stuart",
+  "email": "stuart@example.com",
+  "verified": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162/reviews/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162/reviews"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/162"
+      }
+    ]
+  }
+}
+

Product review properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createdstringThe date the review was created, in the site's timezone. read-only
ratingintegerReview rating (0 to 5). read-only
namestringReviewer name. read-only
emailstringReviewer email. read-only
verifiedbooleanShows if the reviewer bought the product or not. read-only
+

List all product reviews

+

This API lets you retrieve all reviews of a product.

+ +
+
+ GET +
/wp-json/wc/v1/products/<product_id>/reviews
+
+
+
curl https://example.com/wp-json/wc/v1/products/162/reviews \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/162/reviews")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/162/reviews')); ?>
+
print(wcapi.get("products/162/reviews").json())
+
woocommerce.get("products/162/reviews").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 9,
+    "date_created": "2015-05-07T13:01:25",
+    "review": "This will go great with my Hoodie that I ordered a few weeks ago.",
+    "rating": 5,
+    "name": "Stuart",
+    "email": "stuart@example.com",
+    "verified": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162/reviews/9"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162/reviews"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162"
+        }
+      ]
+    }
+  },
+  {
+    "id": 10,
+    "date_created": "2015-05-07T15:49:53",
+    "review": "Love this shirt! The ninja near and dear to my heart. &lt;3",
+    "rating": 5,
+    "name": "Maria",
+    "email": "maria@example.com",
+    "verified": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162/reviews/10"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162/reviews"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/162"
+        }
+      ]
+    }
+  }
+]
+

Product attributes

+

The product attributes API allows you to create, view, update, and delete individual, or a batch, of product attributes.

+

Product attribute properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringAttribute name. required
slugstringAn alphanumeric identifier for the resource unique to its type.
typestringType of attribute. Default is select. Options: select and text (some plugins can include new types)
order_bystringDefault sort order. Default is menu_order. Options: menu_order, name, name_num and id.
has_archivesbooleanEnable/Disable attribute archives. Default is false.
+

Create a product attribute

+

This API helps you to create a new product attribute.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/attributes
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/products/attributes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true
+}'
+
const data = {
+  name: "Color",
+  slug: "pa_color",
+  type: "select",
+  order_by: "menu_order",
+  has_archives: true
+};
+
+WooCommerce.post("products/attributes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Color',
+    'slug' => 'pa_color',
+    'type' => 'select',
+    'order_by' => 'menu_order',
+    'has_archives' => true
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+
data = {
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": True
+}
+
+print(wcapi.post("products/attributes", data).json())
+
data = {
+  name: "Color",
+  slug: "pa_color",
+  type: "select",
+  order_by: "menu_order",
+  has_archives: true
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes"
+      }
+    ]
+  }
+}
+

Retrieve a product attribute

+

This API lets you retrieve and view a specific product attribute by ID.

+ +
+
+ GET +
/wp-json/wc/v1/products/attributes/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/attributes/1 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/1")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/1')); ?>
+
print(wcapi.get("products/attributes/1").json())
+
woocommerce.get("products/attributes/1").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes"
+      }
+    ]
+  }
+}
+

List all product attributes

+

This API helps you to view all the product attributes.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/products/attributes
+
+
+
curl https://example.com/wp-json/wc/v1/products/attributes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes')); ?>
+
print(wcapi.get("products/attributes").json())
+
woocommerce.get("products/attributes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 1,
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": true,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/6"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 2,
+    "name": "Size",
+    "slug": "pa_size",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes"
+        }
+      ]
+    }
+  }
+]
+

Update a product attribute

+

This API lets you make changes to a product attribute.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/products/attributes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/products/attributes/1 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_by": "name"
+}'
+
const data = {
+  order_by: "name"
+};
+
+WooCommerce.put("products/attributes/1", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'order_by' => 'name'
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+
data = {
+    "order_by": "name"
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+
data = {
+  order_by: "name"
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "name",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes"
+      }
+    ]
+  }
+}
+

Delete a product attribute

+

This API helps you delete a product attribute.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/products/attributes/<id>
+
+
+ + +
curl -X DELETE https://example.com/wp-json/wc/v1/products/attributes/1?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/attributes/1", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/attributes/1', ['force' => true])); ?>
+
print(wcapi.delete("products/attributes/1", params={"force": True}).json())
+
woocommerce.delete("products/attributes/1", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product attributes

+

This API helps you to batch create, update and delete multiple product attributes.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/attributes/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/products/attributes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Brand"
+    },
+    {
+      "name": "Publisher"
+    }
+  ],
+  "update": [
+    {
+      "id": 2,
+      "order_by": "name"
+    }
+  ],
+  "delete": [
+    1
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Brand"
+    },
+    {
+      name: "Publisher"
+    }
+  ],
+  update: [
+    {
+      id: 2,
+      order_by: "name"
+    }
+  ],
+  delete: [
+    1
+  ]
+};
+
+WooCommerce.post("products/attributes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Brand'
+        ],
+        [
+            'name' => 'Publisher'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 2,
+            'order_by' => 'name'
+        ]
+    ],
+    'delete' => [
+        1
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Brand"
+        },
+        {
+            "name": "Publisher"
+        }
+    ],
+    "update": [
+        {
+            "id": 2,
+            "order_by": "name"
+        }
+    ],
+    "delete": [
+        1
+    ]
+}
+
+print(wcapi.post("products/attributes/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 2,
+      order_by: "name"
+    }
+  ],
+  delete: [
+    1
+  ]
+}
+
+woocommerce.post("products/attributes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 7,
+      "name": "Brand",
+      "slug": "pa_brand",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/7"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 8,
+      "name": "Publisher",
+      "slug": "pa_publisher",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/8"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 2,
+      "name": "Size",
+      "slug": "pa_size",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 1,
+      "name": "Color",
+      "slug": "pa_color",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": true,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/6"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product attribute terms

+

The product attribute terms API allows you to create, view, update, and delete individual, or a batch, of attribute terms.

+

Attribute term properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringTerm name. required
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
menu_orderintegerMenu order, used to custom sort the resource.
countintegerNumber of published products for the resource. read-only
+

Create an attribute term

+

This API helps you to create a new product attribute term.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/attributes/<attribute_id>/terms
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/products/attributes/2/terms \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "XXS"
+}'
+
const data = {
+  name: "XXS"
+};
+
+WooCommerce.post("products/attributes/2/terms", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'XXS'
+];
+
+print_r($woocommerce->post('products/attributes/2/terms', $data));
+?>
+
data = {
+    "name": "XXS"
+}
+
+print(wcapi.post("products/attributes/2/terms", data).json())
+
data = {
+  name: "XXS"
+}
+
+woocommerce.post("products/attributes/2/terms", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Retrieve an attribute term

+

This API lets you retrieve a product attribute term by ID.

+ +
+
+ GET +
/wp-json/wc/v1/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/attributes/2/terms/23 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/2/terms/23")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/2/terms/23')); ?>
+
print(wcapi.get("products/attributes/2/terms/23").json())
+
woocommerce.get("products/attributes/2/terms/23").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

List all attribute terms

+

This API lets you retrieve all terms from a product attribute.

+ +
+
+ GET +
/wp-json/wc/v1/products/attributes/<attribute_id>/terms
+
+
+
curl https://example.com/wp-json/wc/v1/products/attributes/2/terms \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/2/terms")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/2/terms')); ?>
+
print(wcapi.get("products/attributes/2/terms").json())
+
woocommerce.get("products/attributes/2/terms").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 23,
+    "name": "XXS",
+    "slug": "xxs",
+    "description": "",
+    "menu_order": 1,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/23"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 22,
+    "name": "XS",
+    "slug": "xs",
+    "description": "",
+    "menu_order": 2,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/22"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 17,
+    "name": "S",
+    "slug": "s",
+    "description": "",
+    "menu_order": 3,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/17"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 18,
+    "name": "M",
+    "slug": "m",
+    "description": "",
+    "menu_order": 4,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/18"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 19,
+    "name": "L",
+    "slug": "l",
+    "description": "",
+    "menu_order": 5,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/19"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 20,
+    "name": "XL",
+    "slug": "xl",
+    "description": "",
+    "menu_order": 6,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/20"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 21,
+    "name": "XXL",
+    "slug": "xxl",
+    "description": "",
+    "menu_order": 7,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/21"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name, slug, term_group, description and count.
hide_emptyboolWhether to hide resources not assigned to any products. Default is false.
parentintegerLimit result set to resources assigned to a specific parent.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update an attribute term

+

This API lets you make changes to a product attribute term.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/products/attributes/2/terms/23 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "XXS"
+}'
+
const data = {
+  name: "XXS"
+};
+
+WooCommerce.put("products/attributes/2/terms/23", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'XXS'
+];
+
+print_r($woocommerce->put('products/attributes/2/terms/23', $data));
+?>
+
data = {
+    "name": "XXS"
+}
+
+print(wcapi.put("products/attributes/2/terms/23", data).json())
+
data = {
+  name: "XXS"
+}
+
+woocommerce.put("products/attributes/2/terms/23", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Delete an attribute term

+

This API helps you delete a product attribute term.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/products/attributes/2/terms/23?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/attributes/2/terms/23", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/attributes/2/terms/23', ['force' => true])); ?>
+
print(wcapi.delete("products/attributes/2/terms/23", params={"force": True}).json())
+
woocommerce.delete("products/attributes/2/terms/23", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update attribute terms

+

This API helps you to batch create, update and delete multiple product attribute terms.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/attributes/<attribute_id>/terms/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/products/attributes/&lt;attribute_id&gt;/terms/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "XXS"
+    },
+    {
+      "name": "S"
+    }
+  ],
+  "update": [
+    {
+      "id": 19,
+      "menu_order": 6
+    }
+  ],
+  "delete": [
+    21,
+    20
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "XXS"
+    },
+    {
+      name: "S"
+    }
+  ],
+  update: [
+    {
+      id: 19,
+      menu_order: 6
+    }
+  ],
+  delete: [
+    21,
+    20
+  ]
+};
+
+WooCommerce.post("products/attributes/2/terms/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'XXS'
+        ],
+        [
+            'name' => 'S'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 19,
+            'menu_order' => 6
+        ]
+    ],
+    'delete' => [
+        21,
+        20
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/2/terms/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "XXS"
+        },
+        {
+            "name": "S"
+        }
+    ],
+    "update": [
+        {
+            "id": 19,
+            "menu_order": 6
+        }
+    ],
+    "delete": [
+        21,
+        20
+    ]
+}
+
+print(wcapi.post("products/attributes/2/terms/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "XXS"
+    },
+    {
+      name: "S"
+    }
+  ],
+  update: [
+    {
+      id: 19,
+      menu_order: 6
+    }
+  ],
+  delete: [
+    21,
+    20
+  ]
+}
+
+woocommerce.post("products/attributes/2/terms/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 23,
+      "name": "XXS",
+      "slug": "xxs",
+      "description": "",
+      "menu_order": 1,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/23"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+          }
+        ]
+      }
+    },
+    {
+      "id": 17,
+      "name": "S",
+      "slug": "s",
+      "description": "",
+      "menu_order": 3,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/17"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 19,
+      "name": "L",
+      "slug": "l",
+      "description": "",
+      "menu_order": 5,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/19"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 21,
+      "name": "XXL",
+      "slug": "xxl",
+      "description": "",
+      "menu_order": 7,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/21"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+          }
+        ]
+      }
+    },
+    {
+      "id": 20,
+      "name": "XL",
+      "slug": "xl",
+      "description": "",
+      "menu_order": 6,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms/20"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product categories

+

The product categories API allows you to create, view, update, and delete individual, or a batch, of categories.

+

Product category properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringCategory name. required
slugstringAn alphanumeric identifier for the resource unique to its type.
parentintegerThe id for the parent of the resource.
descriptionstringHTML description of the resource.
displaystringCategory archive display type. Default is default. Options: default, products, subcategories and both
imagearrayImage data. See Category Image properties
menu_orderintegerMenu order, used to custom sort the resource.
countintegerNumber of published products for the resource. read-only
+

Category Image properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID (attachment ID). In write-mode used to attach pre-existing images.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
srcstringImage URL. In write-mode used to upload new images.
titlestringImage name.
altstringImage alternative text.
+

Create a product category

+

This API helps you to create a new product category.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/categories
+
+
+ +
+

Example of how to create a product category:

+
+
curl -X POST https://example.com/wp-json/wc/v1/products/categories \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Clothing",
+  "image": {
+    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+}'
+
const data = {
+  name: "Clothing",
+  image: {
+    src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+};
+
+WooCommerce.post("products/categories", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Clothing',
+    'image' => [
+        'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
+    ]
+];
+
+print_r($woocommerce->post('products/categories', $data));
+?>
+
data = {
+    "name": "Clothing",
+    "image": {
+        "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+    }
+}
+
+print(wcapi.post("products/categories", data).json())
+
data = {
+  name: "Clothing",
+  image: {
+    src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+}
+
+woocommerce.post("products/categories", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "",
+  "display": "default",
+  "image": {
+    "id": 173,
+    "date_created": "2016-05-31T23:51:03",
+    "date_modified": "2016-05-31T23:51:03",
+    "src": "https://example/wp-content/uploads/2016/05/T_3_front-1.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 18,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories"
+      }
+    ]
+  }
+}
+

Retrieve a product category

+

This API lets you retrieve a product category by ID.

+ +
+
+ GET +
/wp-json/wc/v1/products/categories/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/categories/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/categories/9")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/categories/9')); ?>
+
print(wcapi.get("products/categories/9").json())
+
woocommerce.get("products/categories/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "",
+  "display": "default",
+  "image": {
+    "id": 173,
+    "date_created": "2016-05-31T23:51:03",
+    "date_modified": "2016-05-31T23:51:03",
+    "src": "https://example/wp-content/uploads/2016/05/T_3_front-1.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 18,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories"
+      }
+    ]
+  }
+}
+

List all product categories

+

This API lets you retrieve all product categories.

+ +
+
+ GET +
/wp-json/wc/v1/products/categories
+
+
+
curl https://example.com/wp-json/wc/v1/products/categories \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/categories")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/categories')); ?>
+
print(wcapi.get("products/categories").json())
+
woocommerce.get("products/categories").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 15,
+    "name": "Albums",
+    "slug": "albums",
+    "parent": 11,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 4,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/15"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/11"
+        }
+      ]
+    }
+  },
+  {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": {
+      "id": 173,
+      "date_created": "2016-05-31T23:51:03",
+      "date_modified": "2016-05-31T23:51:03",
+      "src": "https://example/wp-content/uploads/2016/05/T_3_front-1.jpg",
+      "title": "",
+      "alt": ""
+    },
+    "menu_order": 0,
+    "count": 18,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example/wp-json/wc/v1/products/categories/9"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example/wp-json/wc/v1/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 10,
+    "name": "Hoodies",
+    "slug": "hoodies",
+    "parent": 9,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 6,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/10"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/9"
+        }
+      ]
+    }
+  },
+  {
+    "id": 11,
+    "name": "Music",
+    "slug": "music",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 7,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/11"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 12,
+    "name": "Posters",
+    "slug": "posters",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 5,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/12"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 13,
+    "name": "Singles",
+    "slug": "singles",
+    "parent": 11,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 3,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/13"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/11"
+        }
+      ]
+    }
+  },
+  {
+    "id": 14,
+    "name": "T-shirts",
+    "slug": "t-shirts",
+    "parent": 9,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 6,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/14"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/categories/9"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name, slug, term_group, description and count.
hide_emptyboolWhether to hide resources not assigned to any products. Default is false.
parentintegerLimit result set to resources assigned to a specific parent.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a product category

+

This API lets you make changes to a product category.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/products/categories/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/products/categories/9 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "All kinds of clothes."
+}'
+
const data = {
+  description: "All kinds of clothes."
+};
+
+WooCommerce.put("products/categories/9", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description' => 'All kinds of clothes.'
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+
data = {
+    "description": "All kinds of clothes."
+}
+
+print(wcapi.put("products/categories/9", data).json())
+
data = {
+  description: "All kinds of clothes."
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "All kinds of clothes.",
+  "display": "default",
+  "image": {
+    "id": 173,
+    "date_created": "2016-05-31T23:51:03",
+    "date_modified": "2016-05-31T23:51:03",
+    "src": "https://example/wp-content/uploads/2016/05/T_3_front-1.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 18,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories"
+      }
+    ]
+  }
+}
+

Delete a product category

+

This API helps you delete a product category.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/products/categories/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/products/categories/9?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/categories/9", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/categories/9', ['force' => true])); ?>
+
print(wcapi.delete("products/categories/9", params={"force": True}).json())
+
woocommerce.delete("products/categories/9", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "All kinds of clothes.",
+  "display": "default",
+  "image": {
+    "id": 173,
+    "date_created": "2016-05-31T23:51:03",
+    "date_modified": "2016-05-31T23:51:03",
+    "src": "https://example/wp-content/uploads/2016/05/T_3_front-1.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 18,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example/wp-json/wc/v1/products/categories"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product categories

+

This API helps you to batch create, update and delete multiple product categories.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/categories/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/products/categories/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Albums"
+    },
+    {
+      "name": "Clothing"
+    }
+  ],
+  "update": [
+    {
+      "id": 10,
+      "description": "Nice hoodies"
+    }
+  ],
+  "delete": [
+    11,
+    12
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Albums"
+    },
+    {
+      name: "Clothing"
+    }
+  ],
+  update: [
+    {
+      id: 10,
+      description: "Nice hoodies"
+    }
+  ],
+  delete: [
+    11,
+    12
+  ]
+};
+
+WooCommerce.post("products/categories/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Albums'
+        ],
+        [
+            'name' => 'Clothing'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 10,
+            'description' => 'Nice hoodies'
+        ]
+    ],
+    'delete' => [
+        11,
+        12
+    ]
+];
+
+print_r($woocommerce->post('products/categories/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Albums"
+        },
+        {
+            "name": "Clothing"
+        }
+    ],
+    "update": [
+        {
+            "id": 10,
+            "description": "Nice hoodies"
+        }
+    ],
+    "delete": [
+        11,
+        12
+    ]
+}
+
+print(wcapi.post("products/categories/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Albums"
+    },
+    {
+      name: "Clothing"
+    }
+  ],
+  update: [
+    {
+      id: 10,
+      description: "Nice hoodies"
+    }
+  ],
+  delete: [
+    11,
+    12
+  ]
+}
+
+woocommerce.post("products/categories/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 15,
+      "name": "Albums",
+      "slug": "albums",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/15"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/11"
+          }
+        ]
+      }
+    },
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/9"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 10,
+      "name": "Hoodies",
+      "slug": "hoodies",
+      "parent": 9,
+      "description": "Nice hoodies",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 6,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/10"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/9"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 11,
+      "name": "Music",
+      "slug": "music",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 7,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/11"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories"
+          }
+        ]
+      }
+    },
+    {
+      "id": 12,
+      "name": "Posters",
+      "slug": "posters",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 5,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories/12"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/categories"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product shipping classes

+

The product shipping class API allows you to create, view, update, and delete individual, or a batch, of shipping classes.

+

Shipping class properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringShipping class name. required
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
countintegerNumber of published products for the resource. read-only
+

Create a shipping class

+

This API helps you to create a new product shipping class.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/shipping_classes
+
+
+ +
+

Example of how to create a product shipping class:

+
+
curl -X POST https://example.com/wp-json/wc/v1/products/shipping_classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Priority"
+}'
+
const data = {
+  name: "Priority"
+};
+
+WooCommerce.post("products/shipping_classes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Priority'
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+
data = {
+    "name": "Priority"
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+
data = {
+  name: "Priority"
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Retrieve a shipping class

+

This API lets you retrieve a product shipping class by ID.

+ +
+
+ GET +
/wp-json/wc/v1/products/shipping_classes/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/shipping_classes/32 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/shipping_classes/32")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/shipping_classes/32')); ?>
+
print(wcapi.get("products/shipping_classes/32").json())
+
woocommerce.get("products/shipping_classes/32").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+      }
+    ]
+  }
+}
+

List all shipping classes

+

This API lets you retrieve all product shipping classes.

+ +
+
+ GET +
/wp-json/wc/v1/products/shipping_classes
+
+
+
curl https://example.com/wp-json/wc/v1/products/shipping_classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/shipping_classes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+
print(wcapi.get("products/shipping_classes").json())
+
woocommerce.get("products/shipping_classes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 33,
+    "name": "Express",
+    "slug": "express",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/33"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 32,
+    "name": "Priority",
+    "slug": "priority",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/32"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name, slug, term_group, description and count.
hide_emptyboolWhether to hide resources not assigned to any products. Default is false.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a shipping class

+

This API lets you make changes to a product shipping class.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/products/shipping_classes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/products/shipping_classes/32 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "Priority mail."
+}'
+
const data = {
+  description: "Priority mail."
+};
+
+WooCommerce.put("products/shipping_classes/32", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description' => 'Priority mail.'
+];
+
+print_r($woocommerce->put('products/shipping_classes/32', $data));
+?>
+
data = {
+    "description": "Priority mail."
+}
+
+print(wcapi.put("products/shipping_classes/32", data).json())
+
data = {
+  description: "Priority mail."
+}
+
+woocommerce.put("products/shipping_classes/32", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "Priority mail.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Delete a shipping class

+

This API helps you delete a product shipping class.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/products/shipping_classes/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/products/shipping_classes/32?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/shipping_classes/32", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/shipping_classes/32', ['force' => true])); ?>
+
print(wcapi.delete("products/shipping_classes/32", params={"force": True}).json())
+
woocommerce.delete("products/shipping_classes/32", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "Priority mail.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update shipping classes

+

This API helps you to batch create, update and delete multiple product shipping classes.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/shipping_classes/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/products/shipping_classes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Small items"
+    },
+    {
+      "name": "Large items"
+    }
+  ],
+  "update": [
+    {
+      "id": 33,
+      "description": "Express shipping"
+    }
+  ],
+  "delete": [
+    32
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Small items"
+    },
+    {
+      name: "Large items"
+    }
+  ],
+  update: [
+    {
+      id: 33,
+      description: "Express shipping"
+    }
+  ],
+  delete: [
+    32
+  ]
+};
+
+WooCommerce.post("products/shipping_classes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Small items'
+        ],
+        [
+            'name' => 'Large items'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 33,
+            'description' => 'Express shipping'
+        ]
+    ],
+    'delete' => [
+        32
+    ]
+];
+
+print_r($woocommerce->post('products/shipping_classes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Small items"
+        },
+        {
+            "name": "Large items"
+        }
+    ],
+    "update": [
+        {
+            "id": 33,
+            "description": "Express shipping"
+        }
+    ],
+    "delete": [
+        32
+    ]
+}
+
+print(wcapi.post("products/shipping_classes/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Small items"
+    },
+    {
+      name: "Large items"
+    }
+  ],
+  update: [
+    {
+      id: 33,
+      description: "Express shipping"
+    }
+  ],
+  delete: [
+    32
+  ]
+}
+
+woocommerce.post("products/shipping_classes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 34,
+      "name": "Small items",
+      "slug": "small-items",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/34"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 35,
+      "name": "Large items",
+      "slug": "large-items",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/35"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 33,
+      "name": "Express",
+      "slug": "express",
+      "description": "Express shipping",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/33"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 32,
+      "name": "Priority",
+      "slug": "priority",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes/32"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product tags

+

The product tags API allows you to create, view, update, and delete individual, or a batch, of product tags.

+

Product tag properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringTag name. required
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
countintegerNumber of published products for the resource. read-only
+

Create a product tag

+

This API helps you to create a new product tag.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/tags
+
+
+ +
+

Example of how to create a product tag:

+
+
curl -X POST https://example.com/wp-json/wc/v1/products/tags \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Leather Shoes"
+}'
+
const data = {
+  name: "Leather Shoes"
+};
+
+WooCommerce.post("products/tags", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Leather Shoes'
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+
data = {
+    "name": "Leather Shoes"
+}
+
+print(wcapi.post("products/tags", data).json())
+
data = {
+  name: "Leather Shoes"
+}
+
+woocommerce.post("products/tags", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags"
+      }
+    ]
+  }
+}
+

Retrieve a product tag

+

This API lets you retrieve a product tag by ID.

+ +
+
+ GET +
/wp-json/wc/v1/products/tags/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/products/tags/34 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags/34")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags/34')); ?>
+
print(wcapi.get("products/tags/34").json())
+
woocommerce.get("products/tags/34").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags"
+      }
+    ]
+  }
+}
+

List all product tags

+

This API lets you retrieve all product tag.

+ +
+
+ GET +
/wp-json/wc/v1/products/tags
+
+
+
curl https://example.com/wp-json/wc/v1/products/tags \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags')); ?>
+
print(wcapi.get("products/tags").json())
+
woocommerce.get("products/tags").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 34,
+    "name": "Leather Shoes",
+    "slug": "leather-shoes",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/tags/34"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/tags"
+        }
+      ]
+    }
+  },
+  {
+    "id": 35,
+    "name": "Oxford Shoes",
+    "slug": "oxford-shoes",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/tags/35"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/tags"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name, slug, term_group, description and count.
hide_emptyboolWhether to hide resources not assigned to any products. Default is false.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a product tag

+

This API lets you make changes to a product tag.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/products/tags/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/products/tags/34 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "Genuine leather."
+}'
+
const data = {
+  description: "Genuine leather."
+};
+
+WooCommerce.put("products/tags/34", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description': 'Genuine leather.'
+];
+
+print_r($woocommerce->put('products/tags/34', $data));
+?>
+
data = {
+    "description": "Genuine leather."
+}
+
+print(wcapi.put("products/tags/34", data).json())
+
data = {
+  description: "Genuine leather."
+}
+
+woocommerce.put("products/tags/34", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "Genuine leather.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags"
+      }
+    ]
+  }
+}
+

Delete a product tag

+

This API helps you delete a product tag.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/products/tags/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/products/tags/34?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/tags/34", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/tags/34', ['force' => true])); ?>
+
print(wcapi.delete("products/tags/34", params={"force": True}).json())
+
woocommerce.delete("products/tags/34", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "Genuine leather.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/products/tags"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product tags

+

This API helps you to batch create, update and delete multiple product tags.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/products/tags/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/products/tags/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Round toe"
+    },
+    {
+      "name": "Flat"
+    }
+  ],
+  "update": [
+    {
+      "id": 34,
+      "description": "Genuine leather."
+    }
+  ],
+  "delete": [
+    35
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 34,
+      description: "Genuine leather."
+    }
+  ],
+  delete: [
+    35
+  ]
+};
+
+WooCommerce.post("products/tags/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Round toe'
+        ],
+        [
+            'name' => 'Flat'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 34,
+            'description' => 'Genuine leather.'
+        ]
+    ],
+    'delete' => [
+        35
+    ]
+];
+
+print_r($woocommerce->post('products/tags/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Round toe"
+        },
+        {
+            "name": "Flat"
+        }
+    ],
+    "update": [
+        {
+            "id": 34,
+            "description": "Genuine leather."
+        }
+    ],
+    "delete": [
+        35
+    ]
+}
+
+print(wcapi.post("products/tags/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 34,
+      description: "Genuine leather."
+    }
+  ],
+  delete: [
+    35
+  ]
+}
+
+woocommerce.post("products/tags/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 36,
+      "name": "Round toe",
+      "slug": "round-toe",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags/36"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags"
+          }
+        ]
+      }
+    },
+    {
+      "id": 37,
+      "name": "Flat",
+      "slug": "flat",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags/37"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 34,
+      "name": "Leather Shoes",
+      "slug": "leather-shoes",
+      "description": "Genuine leather.",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags/34"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 35,
+      "name": "Oxford Shoes",
+      "slug": "oxford-shoes",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags/35"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/products/tags"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Reports

+

The reports API allows you to view all types of reports available.

+

List all reports

+

This API lets you retrieve and view a simple list of available reports.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/reports
+
+
+
curl https://example.com/wp-json/wc/v1/reports \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('reports')); ?>
+
print(wcapi.get("reports").json())
+
woocommerce.get("reports").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "slug": "sales",
+    "description": "List of sales reports.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports/sales"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "top_sellers",
+    "description": "List of top sellers products.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports/top_sellers"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports"
+        }
+      ]
+    }
+  }
+]
+

Retrieve sales report

+

This API lets you retrieve and view a sales report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/reports/sales
+
+
+
curl https://example.com/wp-json/wc/v1/reports/sales?date_min=2016-05-03&date_max=2016-05-04 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/sales", {
+  date_min: "2016-05-03",
+  date_max: "2016-05-04"
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$query = [
+    'date_min' => '2016-05-03', 
+    'date_max' => '2016-05-04'
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+
print(wcapi.get("reports/sales?date_min=2016-05-03&date_max=2016-05-04").json())
+
query = {
+  date_min: "2016-05-03",
+  date_max: "2016-05-04"
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "total_sales": "14.00",
+    "net_sales": "4.00",
+    "average_sales": "2.00",
+    "total_orders": 3,
+    "total_items": 6,
+    "total_tax": "0.00",
+    "total_shipping": "10.00",
+    "total_refunds": 0,
+    "total_discount": "0.00",
+    "totals_grouped_by": "day",
+    "totals": {
+      "2016-05-03": {
+        "sales": "14.00",
+        "orders": 3,
+        "items": 6,
+        "tax": "0.00",
+        "shipping": "10.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2016-05-04": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      }
+    },
+    "total_customers": 0,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports"
+        }
+      ]
+    }
+  }
+]
+

Sales report properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
total_salesstringGross sales in the period. read-only
net_salesstringNet sales in the period. read-only
average_salesstringAverage net daily sales. read-only
total_ordersintegerTotal of orders placed. read-only
total_itemsintegerTotal of items purchased. read-only
total_taxstringTotal charged for taxes. read-only
total_shippingstringTotal charged for shipping. read-only
total_refundsnumberTotal of refunded orders. read-only
total_discountintegerTotal of coupons used. read-only
totals_grouped_bystringGroup type. read-only
totalsarrayTotals. read-only
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is today's date. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.
+

Retrieve top sellers report

+

This API lets you retrieve and view a list of top sellers report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/reports/top_sellers
+
+
+
curl https://example.com/wp-json/wc/v1/reports/top_sellers?period=last_month \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/top_sellers", {
+  period: "last_month",
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$query = [
+    'period' => 'last_month'
+];
+
+print_r($woocommerce->get('reports/top_sellers', $query));
+?>
+
print(wcapi.get("reports/top_sellers?period=last_month").json())
+
query = {
+  period: "last_month"
+}
+
+woocommerce.get("reports/top_sellers", query).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "title": "Happy Ninja",
+    "product_id": 37,
+    "quantity": 1,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/37"
+        }
+      ]
+    }
+  },
+  {
+    "title": "Woo Album #4",
+    "product_id": 96,
+    "quantity": 1,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/reports"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/products/96"
+        }
+      ]
+    }
+  }
+]
+

Top sellers report properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
titlestringProduct title. read-only
product_idintegerProduct ID. read-only
quantityintegerTotal number of purchases. read-only
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is week. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.
+

Tax rates

+

The taxes API allows you to create, view, update, and delete individual tax rates, or a batch of tax rates.

+

Tax rate properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
countrystringCountry ISO 3166 code. See ISO 3166 Codes (Countries) for more details
statestringState code.
postcodestringPostcode/ZIP.
citystringCity name.
ratestringTax rate.
namestringTax rate name.
priorityintegerTax priority. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate. Default is 1.
compoundbooleanWhether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is false.
shippingbooleanWhether or not this tax rate also gets applied to shipping. Default is true.
orderintegerIndicates the order that will appear in queries.
classstringTax class. Default is standard.
+

Create a tax rate

+

This API helps you to create a new tax rate.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/taxes
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/taxes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "country": "US",
+  "state": "AL",
+  "rate": "4",
+  "name": "State Tax",
+  "shipping": false
+}'
+
const data = {
+  country: "US",
+  state: "AL",
+  rate: "4",
+  name: "State Tax",
+  shipping: false
+};
+
+WooCommerce.post("taxes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'country' => 'US',
+    'state' => 'AL',
+    'rate' => '4',
+    'name' => 'State Tax',
+    'shipping' => false
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+
data = {
+    "country": "US",
+    "state": "AL",
+    "rate": "4",
+    "name": "State Tax",
+    "shipping": False
+}
+
+print(wcapi.post("taxes", data).json())
+
data = {
+  country: "US",
+  state: "AL",
+  rate: "4",
+  name: "State Tax",
+  shipping: false
+}
+
+woocommerce.post("taxes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "State Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes"
+      }
+    ]
+  }
+}
+

Retrieve a tax rate

+

This API lets you retrieve and view a specific tax rate by ID.

+ +
+
+ GET +
/wp-json/wc/v1/taxes/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/taxes/72 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes/72")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes/72')); ?>
+
print(wcapi.get("taxes/72").json())
+
woocommerce.get("taxes/72").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "State Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes"
+      }
+    ]
+  }
+}
+

List all tax rates

+

This API helps you to view all the tax rates.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/taxes
+
+
+
curl https://example.com/wp-json/wc/v1/taxes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes')); ?>
+
print(wcapi.get("taxes").json())
+
woocommerce.get("taxes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 72,
+    "country": "US",
+    "state": "AL",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 1,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/72"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 73,
+    "country": "US",
+    "state": "AZ",
+    "postcode": "",
+    "city": "",
+    "rate": "5.6000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 2,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/73"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 74,
+    "country": "US",
+    "state": "AR",
+    "postcode": "",
+    "city": "",
+    "rate": "6.5000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 3,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/74"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 75,
+    "country": "US",
+    "state": "CA",
+    "postcode": "",
+    "city": "",
+    "rate": "7.5000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 4,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/75"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 76,
+    "country": "US",
+    "state": "CO",
+    "postcode": "",
+    "city": "",
+    "rate": "2.9000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 5,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/76"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 77,
+    "country": "US",
+    "state": "CT",
+    "postcode": "",
+    "city": "",
+    "rate": "6.3500",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 6,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/77"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 78,
+    "country": "US",
+    "state": "DC",
+    "postcode": "",
+    "city": "",
+    "rate": "5.7500",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 7,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/78"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 79,
+    "country": "US",
+    "state": "FL",
+    "postcode": "",
+    "city": "",
+    "rate": "6.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 8,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/79"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 80,
+    "country": "US",
+    "state": "GA",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 9,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/80"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 81,
+    "country": "US",
+    "state": "GU",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 10,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/81"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name, slug, term_group, description and count.
classstringSort by tax class.
+

Update a tax rate

+

This API lets you make changes to a tax rate.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/taxes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/taxes/72 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "US Tax"
+}'
+
const data = {
+  name: "US Tax"
+};
+
+WooCommerce.put("taxes/72", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'US Tax'
+];
+
+print_r($woocommerce->put('taxes/72', $data));
+?>
+
data = {
+    "name": "US Tax"
+}
+
+print(wcapi.put("taxes/72", data).json())
+
data = {
+  name: "US Tax"
+}
+
+woocommerce.put("taxes/72", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "US Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes"
+      }
+    ]
+  }
+}
+

Delete a tax rate

+

This API helps you delete a tax rate.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/taxes/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/taxes/72?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("taxes/72", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('taxes/72', ['force' => true])); ?>
+
print(wcapi.delete("taxes/72", params={"force": True}).json())
+
woocommerce.delete("taxes/72", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "US Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update tax rates

+

This API helps you to batch create, update and delete multiple tax rates.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/taxes/batch
+
+
+ +
+

Example batch creating all US taxes:

+
+
curl -X POST https://example.com/wp-json/wc/v1/taxes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "country": "US",
+      "state": "AL",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 1
+    },
+    {
+      "country": "US",
+      "state": "AZ",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 2
+    },
+    {
+      "country": "US",
+      "state": "AR",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 3
+    },
+    {
+      "country": "US",
+      "state": "CA",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 4
+    },
+    {
+      "country": "US",
+      "state": "CO",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 5
+    },
+    {
+      "country": "US",
+      "state": "CT",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 6
+    },
+    {
+      "country": "US",
+      "state": "DC",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 7
+    },
+    {
+      "country": "US",
+      "state": "FL",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 8
+    },
+    {
+      "country": "US",
+      "state": "GA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 9
+    },
+    {
+      "country": "US",
+      "state": "GU",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 10
+    },
+    {
+      "country": "US",
+      "state": "HI",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 11
+    },
+    {
+      "country": "US",
+      "state": "ID",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 12
+    },
+    {
+      "country": "US",
+      "state": "IL",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 13
+    },
+    {
+      "country": "US",
+      "state": "IN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 14
+    },
+    {
+      "country": "US",
+      "state": "IA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 15
+    },
+    {
+      "country": "US",
+      "state": "KS",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 16
+    },
+    {
+      "country": "US",
+      "state": "KY",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 17
+    },
+    {
+      "country": "US",
+      "state": "LA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 18
+    },
+    {
+      "country": "US",
+      "state": "ME",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 19
+    },
+    {
+      "country": "US",
+      "state": "MD",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 20
+    },
+    {
+      "country": "US",
+      "state": "MA",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 21
+    },
+    {
+      "country": "US",
+      "state": "MI",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 22
+    },
+    {
+      "country": "US",
+      "state": "MN",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 23
+    },
+    {
+      "country": "US",
+      "state": "MS",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 24
+    },
+    {
+      "country": "US",
+      "state": "MO",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 25
+    },
+    {
+      "country": "US",
+      "state": "NE",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 26
+    },
+    {
+      "country": "US",
+      "state": "NV",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 27
+    },
+    {
+      "country": "US",
+      "state": "NJ",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 28
+    },
+    {
+      "country": "US",
+      "state": "NM",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 29
+    },
+    {
+      "country": "US",
+      "state": "NY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 30
+    },
+    {
+      "country": "US",
+      "state": "NC",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 31
+    },
+    {
+      "country": "US",
+      "state": "ND",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 32
+    },
+    {
+      "country": "US",
+      "state": "OH",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 33
+    },
+    {
+      "country": "US",
+      "state": "OK",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 34
+    },
+    {
+      "country": "US",
+      "state": "PA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 35
+    },
+    {
+      "country": "US",
+      "state": "PR",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 36
+    },
+    {
+      "country": "US",
+      "state": "RI",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 37
+    },
+    {
+      "country": "US",
+      "state": "SC",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 38
+    },
+    {
+      "country": "US",
+      "state": "SD",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 39
+    },
+    {
+      "country": "US",
+      "state": "TN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 40
+    },
+    {
+      "country": "US",
+      "state": "TX",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 41
+    },
+    {
+      "country": "US",
+      "state": "UT",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 42
+    },
+    {
+      "country": "US",
+      "state": "VT",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 43
+    },
+    {
+      "country": "US",
+      "state": "VA",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 44
+    },
+    {
+      "country": "US",
+      "state": "WA",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 45
+    },
+    {
+      "country": "US",
+      "state": "WV",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 46
+    },
+    {
+      "country": "US",
+      "state": "WI",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 47
+    },
+    {
+      "country": "US",
+      "state": "WY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 48
+    }
+  ]
+}'
+
const data = {
+  create: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+};
+
+WooCommerce.post("taxes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'country' => 'US',
+            'state' => 'AL',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 1
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AZ',
+            'rate' => '5.6000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 2
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AR',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 3
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CA',
+            'rate' => '7.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 4
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CO',
+            'rate' => '2.9000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 5
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CT',
+            'rate' => '6.3500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 6
+        ],
+        [
+            'country' => 'US',
+            'state' => 'DC',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 7
+        ],
+        [
+            'country' => 'US',
+            'state' => 'FL',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 8
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 9
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GU',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 10
+        ],
+        [
+            'country' => 'US',
+            'state' => 'HI',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 11
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ID',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 12
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IL',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 13
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 14
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 15
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KS',
+            'rate' => '6.1500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 16
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KY',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 17
+        ],
+        [
+            'country' => 'US',
+            'state' => 'LA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 18
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ME',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 19
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MD',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 20
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MA',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 21
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MI',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 22
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MN',
+            'rate' => '6.8750',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 23
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MS',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 24
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MO',
+            'rate' => '4.2250',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 25
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NE',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 26
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NV',
+            'rate' => '6.8500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 27
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NJ',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 28
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NM',
+            'rate' => '5.1250',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 29
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 30
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NC',
+            'rate' => '4.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 31
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ND',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 32
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OH',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 33
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OK',
+            'rate' => '4.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 34
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 35
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PR',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 36
+        ],
+        [
+            'country' => 'US',
+            'state' => 'RI',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 37
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SC',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 38
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SD',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 39
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 40
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TX',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 41
+        ],
+        [
+            'country' => 'US',
+            'state' => 'UT',
+            'rate' => '5.9500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 42
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VT',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 43
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VA',
+            'rate' => '5.3000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 44
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WA',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 45
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WV',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 46
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WI',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 47
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 48
+        ]
+    ]
+];
+
+print_r($woocommerce->post('taxes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "country": "US",
+            "state": "AL",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 1
+        },
+        {
+            "country": "US",
+            "state": "AZ",
+            "rate": "5.6000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 2
+        },
+        {
+            "country": "US",
+            "state": "AR",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 3
+        },
+        {
+            "country": "US",
+            "state": "CA",
+            "rate": "7.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 4
+        },
+        {
+            "country": "US",
+            "state": "CO",
+            "rate": "2.9000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 5
+        },
+        {
+            "country": "US",
+            "state": "CT",
+            "rate": "6.3500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 6
+        },
+        {
+            "country": "US",
+            "state": "DC",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 7
+        },
+        {
+            "country": "US",
+            "state": "FL",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 8
+        },
+        {
+            "country": "US",
+            "state": "GA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 9
+        },
+        {
+            "country": "US",
+            "state": "GU",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 10
+        },
+        {
+            "country": "US",
+            "state": "HI",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 11
+        },
+        {
+            "country": "US",
+            "state": "ID",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 12
+        },
+        {
+            "country": "US",
+            "state": "IL",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 13
+        },
+        {
+            "country": "US",
+            "state": "IN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 14
+        },
+        {
+            "country": "US",
+            "state": "IA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 15
+        },
+        {
+            "country": "US",
+            "state": "KS",
+            "rate": "6.1500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 16
+        },
+        {
+            "country": "US",
+            "state": "KY",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 17
+        },
+        {
+            "country": "US",
+            "state": "LA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 18
+        },
+        {
+            "country": "US",
+            "state": "ME",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 19
+        },
+        {
+            "country": "US",
+            "state": "MD",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 20
+        },
+        {
+            "country": "US",
+            "state": "MA",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 21
+        },
+        {
+            "country": "US",
+            "state": "MI",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 22
+        },
+        {
+            "country": "US",
+            "state": "MN",
+            "rate": "6.8750",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 23
+        },
+        {
+            "country": "US",
+            "state": "MS",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 24
+        },
+        {
+            "country": "US",
+            "state": "MO",
+            "rate": "4.2250",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 25
+        },
+        {
+            "country": "US",
+            "state": "NE",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 26
+        },
+        {
+            "country": "US",
+            "state": "NV",
+            "rate": "6.8500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 27
+        },
+        {
+            "country": "US",
+            "state": "NJ",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 28
+        },
+        {
+            "country": "US",
+            "state": "NM",
+            "rate": "5.1250",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 29
+        },
+        {
+            "country": "US",
+            "state": "NY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 30
+        },
+        {
+            "country": "US",
+            "state": "NC",
+            "rate": "4.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 31
+        },
+        {
+            "country": "US",
+            "state": "ND",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 32
+        },
+        {
+            "country": "US",
+            "state": "OH",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 33
+        },
+        {
+            "country": "US",
+            "state": "OK",
+            "rate": "4.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 34
+        },
+        {
+            "country": "US",
+            "state": "PA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 35
+        },
+        {
+            "country": "US",
+            "state": "PR",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 36
+        },
+        {
+            "country": "US",
+            "state": "RI",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 37
+        },
+        {
+            "country": "US",
+            "state": "SC",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 38
+        },
+        {
+            "country": "US",
+            "state": "SD",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 39
+        },
+        {
+            "country": "US",
+            "state": "TN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 40
+        },
+        {
+            "country": "US",
+            "state": "TX",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 41
+        },
+        {
+            "country": "US",
+            "state": "UT",
+            "rate": "5.9500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 42
+        },
+        {
+            "country": "US",
+            "state": "VT",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 43
+        },
+        {
+            "country": "US",
+            "state": "VA",
+            "rate": "5.3000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 44
+        },
+        {
+            "country": "US",
+            "state": "WA",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 45
+        },
+        {
+            "country": "US",
+            "state": "WV",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 46
+        },
+        {
+            "country": "US",
+            "state": "WI",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 47
+        },
+        {
+            "country": "US",
+            "state": "WY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 48
+        }
+    ]
+}
+
+print(wcapi.post("taxes/batch", data).json())
+
data = {
+  create: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+}
+
+woocommerce.post("taxes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 72,
+      "country": "US",
+      "state": "AL",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 1,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/72"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 73,
+      "country": "US",
+      "state": "AZ",
+      "postcode": "",
+      "city": "",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 2,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/73"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 74,
+      "country": "US",
+      "state": "AR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 3,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/74"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 75,
+      "country": "US",
+      "state": "CA",
+      "postcode": "",
+      "city": "",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 4,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/75"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 76,
+      "country": "US",
+      "state": "CO",
+      "postcode": "",
+      "city": "",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 5,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/76"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 77,
+      "country": "US",
+      "state": "CT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 6,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/77"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 78,
+      "country": "US",
+      "state": "DC",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 7,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/78"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 79,
+      "country": "US",
+      "state": "FL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 8,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/79"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 80,
+      "country": "US",
+      "state": "GA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 9,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/80"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 81,
+      "country": "US",
+      "state": "GU",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 10,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/81"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 82,
+      "country": "US",
+      "state": "HI",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 11,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/82"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 83,
+      "country": "US",
+      "state": "ID",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 12,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/83"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 84,
+      "country": "US",
+      "state": "IL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 13,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/84"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 85,
+      "country": "US",
+      "state": "IN",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 14,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/85"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 86,
+      "country": "US",
+      "state": "IA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 15,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/86"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 87,
+      "country": "US",
+      "state": "KS",
+      "postcode": "",
+      "city": "",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 16,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/87"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 88,
+      "country": "US",
+      "state": "KY",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 17,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/88"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 89,
+      "country": "US",
+      "state": "LA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 18,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/89"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 90,
+      "country": "US",
+      "state": "ME",
+      "postcode": "",
+      "city": "",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 19,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/90"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 91,
+      "country": "US",
+      "state": "MD",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 20,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/91"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 92,
+      "country": "US",
+      "state": "MA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 21,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/92"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 93,
+      "country": "US",
+      "state": "MI",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 22,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/93"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 94,
+      "country": "US",
+      "state": "MN",
+      "postcode": "",
+      "city": "",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 23,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/94"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 95,
+      "country": "US",
+      "state": "MS",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 24,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/95"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 96,
+      "country": "US",
+      "state": "MO",
+      "postcode": "",
+      "city": "",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 25,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/96"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 97,
+      "country": "US",
+      "state": "NE",
+      "postcode": "",
+      "city": "",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 26,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/97"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 98,
+      "country": "US",
+      "state": "NV",
+      "postcode": "",
+      "city": "",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 27,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/98"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 99,
+      "country": "US",
+      "state": "NJ",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 28,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/99"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 100,
+      "country": "US",
+      "state": "NM",
+      "postcode": "",
+      "city": "",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 29,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/100"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 101,
+      "country": "US",
+      "state": "NY",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 30,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/101"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 102,
+      "country": "US",
+      "state": "NC",
+      "postcode": "",
+      "city": "",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 31,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/102"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 103,
+      "country": "US",
+      "state": "ND",
+      "postcode": "",
+      "city": "",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 32,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/103"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 104,
+      "country": "US",
+      "state": "OH",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 33,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/104"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 105,
+      "country": "US",
+      "state": "OK",
+      "postcode": "",
+      "city": "",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 34,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/105"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 106,
+      "country": "US",
+      "state": "PA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 35,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/106"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 107,
+      "country": "US",
+      "state": "PR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 36,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/107"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 108,
+      "country": "US",
+      "state": "RI",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 37,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/108"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 109,
+      "country": "US",
+      "state": "SC",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 38,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/109"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 110,
+      "country": "US",
+      "state": "SD",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 39,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/110"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 111,
+      "country": "US",
+      "state": "TN",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 40,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/111"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 112,
+      "country": "US",
+      "state": "TX",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 41,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/112"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 113,
+      "country": "US",
+      "state": "UT",
+      "postcode": "",
+      "city": "",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 42,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/113"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 114,
+      "country": "US",
+      "state": "VT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 43,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/114"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 115,
+      "country": "US",
+      "state": "VA",
+      "postcode": "",
+      "city": "",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 44,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/115"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 116,
+      "country": "US",
+      "state": "WA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 45,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/116"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 117,
+      "country": "US",
+      "state": "WV",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 46,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/117"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 118,
+      "country": "US",
+      "state": "WI",
+      "postcode": "",
+      "city": "",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 47,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/118"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 119,
+      "country": "US",
+      "state": "WY",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 48,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes/119"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/taxes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Tax classes

+

The tax classes API allows you to create, view, and delete individual tax classes.

+

Tax class properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringUnique identifier for the resource. read-only
namestringTax class name. required
+

Create a tax class

+

This API helps you to create a new tax class.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/taxes/classes
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/taxes/classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Zero Rate"
+}'
+
const data = {
+  name: "Zero Rate"
+};
+
+WooCommerce.post("taxes/classes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Zero Rate'
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+
data = {
+    "name": "Zero Rate"
+}
+
+print(wcapi.post("taxes/classes", data).json())
+
data = {
+  name: "Zero Rate"
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "slug": "zero-rate",
+  "name": "Zero Rate",
+  "_links": {
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+      }
+    ]
+  }
+}
+

List all tax classes

+

This API helps you to view all tax classes.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/taxes/classes
+
+
+
curl https://example.com/wp-json/wc/v1/taxes/classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes/classes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes/classes')); ?>
+
print(wcapi.get("taxes/classes").json())
+
woocommerce.get("taxes/classes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "slug": "standard",
+    "name": "Standard Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "reduced-rate",
+    "name": "Reduced Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "zero-rate",
+    "name": "Zero Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+        }
+      ]
+    }
+  }
+]
+

Delete a tax class

+

This API helps you delete a tax class.

+ + +

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/taxes/classes/<slug>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/taxes/classes/zero-rate?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("taxes/classes/zero-rate", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('taxes/classes/zero-rate', ['force' => true])); ?>
+
print(wcapi.delete("taxes/classes/zero-rate", params={"force": True}).json())
+
woocommerce.delete("taxes/classes/zero-rate", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "slug": "zero-rate",
+  "name": "Zero Rate",
+  "_links": {
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, since this resource does not support trashing.
+

Webhooks

+

The webhooks API allows you to create, view, update, and delete individual, or a batch, of webhooks.

+ +

Webhooks can be managed via the WooCommerce settings screen or by using the REST API endpoints. The WC_Webhook class manages all data storage and retrieval of the webhook custom post type, as well as enqueuing webhook actions and processing/delivering/logging webhooks. On woocommerce_init, active webhooks are loaded.

+ +

Each webhook has:

+ +
    +
  • status: active (delivers payload), paused (delivery paused by admin), disabled (delivery paused by failure).
  • +
  • topic: determines which resource events the webhook is triggered for.
  • +
  • delivery URL: URL where the payload is delivered, must be HTTP or HTTPS.
  • +
  • secret: an optional secret key that is used to generate a HMAC-SHA256 hash of the request body so the receiver can verify authenticity of the webhook.
  • +
  • hooks: an array of hook names that are added and bound to the webhook for processing.
  • +
+

Topics

+

The topic is a combination resource (e.g. order) and event (e.g. created) and maps to one or more hook names (e.g. woocommerce_checkout_order_processed). Webhooks can be created using the topic name and the appropriate hooks are automatically added.

+ +

Core topics are:

+ +
    +
  • Coupons: coupon.created, coupon.updated and coupon.deleted.
  • +
  • Customers: customer.created, customer.updated and customer.deleted.
  • +
  • Orders: order.created, order.updated and order.deleted.
  • +
  • Products: product.created, product.updated and product.deleted.
  • +
+ +

Custom topics can also be used which map to a single hook name, for example you could add a webhook with topic action.woocommerce_add_to_cart that is triggered on that event. Custom topics pass the first hook argument to the payload, so in this example the cart_item_key would be included in the payload.

+

Delivery/payload

+

Delivery is performed using wp_remote_post() (HTTP POST) and processed in the background by default using wp-cron. A few custom headers are added to the request to help the receiver process the webhook:

+ +
    +
  • X-WC-Webhook-Topic - e.g. order.updated.
  • +
  • X-WC-Webhook-Resource - e.g. order.
  • +
  • X-WC-Webhook-Event - e.g. updated.
  • +
  • X-WC-Webhook-Signature - a base64 encoded HMAC-SHA256 hash of the payload.
  • +
  • X-WC-Webhook-ID - webhook's post ID.
  • +
  • X-WC-Delivery-ID - delivery log ID (a comment).
  • +
+ +

The payload is JSON encoded and for API resources (coupons, customers, orders, products), the response is exactly the same as if requested via the REST API.

+

Logging

+

Requests/responses are logged as comments on the webhook custom post type. Each delivery log includes:

+ +
    +
  • Request duration.
  • +
  • Request URL, method, headers, and body.
  • +
  • Response Code, message, headers, and body.
  • +
+ +

Only the 25 most recent delivery logs are kept in order to reduce comment table bloat.

+ +

After 5 consecutive failed deliveries (as defined by a non HTTP 2xx response code), the webhook is disabled and must be edited via the REST API to re-enable.

+ +

Delivery logs can be fetched through the REST API endpoint or in code using WC_Webhook::get_delivery_logs().

+

Visual interface

+

You can find the Webhooks interface going to "WooCommerce" > "Settings" > "API" > "Webhooks", see our Visual Webhooks docs for more details.

+

Webhook properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringA friendly name for the webhook. Default is Webhook created on <date>.
statusstringWebhook status. Default is active. Options active (delivers payload), paused (does not deliver), or disabled (does not deliver due delivery failures).
topicstringWebhook topic, e.g. coupon.updated. See the complete list. required
resourcestringWebhook resource, e.g. coupon read-only
eventstringWebhook event, e.g. updated read-only
hooksarrayWooCommerce action names associated with the webhook. read-only
delivery_urlstringThe URL where the webhook payload is delivered. required
secretstringSecret key used to generate a hash of the delivered webhook and provided in the request headers. required write-only
date_createddate-timeUTC DateTime when the webhook was created read-only
date_modifieddate-timeUTC DateTime when the webhook was last updated read-only
+

Webhooks delivery properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
durationstringThe delivery duration, in seconds. read-only
summarystringA friendly summary of the response including the HTTP response code, message, and body. read-only
request_urlstringThe URL where the webhook was delivered. read-only
request_headersarrayRequest headers. See Request Headers Attributes for more details. read-only
request_bodystringRequest body. read-only
response_codestringThe HTTP response code from the receiving server. read-only
response_messagestringThe HTTP response message from the receiving server. read-only
response_headersarrayArray of the response headers from the receiving server. read-only
response_bodystringThe response body from the receiving server. read-only
date_createddate-timeThe date the webhook delivery was logged, in the site's timezone. read-only
+

Request header properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
User-AgentstringThe request user agent, default is "WooCommerce/{version} Hookshot (WordPress/{version})". read-only
Content-TypestringThe request content-type, default is "application/json". read-only
X-WC-Webhook-TopicstringThe webhook topic. read-only
X-WC-Webhook-ResourcestringThe webhook resource. read-only
X-WC-Webhook-EventstringThe webhook event. read-only
X-WC-Webhook-SignaturestringA base64 encoded HMAC-SHA256 hash of the payload. read-only
X-WC-Webhook-IDintegerThe webhook's ID. read-only
X-WC-Webhook-Delivery-IDintegerThe delivery ID. read-only
+

Create a webhook

+

This API helps you to create a new webhook.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v1/webhooks
+
+
+
curl -X POST https://example.com/wp-json/wc/v1/webhooks \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Order updated",
+  "topic": "order.updated",
+  "delivery_url": "http://requestb.in/1g0sxmo1"
+}'
+
const data = {
+  name: "Order updated",
+  topic: "order.updated",
+  delivery_url: "http://requestb.in/1g0sxmo1"
+};
+
+WooCommerce.post("webhooks", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Order updated',
+    'topic' => 'order.updated',
+    'delivery_url' => 'http://requestb.in/1g0sxmo1'
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+
data = {
+    "name": "Order updated",
+    "topic": "order.updated",
+    "delivery_url": "http://requestb.in/1g0sxmo1"
+}
+
+print(wcapi.post("webhooks", data).json())
+
data = {
+  name: "Order updated",
+  topic: "order.updated",
+  delivery_url: "http://requestb.in/1g0sxmo1"
+}
+
+woocommerce.post("webhooks", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "active",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T20:17:52",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks"
+      }
+    ]
+  }
+}
+

Retrieve a webhook

+

This API lets you retrieve and view a specific webhook.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/webhooks/<id>
+
+
+
curl https://example.com/wp-json/wc/v1/webhooks/142 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142')); ?>
+
print(wcapi.get("webhooks/142").json())
+
woocommerce.get("webhooks/142").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "active",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T20:17:52",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks"
+      }
+    ]
+  }
+}
+

List all webhooks

+

This API helps you to view all the webhooks.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/webhooks
+
+
+
curl https://example.com/wp-json/wc/v1/webhooks \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks')); ?>
+
print(wcapi.get("webhooks").json())
+
woocommerce.get("webhooks").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 143,
+    "name": "Customer created",
+    "status": "active",
+    "topic": "customer.created",
+    "resource": "customer",
+    "event": "created",
+    "hooks": [
+      "user_register",
+      "woocommerce_created_customer",
+      "woocommerce_api_create_customer"
+    ],
+    "delivery_url": "http://requestb.in/1g0sxmo1",
+    "date_created": "2016-05-15T20:17:52",
+    "date_modified": "2016-05-15T20:17:52",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/143"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks"
+        }
+      ]
+    }
+  },
+  {
+    "id": 142,
+    "name": "Order updated",
+    "status": "active",
+    "topic": "order.updated",
+    "resource": "order",
+    "event": "updated",
+    "hooks": [
+      "woocommerce_process_shop_order_meta",
+      "woocommerce_api_edit_order",
+      "woocommerce_order_edit_status",
+      "woocommerce_order_status_changed"
+    ],
+    "delivery_url": "http://requestb.in/1g0sxmo1",
+    "date_created": "2016-05-15T20:17:52",
+    "date_modified": "2016-05-15T20:17:52",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludestringEnsure result set excludes specific ids.
includestringLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is date, Options: date, id, include, title and slug.
slugstringLimit result set to posts with a specific slug.
statusstringLimit result set to webhooks assigned a specific status. Default is all. Options: all, active, paused and disabled.
+

Update a webhook

+

This API lets you make changes to a webhook.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v1/webhook/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v1/webhook/142 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "status": "paused"
+}'
+
const data = {
+  status: "paused"
+}
+
+WooCommerce.put("webhooks/142", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'status' => 'paused'
+];
+
+print_r($woocommerce->put('webhooks/142', $data));
+?>
+
data = {
+    "status": "paused"
+}
+
+print(wcapi.put("webhooks/142", data).json())
+
data = {
+  status: "paused"
+}
+
+woocommerce.put("webhooks/142", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "paused",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T20:30:12",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks"
+      }
+    ]
+  }
+}
+

Delete a webhook

+

This API helps you delete a webhook.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v1/webhooks/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v1/webhooks/142 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("webhooks/142")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('webhooks/142')); ?>
+
print(wcapi.delete("webhooks/142").json())
+
woocommerce.delete("webhooks/142").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "paused",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T20:30:12",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the webhook, Defaults is false.
+

Batch update webhooks

+

This API helps you to batch create, update and delete multiple webhooks.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v1/webhooks/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v1/webhooks/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Coupon created",
+      "topic": "coupon.created",
+      "delivery_url": "http://requestb.in/1g0sxmo1"
+    },
+    {
+      "name": "Customer deleted",
+      "topic": "customer.deleted",
+      "delivery_url": "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  "delete": [
+    143
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Round toe",
+      topic: "coupon.created",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    },
+    {
+      name: "Customer deleted",
+      topic: "customer.deleted",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  delete: [
+    143
+  ]
+};
+
+WooCommerce.post("webhooks/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Round toe',
+            'topic' => 'coupon.created',
+            'delivery_url' => 'http://requestb.in/1g0sxmo1'
+        ],
+        [
+            'name' => 'Customer deleted',
+            'topic' => 'customer.deleted',
+            'delivery_url' => 'http://requestb.in/1g0sxmo1'
+        ]
+    ],
+    'delete' => [
+        143
+    ]
+];
+
+print_r($woocommerce->post('webhooks/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Round toe",
+            "topic": "coupon.created",
+            "delivery_url": "http://requestb.in/1g0sxmo1"
+        },
+        {
+            "name": "Customer deleted",
+            "topic": "customer.deleted",
+            "delivery_url": "http://requestb.in/1g0sxmo1"
+        }
+    ],
+    "delete": [
+        143
+    ]
+}
+
+print(wcapi.post("webhooks/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe",
+      topic: "coupon.created",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    },
+    {
+      name: "Customer deleted",
+      topic: "customer.deleted",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  delete: [
+    143
+  ]
+}
+
+woocommerce.post("webhooks/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 146,
+      "name": "Coupon created",
+      "status": "active",
+      "topic": "coupon.created",
+      "resource": "coupon",
+      "event": "created",
+      "hooks": [
+        "woocommerce_process_shop_coupon_meta",
+        "woocommerce_api_create_coupon"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-24T22:56:26",
+      "date_modified": "2016-05-24T22:56:26",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/webhooks/146"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/webhooks"
+          }
+        ]
+      }
+    },
+    {
+      "id": 147,
+      "name": "Customer deleted",
+      "status": "active",
+      "topic": "customer.deleted",
+      "resource": "customer",
+      "event": "deleted",
+      "hooks": [
+        "delete_user"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-24T22:56:30",
+      "date_modified": "2016-05-24T22:56:30",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/webhooks/147"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/webhooks"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 143,
+      "name": "Webhook created on May 24, 2016 @ 03:20 AM",
+      "status": "active",
+      "topic": "customer.created",
+      "resource": "customer",
+      "event": "created",
+      "hooks": [
+        "user_register",
+        "woocommerce_created_customer",
+        "woocommerce_api_create_customer"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-15T20:17:52",
+      "date_modified": "2016-05-15T20:17:52",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/webhooks/143"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v1/webhooks"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve webhook delivery

+

This API lets you retrieve and view a specific webhook delivery.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/webhooks/<id>/deliveries/<delivery_id>
+
+
+
curl https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142/deliveries/54")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142/deliveries/54')); ?>
+
print(wcapi.get("webhooks/142/deliveries/54").json())
+
woocommerce.get("webhooks/142/deliveries/54").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 54,
+  "duration": "0.40888",
+  "summary": "HTTP 200 OK: ok",
+  "request_method": "POST",
+  "request_url": "http://requestb.in/1g0sxmo1",
+  "request_headers": {
+    "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
+    "Content-Type": "application/json",
+    "X-WC-Webhook-Source": "http://example.com/",
+    "X-WC-Webhook-Topic": "order.updated",
+    "X-WC-Webhook-Resource": "order",
+    "X-WC-Webhook-Event": "updated",
+    "X-WC-Webhook-Signature": "J72iu7hL93aUt2dFnyOBoBypwbmP6nt6Aor33nnOHxU=",
+    "X-WC-Webhook-ID": 142,
+    "X-WC-Webhook-Delivery-ID": 54
+  },
+  "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:30:30Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
+  "response_code": "200",
+  "response_message": "OK",
+  "response_headers": {
+    "connection": "close",
+    "server": "gunicorn/19.3.0",
+    "date": "Tue, 16 May 2016 03:30:31 GMT",
+    "content-type": "text/html; charset=utf-8",
+    "content-length": "2",
+    "sponsored-by": "https://www.runscope.com",
+    "via": "1.1 vegur"
+  },
+  "response_body": "ok",
+  "date_created": "2016-05-16T03:30:31",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+      }
+    ]
+  }
+}
+
+ +

List all webhook deliveries

+

This API helps you to view all deliveries from a specific webhooks.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v1/webhooks/<id>/deliveries
+
+
+
curl https://example.com/wp-json/wc/v1/webhooks/142/deliveries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142/deliveries")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142/deliveries')); ?>
+
print(wcapi.get("webhooks/142/deliveries").json())
+
woocommerce.get("webhooks/142/deliveries").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 54,
+    "duration": "0.40888",
+    "summary": "HTTP 200 OK: ok",
+    "request_method": "POST",
+    "request_url": "http://requestb.in/1g0sxmo1",
+    "request_headers": {
+      "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
+      "Content-Type": "application/json",
+      "X-WC-Webhook-Source": "http://example.com/",
+      "X-WC-Webhook-Topic": "order.updated",
+      "X-WC-Webhook-Resource": "order",
+      "X-WC-Webhook-Event": "updated",
+      "X-WC-Webhook-Signature": "J72iu7hL93aUt2dFnyOBoBypwbmP6nt6Aor33nnOHxU=",
+      "X-WC-Webhook-ID": 142,
+      "X-WC-Webhook-Delivery-ID": 54
+    },
+    "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:30:30Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
+    "response_code": "200",
+    "response_message": "OK",
+    "response_headers": {
+      "connection": "close",
+      "server": "gunicorn/19.3.0",
+      "date": "Tue, 16 May 2016 03:30:31 GMT",
+      "content-type": "text/html; charset=utf-8",
+      "content-length": "2",
+      "sponsored-by": "https://www.runscope.com",
+      "via": "1.1 vegur"
+    },
+    "response_body": "ok",
+    "date_created": "2016-05-16T03:30:31",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+        }
+      ]
+    }
+  },
+  {
+    "id": 53,
+    "duration": "0.7615",
+    "summary": "HTTP 200 OK: ok",
+    "request_method": "POST",
+    "request_url": "http://requestb.in/1g0sxmo1",
+    "request_headers": {
+      "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
+      "Content-Type": "application/json",
+      "X-WC-Webhook-Source": "http://example.com/",
+      "X-WC-Webhook-Topic": "order.updated",
+      "X-WC-Webhook-Resource": "order",
+      "X-WC-Webhook-Event": "updated",
+      "X-WC-Webhook-Signature": "Z996ccyueeoqdXZFq2ND2ETpsPGrXmWKj+yvQ0c2N1w=",
+      "X-WC-Webhook-ID": 142,
+      "X-WC-Webhook-Delivery-ID": 53
+    },
+    "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:29:13Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
+    "response_code": "200",
+    "response_message": "OK",
+    "response_headers": {
+      "connection": "close",
+      "server": "gunicorn/19.3.0",
+      "date": "Tue, 16 May 2016 03:29:20 GMT",
+      "content-type": "text/html; charset=utf-8",
+      "content-length": "2",
+      "sponsored-by": "https://www.runscope.com",
+      "via": "1.1 vegur"
+    },
+    "response_body": "ok",
+    "date_created": "2016-05-16T03:29:19",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries/53"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v1/webhooks/142"
+        }
+      ]
+    }
+  }
+]
+
+
+
+
+ cURL + Node.js + PHP + Python + Ruby +
+
+
+ +
+ This documentation is for the WooCommerce REST API v1 which is deprecated since WooCommerce 3.0. Please use the latest REST API version. +
+ + + diff --git a/wp-api-v2.html b/wp-api-v2.html new file mode 100644 index 00000000..3b002653 --- /dev/null +++ b/wp-api-v2.html @@ -0,0 +1,39085 @@ + + + + + + + + WooCommerce REST API Documentation - WP REST API v2 + + + + + + + + + + + + + + + + + + + NAV + + + +
+ +
+ cURL + Node.js + PHP + Python + Ruby +
+ + +
+
+
+
+

Introduction

+

WooCommerce (WC) 2.6+ is fully integrated with the WordPress REST API. This allows WC data to be created, read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients.

+ +

The current WP REST API integration version is v2 which takes a first-order position in endpoints.

+ +

The following table shows API versions present in each major version of WooCommerce:

+ + + + + + + + + + + + + + + + + + + + + +
API VersionWC VersionWP VersionDocumentation
v23.0.x or later4.4 or later-
v12.6.x or later4.4 or laterv1 docs
+ +

Prior to 2.6, WooCommerce had a REST API separate from WordPress which is now known as the legacy API. You can find the documentation for the legacy API separately.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
API VersionWC VersionWP VersionDocumentation
Legacy v32.4.x or later4.1 or laterLegacy v3 docs
Legacy v22.2.x or later4.1 or laterLegacy v2 docs
Legacy v12.1.x or later4.1 or laterLegacy v1 docs
+

Requirements

+

To use the latest version of the REST API you must be using:

+ +
    +
  • WooCommerce 2.6+.
  • +
  • WordPress 4.4+.
  • +
  • Pretty permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work.
  • +
  • You may access the API over either HTTP or HTTPS, but HTTPS is recommended where possible.
  • +
+ +

If you use ModSecurity and see 501 Method Not Implemented errors, see this issue for details.

+ + +

Request/Response Format

+

The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

+ +

Some general information about responses:

+ +
    +
  • Dates are returned in ISO8601 format: YYYY-MM-DDTHH:MM:SS
  • +
  • Resource IDs are returned as integers.
  • +
  • Any decimal monetary amount, such as prices or totals, will be returned as strings with two decimal places.
  • +
  • Other amounts, such as item counts, are returned as integers.
  • +
  • Blank fields are generally included as null or emtpy string instead of being omitted.
  • +
+

JSONP Support

+

The WP REST API supports JSONP by default. JSONP responses use the application/javascript content-type. You can specify the callback using the ?_jsonp parameter for GET requests to have the response wrapped in a JSON function:

+ +
+
+ GET +
/wp-json/wc/v2?_jsonp=callback
+
+
+
curl https://example.com/wp-json/wc/v2/products/tags/34?_jsonp=tagDetails \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags/34?_jsonp=tagDetails")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags/34', ['_jsonp' => 'tagDetails'])); ?>
+
print(wcapi.get("products/tags/34?_jsonp=tagDetails").json())
+
woocommerce.get("products/tags/34", _jsonp: "tagDetails").parsed_response
+
+
+

Response:

+
+
/**/tagDetails({"id":34,"name":"Leather Shoes","slug":"leather-shoes","description":"","count":0,"_links":{"self":[{"href":"https://example.com/wp-json/wc/v2/products/tags/34"}],"collection":[{"href":"https://example.com/wp-json/wc/v2/products/tags"}]}})%
+

Errors

+

Occasionally you might encounter errors when accessing the REST API. There are four possible types:

+ + + + + + + + + + + + + + + + + + + + + + + +
Error CodeError Type
400 Bad RequestInvalid request, e.g. using an unsupported HTTP method
401 UnauthorizedAuthentication or permission error, e.g. incorrect API keys
404 Not FoundRequests to resources that don't exist or are missing
500 Internal Server ErrorServer error
+ +
+

WP REST API error example:

+
+
{
+  "code": "rest_no_route",
+  "message": "No route was found matching the URL and request method",
+  "data": {
+    "status": 404
+  }
+}
+
+
+

WooCommerce REST API error example:

+
+
{
+  "code": "woocommerce_rest_term_invalid",
+  "message": "Resource doesn't exist.",
+  "data": {
+    "status": 404
+  }
+}
+
+

Errors return both an appropriate HTTP status code and response object which contains a code, message and data attribute.

+

Parameters

+

Almost all endpoints accept optional parameters which can be passed as a HTTP query string parameter, e.g. GET /orders?status=completed. All parameters are documented along each endpoint.

+

Pagination

+

Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the posts_per_page option. Alternatively the items per page can be specified with the ?per_page parameter:

+ +

GET /orders?per_page=15

+ +

You can specify further pages with the ?page parameter:

+ +

GET /orders?page=2

+ +

You may also specify the offset from the first resource using the ?offset parameter:

+ +

GET /orders?offset=5

+ +

Page number is 1-based and omitting the ?page parameter will return the first page.

+ +

The total number of resources and pages are always included in the X-WP-Total and X-WP-TotalPages HTTP headers.

+ +

Pagination info is included in the Link Header. It's recommended that you follow these values instead of building your own URLs where possible.

+
Link: <https://www.example.com/wp-json/wc/v2/products?page=2>; rel="next",
+<https://www.example.com/wp-json/wc/v2/products?page=3>; rel="last"`
+
+

The possible rel values are:

+ + + + + + + + + + + + + + + + + + + + + + + +
ValueDescription
nextShows the URL of the immediate next page of results.
lastShows the URL of the last page of results.
firstShows the URL of the first page of results.
prevShows the URL of the immediate previous page of results.
+

Libraries and Tools

Official libraries

+ +
// Install:
+// npm install --save @woocommerce/woocommerce-rest-api
+
+// Setup:
+const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'http://example.com', // Your store URL
+  consumerKey: 'consumer_key', // Your consumer key
+  consumerSecret: 'consumer_secret', // Your consumer secret
+  version: 'wc/v2' // WooCommerce WP REST API version
+});
+
<?php
+// Install:
+// composer require automattic/woocommerce
+
+// Setup:
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'http://example.com', // Your store URL
+    'consumer_key', // Your consumer key
+    'consumer_secret', // Your consumer secret
+    [
+        'wp_api' => true, // Enable the WP REST API integration
+        'version' => 'wc/v2' // WooCommerce WP REST API version
+    ]
+);
+?>
+
# Install:
+# pip install woocommerce
+
+# Setup:
+from woocommerce import API
+
+wcapi = API(
+    url="http://example.com", # Your store URL
+    consumer_key="consumer_key", # Your consumer key
+    consumer_secret="consumer_secret", # Your consumer secret
+    wp_api=True, # Enable the WP REST API integration
+    version="wc/v2" # WooCommerce WP REST API version
+)
+
# Install:
+# gem install woocommerce_api
+
+# Setup:
+require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com", # Your store URL
+  "consumer_key", # Your consumer key
+  "consumer_secret", # Your consumer secret
+  {
+    wp_api: true, # Enable the WP REST API integration
+    version: "wc/v2" # WooCommerce WP REST API version
+  }
+)
+
+ +

Third party libraries

+ + + +

Tools

+

Some useful tools you can use to access the API include:

+ +
    +
  • Insomnia - Cross-platform GraphQL and REST client, available for Mac, Windows, and Linux.
  • +
  • Postman - Cross-platform REST client, available for Mac, Windows, and Linux.
  • +
  • RequestBin - Allows you test webhooks.
  • +
  • Hookbin - Another tool to test webhooks.
  • +
+

Authentication

+

WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any WP REST API authentication plugin or method.

+

REST API keys

+

Pre-generated keys can be used to authenticate use of the REST API endpoints. New keys can be generated either through the WordPress admin interface or they can be auto-generated through an endpoint.

+

Generating API keys in the WordPress admin interface

+

To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > API > Keys/Apps.

+ +

WooCommerce REST API keys settings

+ +

Click the "Add Key" button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user's WordPress roles and capabilities.

+ +

Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the "Generate API Key" button and WooCommerce will generate REST API keys for the selected user.

+ +

Creating a new REST API key

+ +

Now that keys have been generated, you should see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.

+ +

Generated REST API key

+ +

If the WordPress user associated with an API key is deleted, the API key will cease to function. API keys are not transferred to other users.

+

Auto generating API keys using our Application Authentication Endpoint

+

This endpoint can be used by any APP to allow users to generate API keys for your APP. This makes integration with WooCommerce API easier because the user only needs to grant access to your APP via a URL. After being redirected back to your APP, the API keys will be sent back in a separate POST request.

+ +

The following image illustrates how this works:

+ +

Authentication Endpoint flow

+ + +

URL parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
app_namestringYour APP name mandatory
scopestringLevel of access. Available: read, write and read_write mandatory
user_idstringUser ID in your APP. For your internal reference, used when the user is redirected back to your APP. NOT THE USER ID IN WOOCOMMERCE mandatory
return_urlstringURL the user will be redirected to after authentication mandatory
callback_urlstringURL that will receive the generated API key. Note: this URL should be over HTTPS mandatory
+

Creating an authentication endpoint URL

+

You must use the /wc-auth/v1/authorize endpoint and pass the above parameters as a query string.

+ +
+

Example of how to build an authentication URL:

+
+
# Bash example
+STORE_URL='http://example.com'
+ENDPOINT='/wc-auth/v1/authorize'
+PARAMS="app_name=My App Name&scope=read_write&user_id=123&return_url=http://app.com/return-page&callback_url=https://app.com/callback-endpoint"
+QUERY_STRING="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$PARAMS")"
+QUERY_STRING=$(echo $QUERY_STRING | sed -e "s/%20/\+/g" -e "s/%3D/\=/g" -e "s/%26/\&/g")
+
+echo "$STORE_URL$ENDPOINT?$QUERY_STRING"
+
const querystring = require('querystring');
+
+const store_url = 'http://example.com';
+const endpoint = '/wc-auth/v1/authorize';
+const params = {
+  app_name: 'My App Name',
+  scope: 'read_write',
+  user_id: 123,
+  return_url: 'http://app.com/return-page',
+  callback_url: 'https://app.com/callback-endpoint'
+};
+const query_string = querystring.stringify(params).replace(/%20/g, '+');
+
+console.log(store_url + endpoint + '?' + query_string);
+
<?php
+$store_url = 'http://example.com';
+$endpoint = '/wc-auth/v1/authorize';
+$params = [
+    'app_name' => 'My App Name',
+    'scope' => 'write',
+    'user_id' => 123,
+    'return_url' => 'http://app.com',
+    'callback_url' => 'https://app.com'
+];
+$query_string = http_build_query( $params );
+
+echo $store_url . $endpoint . '?' . $query_string;
+?>
+
from urllib.parse import urlencode
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+    "app_name": "My App Name",
+    "scope": "read_write",
+    "user_id": 123,
+    "return_url": "http://app.com/return-page",
+    "callback_url": "https://app.com/callback-endpoint"
+}
+query_string = urlencode(params)
+
+print("%s%s?%s" % (store_url, endpoint, query_string))
+
require "uri"
+
+store_url = 'http://example.com'
+endpoint = '/wc-auth/v1/authorize'
+params = {
+  app_name: "My App Name",
+  scope: "read_write",
+  user_id: 123,
+  return_url: "http://app.com/return-page",
+  callback_url: "https://app.com/callback-endpoint"
+}
+query_string = URI.encode_www_form(params)
+
+puts "#{store_url}#{endpoint}?#{query_string}"
+
+
+

Example of JSON posted with the API Keys

+
+
{
+    "key_id": 1,
+    "user_id": 123,
+    "consumer_key": "ck_xxxxxxxxxxxxxxxx",
+    "consumer_secret": "cs_xxxxxxxxxxxxxxxx",
+    "key_permissions": "read_write"
+}
+
+

Example of the screen that the user will see:

+ +

Authentication Endpoint example

+

Notes

+
    +
  • While redirecting the user using return_url, you are also sent success and user_id parameters as query strings.
  • +
  • success sends 0 if the user denied, or 1 if authenticated successfully.
  • +
  • Use user_id to identify the user when redirected back to the (return_url) and also remember to save the API Keys when your callback_url is posted to after auth.
  • +
  • The auth endpoint will send the API Keys in JSON format to the callback_url, so it's important to remember that some languages such as PHP will not display it inside the $_POST global variable, in PHP you can access it using $HTTP_RAW_POST_DATA (for old PHP versions) or file_get_contents('php://input');.
  • +
  • The URL generated must have all query string values encoded.
  • +
+

Authentication over HTTPS

+

You may use HTTP Basic Auth by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.

+ +
+

HTTP Basic Auth example

+
+
curl https://www.example.com/wp-json/wc/v2/orders \
+    -u consumer_key:consumer_secret
+
const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'https://example.com',
+  consumerKey: 'consumer_key',
+  consumerSecret: 'consumer_secret',
+  version: 'wc/v2'
+});
+
<?php
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'https://example.com',
+    'consumer_key',
+    'consumer_secret',
+    [
+        'wp_api' => true,
+        'version' => 'wc/v2'
+    ]
+);
+?>
+
from woocommerce import API
+
+wcapi = API(
+    url="https://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    wp_api=True,
+    version="wc/v2"
+)
+
require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    wp_json: true,
+    version: "wc/v2"
+  }
+)
+
+

Occasionally some servers may not parse the Authorization header correctly (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters instead.

+ +
+

Example for servers that not properly parse the Authorization header:

+
+
curl https://www.example.com/wp-json/wc/v2/orders?consumer_key=123&consumer_secret=abc
+
const WooCommerceRestApi = require("@woocommerce/woocommerce-rest-api").default;
+// import WooCommerceRestApi from "@woocommerce/woocommerce-rest-api"; // Supports ESM
+
+const WooCommerce = new WooCommerceRestApi({
+  url: 'https://example.com',
+  consumerKey: 'consumer_key',
+  consumerSecret: 'consumer_secret',
+  version: 'wc/v2',
+  queryStringAuth: true // Force Basic Authentication as query string true and using under HTTPS
+});
+
<?php
+require __DIR__ . '/vendor/autoload.php';
+
+use Automattic\WooCommerce\Client;
+
+$woocommerce = new Client(
+    'https://example.com',
+    'consumer_key',
+    'consumer_secret',
+    [
+        'wp_api' => true,
+        'version' => 'wc/v2',
+        'query_string_auth' => true // Force Basic Authentication as query string true and using under HTTPS
+    ]
+);
+?>
+
from woocommerce import API
+
+wcapi = API(
+    url="https://example.com",
+    consumer_key="consumer_key",
+    consumer_secret="consumer_secret",
+    wp_api=True,
+    version="wc/v2",
+    query_string_auth=True // Force Basic Authentication as query string true and using under HTTPS
+)
+
require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+  "https://example.com",
+  "consumer_key",
+  "consumer_secret",
+  {
+    wp_json: true,
+    version: "wc/v2",
+    query_string_auth: true // Force Basic Authentication as query string true and using under HTTPS
+  }
+)
+

Authentication over HTTP

+

You must use OAuth 1.0a "one-legged" authentication to ensure REST API credentials cannot be intercepted by an attacker. Typically you will use any standard OAuth 1.0a library in the language of your choice to handle the authentication, or generate the necessary parameters by following the following instructions.

+

Creating a signature

Collect the request method and URL

+

First you need to determine the HTTP method you will be using for the request, and the URL of the request.

+ +

The HTTP method will be GET in our case.

+ +

The Request URL will be the endpoint you are posting to, e.g. http://www.example.com/wp-json/wc/v2/orders.

+

Collect parameters

+

Collect and normalize your parameters. This includes all oauth_* parameters except for the oauth_signature itself.

+ +

These values need to be encoded into a single string which will be used later on. The process to build the string is very specific:

+ +
    +
  1. Percent encode every key and value that will be signed.
  2. +
  3. Sort the list of parameters alphabetically by encoded key.
  4. +
  5. For each key/value pair: + +
      +
    • Append the encoded key to the output string.
    • +
    • Append the = character to the output string.
    • +
    • Append the encoded value to the output string.
    • +
    • If there are more key/value pairs remaining, append a & character to the output string.
    • +
  6. +
+ +

When percent encoding in PHP for example, you would use rawurlencode().

+ +

When sorting parameters in PHP for example, you would use uksort( $params, 'strcmp' ).

+ +
+

Parameters example:

+
+
oauth_consumer_key=abc123&oauth_signature_method=HMAC-SHA1
+

Create the signature base string

+

The above values collected so far must be joined to make a single string, from which the signature will be generated. This is called the signature base string in the OAuth specification.

+ +

To encode the HTTP method, request URL, and parameter string into a single string:

+ +
    +
  1. Set the output string equal to the uppercase HTTP Method.
  2. +
  3. Append the & character to the output string.
  4. +
  5. Percent encode the URL and append it to the output string.
  6. +
  7. Append the & character to the output string.
  8. +
  9. Percent encode the parameter string and append it to the output string.
  10. +
+ +
+

Example signature base string:

+
+
GET&http%3A%2F%2Fwww.example.com%2Fwp-json%2Fwc%2Fv2%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1
+

Generate the signature

+

Generate the signature using the signature base string and your consumer secret key with a & character with the HMAC-SHA1 hashing algorithm.

+ +

In PHP you can use the hash_hmac function.

+ +

HMAC-SHA1 or HMAC-SHA256 are the only accepted hash algorithms.

+ +

If you are having trouble generating a correct signature, you'll want to review the string you are signing for encoding errors. The authentication source can also be helpful in understanding how to properly generate the signature.

+

OAuth tips

+
    +
  • The OAuth parameters may be added as query string parameters or included in the Authorization header.
  • +
  • Note there is no reliable cross-platform way to get the raw request headers in WordPress, so query string should be more reliable in some cases.
  • +
  • The required parameters are: oauth_consumer_key, oauth_timestamp, oauth_nonce, oauth_signature, and oauth_signature_method. oauth_version is not required and should be omitted.
  • +
  • The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key.
  • +
  • The OAuth timestamp should be the unix timestamp at the time of the request. The REST API will deny any requests that include a timestamp outside of a 15 minute window to prevent replay attacks.
  • +
  • You must use the store URL provided by the index when forming the base string used for the signature, as this is what the server will use. (e.g. if the store URL includes a www sub-domain, you should use it for requests)
  • +
  • Note that the request body is not signed as per the OAuth spec.
  • +
  • If including parameters in your request, it saves a lot of trouble if you can order your items alphabetically.
  • +
  • Authorization header is supported starting WooCommerce 3.0.
  • +
+

Index

+

By default, the API provides information about all available endpoints on the site. Authentication is not required to access the API index.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2
+
+
+
curl https://example.com/wp-json/wc/v2
+
WooCommerce.get("")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('')); ?>
+
print(wcapi.get("").json())
+
woocommerce.get("").parsed_response
+
+
+

JSON response example:

+
+
{
+  "namespace": "wc/v2",
+  "routes": {
+    "/wc/v2": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "namespace": {
+              "required": false,
+              "default": "wc/v2"
+            },
+            "context": {
+              "required": false,
+              "default": "view"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2"
+      }
+    },
+    "/wc/v2/coupons": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "code": {
+              "required": false,
+              "description": "Limit result set to resources with a specific code.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "code": {
+              "required": true,
+              "description": "Coupon code.",
+              "type": "string"
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount. Should always be numeric, even if setting a percentage.",
+              "type": "string"
+            },
+            "discount_type": {
+              "required": false,
+              "default": "fixed_cart",
+              "enum": [
+                "percent",
+                "fixed_cart",
+                "fixed_product"
+              ],
+              "description": "Determines the type of discount that will be applied.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description.",
+              "type": "string"
+            },
+            "date_expires": {
+              "required": false,
+              "description": "The date the coupon expires, in the site's timezone.",
+              "type": "string"
+            },
+            "date_expires_gmt": {
+              "required": false,
+              "description": "The date the coupon expires, as GMT.",
+              "type": "string"
+            },
+            "individual_use": {
+              "required": false,
+              "default": false,
+              "description": "If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.",
+              "type": "boolean"
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon can be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon cannot be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used in total.",
+              "type": "integer"
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer.",
+              "type": "integer"
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to.",
+              "type": "integer"
+            },
+            "free_shipping": {
+              "required": false,
+              "default": false,
+              "description": "If true and if the free shipping method requires a coupon, this coupon will enable free shipping.",
+              "type": "boolean"
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon applies to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon does not apply to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "default": false,
+              "description": "If true, this coupon will not be applied to items that have sale prices.",
+              "type": "boolean"
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies.",
+              "type": "string"
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon.",
+              "type": "string"
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon.",
+              "type": "array",
+              "items": {
+                "type": "string"
+              }
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/coupons"
+      }
+    },
+    "/wc/v2/coupons/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "code": {
+              "required": false,
+              "description": "Coupon code.",
+              "type": "string"
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount. Should always be numeric, even if setting a percentage.",
+              "type": "string"
+            },
+            "discount_type": {
+              "required": false,
+              "enum": [
+                "percent",
+                "fixed_cart",
+                "fixed_product"
+              ],
+              "description": "Determines the type of discount that will be applied.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description.",
+              "type": "string"
+            },
+            "date_expires": {
+              "required": false,
+              "description": "The date the coupon expires, in the site's timezone.",
+              "type": "string"
+            },
+            "date_expires_gmt": {
+              "required": false,
+              "description": "The date the coupon expires, as GMT.",
+              "type": "string"
+            },
+            "individual_use": {
+              "required": false,
+              "description": "If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.",
+              "type": "boolean"
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon can be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon cannot be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used in total.",
+              "type": "integer"
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer.",
+              "type": "integer"
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to.",
+              "type": "integer"
+            },
+            "free_shipping": {
+              "required": false,
+              "description": "If true and if the free shipping method requires a coupon, this coupon will enable free shipping.",
+              "type": "boolean"
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon applies to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon does not apply to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "description": "If true, this coupon will not be applied to items that have sale prices.",
+              "type": "boolean"
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies.",
+              "type": "string"
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon.",
+              "type": "string"
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon.",
+              "type": "array",
+              "items": {
+                "type": "string"
+              }
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/coupons/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "code": {
+              "required": false,
+              "description": "Coupon code.",
+              "type": "string"
+            },
+            "amount": {
+              "required": false,
+              "description": "The amount of discount. Should always be numeric, even if setting a percentage.",
+              "type": "string"
+            },
+            "discount_type": {
+              "required": false,
+              "enum": [
+                "percent",
+                "fixed_cart",
+                "fixed_product"
+              ],
+              "description": "Determines the type of discount that will be applied.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Coupon description.",
+              "type": "string"
+            },
+            "date_expires": {
+              "required": false,
+              "description": "The date the coupon expires, in the site's timezone.",
+              "type": "string"
+            },
+            "date_expires_gmt": {
+              "required": false,
+              "description": "The date the coupon expires, as GMT.",
+              "type": "string"
+            },
+            "individual_use": {
+              "required": false,
+              "description": "If true, the coupon can only be used individually. Other applied coupons will be removed from the cart.",
+              "type": "boolean"
+            },
+            "product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon can be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_ids": {
+              "required": false,
+              "description": "List of product IDs the coupon cannot be used on.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "usage_limit": {
+              "required": false,
+              "description": "How many times the coupon can be used in total.",
+              "type": "integer"
+            },
+            "usage_limit_per_user": {
+              "required": false,
+              "description": "How many times the coupon can be used per customer.",
+              "type": "integer"
+            },
+            "limit_usage_to_x_items": {
+              "required": false,
+              "description": "Max number of items in the cart the coupon can be applied to.",
+              "type": "integer"
+            },
+            "free_shipping": {
+              "required": false,
+              "description": "If true and if the free shipping method requires a coupon, this coupon will enable free shipping.",
+              "type": "boolean"
+            },
+            "product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon applies to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "excluded_product_categories": {
+              "required": false,
+              "description": "List of category IDs the coupon does not apply to.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "exclude_sale_items": {
+              "required": false,
+              "description": "If true, this coupon will not be applied to items that have sale prices.",
+              "type": "boolean"
+            },
+            "minimum_amount": {
+              "required": false,
+              "description": "Minimum order amount that needs to be in the cart before coupon applies.",
+              "type": "string"
+            },
+            "maximum_amount": {
+              "required": false,
+              "description": "Maximum order amount allowed when using the coupon.",
+              "type": "string"
+            },
+            "email_restrictions": {
+              "required": false,
+              "description": "List of email addresses that can use this coupon.",
+              "type": "array",
+              "items": {
+                "type": "string"
+              }
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/coupons/batch"
+      }
+    },
+    "/wc/v2/customers/(?P<customer_id>[\\d]+)/downloads": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "customer_id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/customers": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "registered_date"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "email": {
+              "required": false,
+              "description": "Limit result set to resources with a specific email.",
+              "type": "string"
+            },
+            "role": {
+              "required": false,
+              "default": "customer",
+              "enum": [
+                "all",
+                "administrator",
+                "editor",
+                "author",
+                "contributor",
+                "subscriber",
+                "customer",
+                "shop_manager"
+              ],
+              "description": "Limit result set to resources with a specific role.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "email": {
+              "required": true,
+              "description": "New user email address.",
+              "type": "string"
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name.",
+              "type": "string"
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name.",
+              "type": "string"
+            },
+            "username": {
+              "required": false,
+              "description": "New user username.",
+              "type": "string"
+            },
+            "password": {
+              "required": false,
+              "description": "New user password.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "List of billing address data.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "List of shipping address data.",
+              "type": "object"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/customers"
+      }
+    },
+    "/wc/v2/customers/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "email": {
+              "required": false,
+              "description": "The email address for the customer.",
+              "type": "string"
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name.",
+              "type": "string"
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name.",
+              "type": "string"
+            },
+            "username": {
+              "required": false,
+              "description": "Customer login name.",
+              "type": "string"
+            },
+            "password": {
+              "required": false,
+              "description": "Customer password.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "List of billing address data.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "List of shipping address data.",
+              "type": "object"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            },
+            "reassign": {
+              "required": false,
+              "default": 0,
+              "description": "ID to reassign posts to.",
+              "type": "integer"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/customers/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "email": {
+              "required": false,
+              "description": "The email address for the customer.",
+              "type": "string"
+            },
+            "first_name": {
+              "required": false,
+              "description": "Customer first name.",
+              "type": "string"
+            },
+            "last_name": {
+              "required": false,
+              "description": "Customer last name.",
+              "type": "string"
+            },
+            "username": {
+              "required": false,
+              "description": "Customer login name.",
+              "type": "string"
+            },
+            "password": {
+              "required": false,
+              "description": "Customer password.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "List of billing address data.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "List of shipping address data.",
+              "type": "object"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/customers/batch"
+      }
+    },
+    "/wc/v2/orders/(?P<order_id>[\\d]+)/notes": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "customer",
+                "internal"
+              ],
+              "description": "Limit result to customers or internal notes.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "note": {
+              "required": true,
+              "description": "Order note content.",
+              "type": "string"
+            },
+            "customer_note": {
+              "required": false,
+              "default": false,
+              "description": "If true, the note will be shown to customers and they will be notified. If false, the note will be for admin reference only.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/orders/(?P<order_id>[\\d]+)/notes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/orders/(?P<order_id>[\\d]+)/refunds": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "dp": {
+              "required": false,
+              "default": 2,
+              "description": "Number of decimal points to use in each resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "amount": {
+              "required": false,
+              "description": "Refund amount.",
+              "type": "string"
+            },
+            "reason": {
+              "required": false,
+              "description": "Reason for refund.",
+              "type": "string"
+            },
+            "refunded_by": {
+              "required": false,
+              "description": "User ID of user who created the refund.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "api_refund": {
+              "required": false,
+              "default": true,
+              "description": "When true, the payment gateway API is used to generate the refund.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/orders/(?P<order_id>[\\d]+)/refunds/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "order_id": {
+              "required": false,
+              "description": "The order ID.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": true,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/orders": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Limit result set to orders assigned a specific status.",
+              "type": "string"
+            },
+            "customer": {
+              "required": false,
+              "description": "Limit result set to orders assigned a specific customer.",
+              "type": "integer"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to orders assigned a specific product.",
+              "type": "integer"
+            },
+            "dp": {
+              "required": false,
+              "default": 2,
+              "description": "Number of decimal points to use in each resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID.",
+              "type": "integer"
+            },
+            "status": {
+              "required": false,
+              "default": "pending",
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status.",
+              "type": "string"
+            },
+            "currency": {
+              "required": false,
+              "default": "USD",
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "IRT",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format.",
+              "type": "string"
+            },
+            "customer_id": {
+              "required": false,
+              "default": 0,
+              "description": "User ID who owns the order. 0 for guests.",
+              "type": "integer"
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address.",
+              "type": "object"
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID.",
+              "type": "string"
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title.",
+              "type": "string"
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID.",
+              "type": "string"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "method_title": {
+                    "description": "Shipping method name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "method_id": {
+                    "description": "Shipping method ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Fee name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_status": {
+                    "description": "Tax status of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "enum": [
+                      "taxable",
+                      "none"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "code": {
+                    "description": "Coupon code.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount": {
+                    "description": "Discount total.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount_tax": {
+                    "description": "Discount total tax.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "set_paid": {
+              "required": false,
+              "default": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/orders"
+      }
+    },
+    "/wc/v2/orders/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID.",
+              "type": "integer"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status.",
+              "type": "string"
+            },
+            "currency": {
+              "required": false,
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "IRT",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format.",
+              "type": "string"
+            },
+            "customer_id": {
+              "required": false,
+              "description": "User ID who owns the order. 0 for guests.",
+              "type": "integer"
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address.",
+              "type": "object"
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID.",
+              "type": "string"
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title.",
+              "type": "string"
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID.",
+              "type": "string"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "method_title": {
+                    "description": "Shipping method name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "method_id": {
+                    "description": "Shipping method ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Fee name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_status": {
+                    "description": "Tax status of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "enum": [
+                      "taxable",
+                      "none"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "code": {
+                    "description": "Coupon code.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount": {
+                    "description": "Discount total.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount_tax": {
+                    "description": "Discount total tax.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "set_paid": {
+              "required": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items.",
+              "type": "boolean"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/orders/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "parent_id": {
+              "required": false,
+              "description": "Parent order ID.",
+              "type": "integer"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "pending",
+                "processing",
+                "on-hold",
+                "completed",
+                "cancelled",
+                "refunded",
+                "failed"
+              ],
+              "description": "Order status.",
+              "type": "string"
+            },
+            "currency": {
+              "required": false,
+              "enum": [
+                "AED",
+                "AFN",
+                "ALL",
+                "AMD",
+                "ANG",
+                "AOA",
+                "ARS",
+                "AUD",
+                "AWG",
+                "AZN",
+                "BAM",
+                "BBD",
+                "BDT",
+                "BGN",
+                "BHD",
+                "BIF",
+                "BMD",
+                "BND",
+                "BOB",
+                "BRL",
+                "BSD",
+                "BTC",
+                "BTN",
+                "BWP",
+                "BYR",
+                "BZD",
+                "CAD",
+                "CDF",
+                "CHF",
+                "CLP",
+                "CNY",
+                "COP",
+                "CRC",
+                "CUC",
+                "CUP",
+                "CVE",
+                "CZK",
+                "DJF",
+                "DKK",
+                "DOP",
+                "DZD",
+                "EGP",
+                "ERN",
+                "ETB",
+                "EUR",
+                "FJD",
+                "FKP",
+                "GBP",
+                "GEL",
+                "GGP",
+                "GHS",
+                "GIP",
+                "GMD",
+                "GNF",
+                "GTQ",
+                "GYD",
+                "HKD",
+                "HNL",
+                "HRK",
+                "HTG",
+                "HUF",
+                "IDR",
+                "ILS",
+                "IMP",
+                "INR",
+                "IQD",
+                "IRR",
+                "IRT",
+                "ISK",
+                "JEP",
+                "JMD",
+                "JOD",
+                "JPY",
+                "KES",
+                "KGS",
+                "KHR",
+                "KMF",
+                "KPW",
+                "KRW",
+                "KWD",
+                "KYD",
+                "KZT",
+                "LAK",
+                "LBP",
+                "LKR",
+                "LRD",
+                "LSL",
+                "LYD",
+                "MAD",
+                "MDL",
+                "MGA",
+                "MKD",
+                "MMK",
+                "MNT",
+                "MOP",
+                "MRO",
+                "MUR",
+                "MVR",
+                "MWK",
+                "MXN",
+                "MYR",
+                "MZN",
+                "NAD",
+                "NGN",
+                "NIO",
+                "NOK",
+                "NPR",
+                "NZD",
+                "OMR",
+                "PAB",
+                "PEN",
+                "PGK",
+                "PHP",
+                "PKR",
+                "PLN",
+                "PRB",
+                "PYG",
+                "QAR",
+                "RON",
+                "RSD",
+                "RUB",
+                "RWF",
+                "SAR",
+                "SBD",
+                "SCR",
+                "SDG",
+                "SEK",
+                "SGD",
+                "SHP",
+                "SLL",
+                "SOS",
+                "SRD",
+                "SSP",
+                "STD",
+                "SYP",
+                "SZL",
+                "THB",
+                "TJS",
+                "TMT",
+                "TND",
+                "TOP",
+                "TRY",
+                "TTD",
+                "TWD",
+                "TZS",
+                "UAH",
+                "UGX",
+                "USD",
+                "UYU",
+                "UZS",
+                "VEF",
+                "VND",
+                "VUV",
+                "WST",
+                "XAF",
+                "XCD",
+                "XOF",
+                "XPF",
+                "YER",
+                "ZAR",
+                "ZMW"
+              ],
+              "description": "Currency the order was created with, in ISO format.",
+              "type": "string"
+            },
+            "customer_id": {
+              "required": false,
+              "description": "User ID who owns the order. 0 for guests.",
+              "type": "integer"
+            },
+            "customer_note": {
+              "required": false,
+              "description": "Note left by customer during checkout.",
+              "type": "string"
+            },
+            "billing": {
+              "required": false,
+              "description": "Billing address.",
+              "type": "object"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Shipping address.",
+              "type": "object"
+            },
+            "payment_method": {
+              "required": false,
+              "description": "Payment method ID.",
+              "type": "string"
+            },
+            "payment_method_title": {
+              "required": false,
+              "description": "Payment method title.",
+              "type": "string"
+            },
+            "transaction_id": {
+              "required": false,
+              "description": "Unique transaction ID.",
+              "type": "string"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "line_items": {
+              "required": false,
+              "description": "Line items data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Product name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "product_id": {
+                    "description": "Product ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation_id": {
+                    "description": "Variation ID, if applicable.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "quantity": {
+                    "description": "Quantity ordered.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of product.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal": {
+                    "description": "Line subtotal (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "subtotal_tax": {
+                    "description": "Line subtotal tax (before discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  },
+                  "sku": {
+                    "description": "Product SKU.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "price": {
+                    "description": "Product price.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "shipping_lines": {
+              "required": false,
+              "description": "Shipping lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "method_title": {
+                    "description": "Shipping method name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "method_id": {
+                    "description": "Shipping method ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "fee_lines": {
+              "required": false,
+              "description": "Fee lines data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "Fee name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_class": {
+                    "description": "Tax class of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "tax_status": {
+                    "description": "Tax status of fee.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "enum": [
+                      "taxable",
+                      "none"
+                    ]
+                  },
+                  "total": {
+                    "description": "Line total (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "total_tax": {
+                    "description": "Line total tax (after discounts).",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "taxes": {
+                    "description": "Line taxes.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true,
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Tax rate ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "total": {
+                          "description": "Tax total.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "subtotal": {
+                          "description": "Tax subtotal.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        }
+                      }
+                    }
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "coupon_lines": {
+              "required": false,
+              "description": "Coupons line data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Item ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "code": {
+                    "description": "Coupon code.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount": {
+                    "description": "Discount total.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "discount_tax": {
+                    "description": "Discount total tax.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "meta_data": {
+                    "description": "Meta data.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "id": {
+                          "description": "Meta ID.",
+                          "type": "integer",
+                          "context": [
+                            "view",
+                            "edit"
+                          ],
+                          "readonly": true
+                        },
+                        "key": {
+                          "description": "Meta key.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        },
+                        "value": {
+                          "description": "Meta value.",
+                          "type": "string",
+                          "context": [
+                            "view",
+                            "edit"
+                          ]
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            },
+            "set_paid": {
+              "required": false,
+              "description": "Define if the order is paid. It will set the status to processing and reduce stock items.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/orders/batch"
+      }
+    },
+    "/wc/v2/products/attributes/(?P<attribute_id>[\\d]+)/terms": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "parent": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific parent.",
+              "type": "integer"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/attributes/(?P<attribute_id>[\\d]+)/terms/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Term name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/attributes/(?P<attribute_id>[\\d]+)/terms/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "attribute_id": {
+              "required": false,
+              "description": "Unique identifier for the attribute of the terms.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Term name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/attributes": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "default": "select",
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute.",
+              "type": "string"
+            },
+            "order_by": {
+              "required": false,
+              "default": "menu_order",
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order.",
+              "type": "string"
+            },
+            "has_archives": {
+              "required": false,
+              "default": false,
+              "description": "Enable/Disable attribute archives.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/attributes"
+      }
+    },
+    "/wc/v2/products/attributes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Attribute name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute.",
+              "type": "string"
+            },
+            "order_by": {
+              "required": false,
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order.",
+              "type": "string"
+            },
+            "has_archives": {
+              "required": false,
+              "description": "Enable/Disable attribute archives.",
+              "type": "boolean"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": true,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/attributes/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Attribute name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "select",
+                "text"
+              ],
+              "description": "Type of attribute.",
+              "type": "string"
+            },
+            "order_by": {
+              "required": false,
+              "enum": [
+                "menu_order",
+                "name",
+                "name_num",
+                "id"
+              ],
+              "description": "Default sort order.",
+              "type": "string"
+            },
+            "has_archives": {
+              "required": false,
+              "description": "Enable/Disable attribute archives.",
+              "type": "boolean"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/attributes/batch"
+      }
+    },
+    "/wc/v2/products/categories": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "parent": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific parent.",
+              "type": "integer"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "description": "The ID for the parent of the resource.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "display": {
+              "required": false,
+              "default": "default",
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Image data.",
+              "type": "object"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/categories"
+      }
+    },
+    "/wc/v2/products/categories/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Category name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "description": "The ID for the parent of the resource.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "display": {
+              "required": false,
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Image data.",
+              "type": "object"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/categories/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Category name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "description": "The ID for the parent of the resource.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            },
+            "display": {
+              "required": false,
+              "enum": [
+                "default",
+                "products",
+                "subcategories",
+                "both"
+              ],
+              "description": "Category archive display type.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Image data.",
+              "type": "object"
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort the resource.",
+              "type": "integer"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/categories/batch"
+      }
+    },
+    "/wc/v2/products/(?P<product_id>[\\d]+)/reviews": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "review": {
+              "required": true,
+              "description": "Review content.",
+              "type": "string"
+            },
+            "date_created": {
+              "required": false,
+              "description": "The date the review was created, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_created_gmt": {
+              "required": false,
+              "description": "The date the review was created, as GMT.",
+              "type": "date-time"
+            },
+            "rating": {
+              "required": false,
+              "description": "Review rating (0 to 5).",
+              "type": "integer"
+            },
+            "name": {
+              "required": true,
+              "description": "Name of the reviewer.",
+              "type": "string"
+            },
+            "email": {
+              "required": true,
+              "description": "Email of the reviewer.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/(?P<product_id>[\\d]+)/reviews/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "review": {
+              "required": false,
+              "description": "The content of the review.",
+              "type": "string"
+            },
+            "date_created": {
+              "required": false,
+              "description": "The date the review was created, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_created_gmt": {
+              "required": false,
+              "description": "The date the review was created, as GMT.",
+              "type": "date-time"
+            },
+            "rating": {
+              "required": false,
+              "description": "Review rating (0 to 5).",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Reviewer name.",
+              "type": "string"
+            },
+            "email": {
+              "required": false,
+              "description": "Reviewer email.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/(?P<product_id>[\\d]+)/reviews/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "review": {
+              "required": false,
+              "description": "The content of the review.",
+              "type": "string"
+            },
+            "date_created": {
+              "required": false,
+              "description": "The date the review was created, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_created_gmt": {
+              "required": false,
+              "description": "The date the review was created, as GMT.",
+              "type": "date-time"
+            },
+            "rating": {
+              "required": false,
+              "description": "Review rating (0 to 5).",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Reviewer name.",
+              "type": "string"
+            },
+            "email": {
+              "required": false,
+              "description": "Reviewer email.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/shipping_classes": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+      }
+    },
+    "/wc/v2/products/shipping_classes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Shipping class name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/shipping_classes/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Shipping class name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/shipping_classes/batch"
+      }
+    },
+    "/wc/v2/products/tags": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "name",
+              "enum": [
+                "id",
+                "include",
+                "name",
+                "slug",
+                "term_group",
+                "description",
+                "count"
+              ],
+              "description": "Sort collection by resource attribute.",
+              "type": "string"
+            },
+            "hide_empty": {
+              "required": false,
+              "default": false,
+              "description": "Whether to hide resources not assigned to any products.",
+              "type": "boolean"
+            },
+            "product": {
+              "required": false,
+              "description": "Limit result set to resources assigned to a specific product.",
+              "type": "integer"
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to resources with a specific slug.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Name for the resource.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/tags"
+      }
+    },
+    "/wc/v2/products/tags/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Tag name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/tags/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Tag name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "An alphanumeric identifier for the resource unique to its type.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "HTML description of the resource.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/tags/batch"
+      }
+    },
+    "/wc/v2/products": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to products with a specific slug.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Limit result set to products assigned a specific status.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Limit result set to products assigned a specific type.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Limit result set to products with a specific SKU.",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Limit result set to featured products.",
+              "type": "boolean"
+            },
+            "category": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific category ID.",
+              "type": "string"
+            },
+            "tag": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific tag ID.",
+              "type": "string"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific shipping class ID.",
+              "type": "string"
+            },
+            "attribute": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute.",
+              "type": "string"
+            },
+            "attribute_term": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute term ID (required an assigned attribute).",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Limit result set to products with a specific tax class.",
+              "type": "string"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Limit result set to products in stock or out of stock.",
+              "type": "boolean"
+            },
+            "on_sale": {
+              "required": false,
+              "description": "Limit result set to products on sale.",
+              "type": "boolean"
+            },
+            "min_price": {
+              "required": false,
+              "description": "Limit result set to products based on a minimum price.",
+              "type": "string"
+            },
+            "max_price": {
+              "required": false,
+              "description": "Limit result set to products based on a maximum price.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "default": "simple",
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "publish",
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status).",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "default": false,
+              "description": "Featured product.",
+              "type": "boolean"
+            },
+            "catalog_visibility": {
+              "required": false,
+              "default": "visible",
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Product description.",
+              "type": "string"
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "virtual": {
+              "required": false,
+              "default": false,
+              "description": "If the product is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "default": false,
+              "description": "If the product is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "default": -1,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "default": -1,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products.",
+              "type": "string"
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products.",
+              "type": "string"
+            },
+            "tax_status": {
+              "required": false,
+              "default": "taxable",
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "default": false,
+              "description": "Stock management at product level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "default": true,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "default": "no",
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "sold_individually": {
+              "required": false,
+              "default": false,
+              "description": "Allow one item to be bought in a single order.",
+              "type": "boolean"
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "reviews_allowed": {
+              "required": false,
+              "default": true,
+              "description": "Allow reviews.",
+              "type": "boolean"
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID.",
+              "type": "integer"
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase.",
+              "type": "string"
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Category ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Category name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Category slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Tag ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Tag name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Tag slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "images": {
+              "required": false,
+              "description": "List of images.",
+              "type": "object",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Image ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "date_created": {
+                    "description": "The date the image was created, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_created_gmt": {
+                    "description": "The date the image was created, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified": {
+                    "description": "The date the image was last modified, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified_gmt": {
+                    "description": "The date the image was last modified, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "src": {
+                    "description": "Image URL.",
+                    "type": "string",
+                    "format": "uri",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Image name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "alt": {
+                    "description": "Image alternative text.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Image position. 0 means that the image is featured.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Attribute position.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "visible": {
+                    "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation": {
+                    "description": "Define if the attribute can be used as variation.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "options": {
+                    "description": "List of available term names of the attribute.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products"
+      }
+    },
+    "/wc/v2/products/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Product name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status).",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Featured product.",
+              "type": "boolean"
+            },
+            "catalog_visibility": {
+              "required": false,
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Product description.",
+              "type": "string"
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the product is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the product is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products.",
+              "type": "string"
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products.",
+              "type": "string"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at product level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "sold_individually": {
+              "required": false,
+              "description": "Allow one item to be bought in a single order.",
+              "type": "boolean"
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "reviews_allowed": {
+              "required": false,
+              "description": "Allow reviews.",
+              "type": "boolean"
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID.",
+              "type": "integer"
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase.",
+              "type": "string"
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Category ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Category name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Category slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Tag ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Tag name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Tag slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "images": {
+              "required": false,
+              "description": "List of images.",
+              "type": "object",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Image ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "date_created": {
+                    "description": "The date the image was created, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_created_gmt": {
+                    "description": "The date the image was created, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified": {
+                    "description": "The date the image was last modified, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified_gmt": {
+                    "description": "The date the image was last modified, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "src": {
+                    "description": "Image URL.",
+                    "type": "string",
+                    "format": "uri",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Image name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "alt": {
+                    "description": "Image alternative text.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Image position. 0 means that the image is featured.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Attribute position.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "visible": {
+                    "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation": {
+                    "description": "Define if the attribute can be used as variation.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "options": {
+                    "description": "List of available term names of the attribute.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "Product name.",
+              "type": "string"
+            },
+            "slug": {
+              "required": false,
+              "description": "Product slug.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Product type.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Product status (post status).",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Featured product.",
+              "type": "boolean"
+            },
+            "catalog_visibility": {
+              "required": false,
+              "enum": [
+                "visible",
+                "catalog",
+                "search",
+                "hidden"
+              ],
+              "description": "Catalog visibility.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Product description.",
+              "type": "string"
+            },
+            "short_description": {
+              "required": false,
+              "description": "Product short description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Product regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Product sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the product is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the product is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "external_url": {
+              "required": false,
+              "description": "Product external URL. Only for external products.",
+              "type": "string"
+            },
+            "button_text": {
+              "required": false,
+              "description": "Product external button text. Only for external products.",
+              "type": "string"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at product level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the product is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "sold_individually": {
+              "required": false,
+              "description": "Allow one item to be bought in a single order.",
+              "type": "boolean"
+            },
+            "weight": {
+              "required": false,
+              "description": "Product weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Product dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "reviews_allowed": {
+              "required": false,
+              "description": "Allow reviews.",
+              "type": "boolean"
+            },
+            "upsell_ids": {
+              "required": false,
+              "description": "List of up-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "cross_sell_ids": {
+              "required": false,
+              "description": "List of cross-sell products IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_id": {
+              "required": false,
+              "description": "Product parent ID.",
+              "type": "integer"
+            },
+            "purchase_note": {
+              "required": false,
+              "description": "Optional note to send the customer after purchase.",
+              "type": "string"
+            },
+            "categories": {
+              "required": false,
+              "description": "List of categories.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Category ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Category name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Category slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "tags": {
+              "required": false,
+              "description": "List of tags.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Tag ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Tag name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "slug": {
+                    "description": "Tag slug.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  }
+                }
+              }
+            },
+            "images": {
+              "required": false,
+              "description": "List of images.",
+              "type": "object",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Image ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "date_created": {
+                    "description": "The date the image was created, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_created_gmt": {
+                    "description": "The date the image was created, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified": {
+                    "description": "The date the image was last modified, in the site's timezone.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "date_modified_gmt": {
+                    "description": "The date the image was last modified, as GMT.",
+                    "type": "date-time",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "src": {
+                    "description": "Image URL.",
+                    "type": "string",
+                    "format": "uri",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Image name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "alt": {
+                    "description": "Image alternative text.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Image position. 0 means that the image is featured.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "position": {
+                    "description": "Attribute position.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "visible": {
+                    "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "variation": {
+                    "description": "Define if the attribute can be used as variation.",
+                    "type": "boolean",
+                    "default": false,
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "options": {
+                    "description": "List of available term names of the attribute.",
+                    "type": "array",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "default_attributes": {
+              "required": false,
+              "description": "Defaults variation attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/products/batch"
+      }
+    },
+    "/wc/v2/products/(?P<product_id>[\\d]+)/variations": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "parent": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to those of particular parent IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "parent_exclude": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to all items except those of a particular parent ID.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "slug": {
+              "required": false,
+              "description": "Limit result set to products with a specific slug.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "any",
+              "enum": [
+                "any",
+                "draft",
+                "pending",
+                "private",
+                "publish"
+              ],
+              "description": "Limit result set to products assigned a specific status.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "simple",
+                "grouped",
+                "external",
+                "variable"
+              ],
+              "description": "Limit result set to products assigned a specific type.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Limit result set to products with a specific SKU.",
+              "type": "string"
+            },
+            "featured": {
+              "required": false,
+              "description": "Limit result set to featured products.",
+              "type": "boolean"
+            },
+            "category": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific category ID.",
+              "type": "string"
+            },
+            "tag": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific tag ID.",
+              "type": "string"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Limit result set to products assigned a specific shipping class ID.",
+              "type": "string"
+            },
+            "attribute": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute.",
+              "type": "string"
+            },
+            "attribute_term": {
+              "required": false,
+              "description": "Limit result set to products with a specific attribute term ID (required an assigned attribute).",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Limit result set to products with a specific tax class.",
+              "type": "string"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Limit result set to products in stock or out of stock.",
+              "type": "boolean"
+            },
+            "on_sale": {
+              "required": false,
+              "description": "Limit result set to products on sale.",
+              "type": "boolean"
+            },
+            "min_price": {
+              "required": false,
+              "description": "Limit result set to products based on a minimum price.",
+              "type": "string"
+            },
+            "max_price": {
+              "required": false,
+              "description": "Limit result set to products based on a maximum price.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "Variation description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Variation regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Variation sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "visible": {
+              "required": false,
+              "default": true,
+              "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+              "type": "boolean"
+            },
+            "virtual": {
+              "required": false,
+              "default": false,
+              "description": "If the variation is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "default": false,
+              "description": "If the variation is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "default": -1,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "default": -1,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "tax_status": {
+              "required": false,
+              "default": "taxable",
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "default": false,
+              "description": "Stock management at variation level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "default": true,
+              "description": "Controls whether or not the variation is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "default": "no",
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "weight": {
+              "required": false,
+              "description": "Variation weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Variation dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Variation image data.",
+              "type": "object"
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/(?P<product_id>[\\d]+)/variations/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "Variation description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Variation regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Variation sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "visible": {
+              "required": false,
+              "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+              "type": "boolean"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the variation is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the variation is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at variation level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the variation is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "weight": {
+              "required": false,
+              "description": "Variation weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Variation dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Variation image data.",
+              "type": "object"
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the variation.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/products/(?P<product_id>[\\d]+)/variations/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "product_id": {
+              "required": false,
+              "description": "Unique identifier for the variable product.",
+              "type": "integer"
+            },
+            "description": {
+              "required": false,
+              "description": "Variation description.",
+              "type": "string"
+            },
+            "sku": {
+              "required": false,
+              "description": "Unique identifier.",
+              "type": "string"
+            },
+            "regular_price": {
+              "required": false,
+              "description": "Variation regular price.",
+              "type": "string"
+            },
+            "sale_price": {
+              "required": false,
+              "description": "Variation sale price.",
+              "type": "string"
+            },
+            "date_on_sale_from": {
+              "required": false,
+              "description": "Start date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_from_gmt": {
+              "required": false,
+              "description": "Start date of sale price, as GMT.",
+              "type": "date-time"
+            },
+            "date_on_sale_to": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "date_on_sale_to_gmt": {
+              "required": false,
+              "description": "End date of sale price, in the site's timezone.",
+              "type": "date-time"
+            },
+            "visible": {
+              "required": false,
+              "description": "Define if the attribute is visible on the \"Additional information\" tab in the product's page.",
+              "type": "boolean"
+            },
+            "virtual": {
+              "required": false,
+              "description": "If the variation is virtual.",
+              "type": "boolean"
+            },
+            "downloadable": {
+              "required": false,
+              "description": "If the variation is downloadable.",
+              "type": "boolean"
+            },
+            "downloads": {
+              "required": false,
+              "description": "List of downloadable files.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "File ID.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "name": {
+                    "description": "File name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "file": {
+                    "description": "File URL.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "download_limit": {
+              "required": false,
+              "description": "Number of times downloadable files can be downloaded after purchase.",
+              "type": "integer"
+            },
+            "download_expiry": {
+              "required": false,
+              "description": "Number of days until access to downloadable files expires.",
+              "type": "integer"
+            },
+            "tax_status": {
+              "required": false,
+              "enum": [
+                "taxable",
+                "shipping",
+                "none"
+              ],
+              "description": "Tax status.",
+              "type": "string"
+            },
+            "tax_class": {
+              "required": false,
+              "description": "Tax class.",
+              "type": "string"
+            },
+            "manage_stock": {
+              "required": false,
+              "description": "Stock management at variation level.",
+              "type": "boolean"
+            },
+            "stock_quantity": {
+              "required": false,
+              "description": "Stock quantity.",
+              "type": "integer"
+            },
+            "in_stock": {
+              "required": false,
+              "description": "Controls whether or not the variation is listed as \"in stock\" or \"out of stock\" on the frontend.",
+              "type": "boolean"
+            },
+            "backorders": {
+              "required": false,
+              "enum": [
+                "no",
+                "notify",
+                "yes"
+              ],
+              "description": "If managing stock, this controls if backorders are allowed.",
+              "type": "string"
+            },
+            "weight": {
+              "required": false,
+              "description": "Variation weight (kg).",
+              "type": "string"
+            },
+            "dimensions": {
+              "required": false,
+              "description": "Variation dimensions.",
+              "type": "object"
+            },
+            "shipping_class": {
+              "required": false,
+              "description": "Shipping class slug.",
+              "type": "string"
+            },
+            "image": {
+              "required": false,
+              "description": "Variation image data.",
+              "type": "object"
+            },
+            "attributes": {
+              "required": false,
+              "description": "List of attributes.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Attribute ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "name": {
+                    "description": "Attribute name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "option": {
+                    "description": "Selected attribute term name.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            },
+            "menu_order": {
+              "required": false,
+              "description": "Menu order, used to custom sort products.",
+              "type": "integer"
+            },
+            "meta_data": {
+              "required": false,
+              "description": "Meta data.",
+              "type": "array",
+              "items": {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "description": "Meta ID.",
+                    "type": "integer",
+                    "context": [
+                      "view",
+                      "edit"
+                    ],
+                    "readonly": true
+                  },
+                  "key": {
+                    "description": "Meta key.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  },
+                  "value": {
+                    "description": "Meta value.",
+                    "type": "string",
+                    "context": [
+                      "view",
+                      "edit"
+                    ]
+                  }
+                }
+              }
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/reports/sales": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "period": {
+              "required": false,
+              "enum": [
+                "week",
+                "month",
+                "last_month",
+                "year"
+              ],
+              "description": "Report period.",
+              "type": "string"
+            },
+            "date_min": {
+              "required": false,
+              "description": "Return sales for a specific start date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            },
+            "date_max": {
+              "required": false,
+              "description": "Return sales for a specific end date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/reports/sales"
+      }
+    },
+    "/wc/v2/reports/top_sellers": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "period": {
+              "required": false,
+              "enum": [
+                "week",
+                "month",
+                "last_month",
+                "year"
+              ],
+              "description": "Report period.",
+              "type": "string"
+            },
+            "date_min": {
+              "required": false,
+              "description": "Return sales for a specific start date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            },
+            "date_max": {
+              "required": false,
+              "description": "Return sales for a specific end date, the date need to be in the YYYY-MM-DD format.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/reports/top_sellers"
+      }
+    },
+    "/wc/v2/reports": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/reports"
+      }
+    },
+    "/wc/v2/settings": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": []
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/settings"
+      }
+    },
+    "/wc/v2/settings/(?P<group_id>[\\w-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/settings/(?P<group_id>[\\w-]+)/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            },
+            "value": {
+              "required": false,
+              "description": "Setting value.",
+              "type": "mixed"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/settings/(?P<group_id>[\\w-]+)/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "group": {
+              "required": false,
+              "description": "Settings group ID.",
+              "type": "string"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "value": {
+              "required": false,
+              "description": "Setting value.",
+              "type": "mixed"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/shipping/zones": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": []
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Shipping zone name.",
+              "type": "string"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping zone order.",
+              "type": "integer"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/shipping/zones"
+      }
+    },
+    "/wc/v2/shipping/zones/(?P<id>[\\d-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "Shipping zone name.",
+              "type": "string"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping zone order.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/shipping/zones/(?P<id>[\\d-]+)/locations": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique ID for the resource.",
+              "type": "integer"
+            },
+            "code": {
+              "required": false,
+              "description": "Shipping zone location code.",
+              "type": "string"
+            },
+            "type": {
+              "required": false,
+              "enum": [
+                "postcode",
+                "state",
+                "country",
+                "continent"
+              ],
+              "description": "Shipping zone location type.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/shipping/zones/(?P<zone_id>[\\d-]+)/methods": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping method sort order.",
+              "type": "integer"
+            },
+            "enabled": {
+              "required": false,
+              "description": "Shipping method enabled status.",
+              "type": "boolean"
+            },
+            "settings": {
+              "required": false,
+              "description": "Shipping method settings.",
+              "type": "object"
+            },
+            "method_id": {
+              "required": true,
+              "description": "Shipping method ID."
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/shipping/zones/(?P<zone_id>[\\d-]+)/methods/(?P<instance_id>[\\d-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "instance_id": {
+              "required": false,
+              "description": "Unique ID for the instance.",
+              "type": "integer"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "instance_id": {
+              "required": false,
+              "description": "Unique ID for the instance.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "description": "Shipping method sort order.",
+              "type": "integer"
+            },
+            "enabled": {
+              "required": false,
+              "description": "Shipping method enabled status.",
+              "type": "boolean"
+            },
+            "settings": {
+              "required": false,
+              "description": "Shipping method settings.",
+              "type": "object"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "zone_id": {
+              "required": false,
+              "description": "Unique ID for the zone.",
+              "type": "integer"
+            },
+            "instance_id": {
+              "required": false,
+              "description": "Unique ID for the instance.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Whether to bypass trash and force deletion.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/taxes/classes": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": true,
+              "description": "Tax class name.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/taxes/classes"
+      }
+    },
+    "/wc/v2/taxes/classes/(?P<slug>\\w[\\w\\s\\-]*)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "slug": {
+              "required": false,
+              "description": "Unique slug for the resource.",
+              "type": "string"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/taxes": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "asc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "order",
+              "enum": [
+                "id",
+                "order"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Sort by tax class.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code.",
+              "type": "string"
+            },
+            "state": {
+              "required": false,
+              "description": "State code.",
+              "type": "string"
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode / ZIP.",
+              "type": "string"
+            },
+            "city": {
+              "required": false,
+              "description": "City name.",
+              "type": "string"
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name.",
+              "type": "string"
+            },
+            "priority": {
+              "required": false,
+              "default": 1,
+              "description": "Tax priority.",
+              "type": "integer"
+            },
+            "compound": {
+              "required": false,
+              "default": false,
+              "description": "Whether or not this is a compound rate.",
+              "type": "boolean"
+            },
+            "shipping": {
+              "required": false,
+              "default": true,
+              "description": "Whether or not this tax rate also gets applied to shipping.",
+              "type": "boolean"
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries.",
+              "type": "integer"
+            },
+            "class": {
+              "required": false,
+              "default": "standard",
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/taxes"
+      }
+    },
+    "/wc/v2/taxes/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code.",
+              "type": "string"
+            },
+            "state": {
+              "required": false,
+              "description": "State code.",
+              "type": "string"
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode / ZIP.",
+              "type": "string"
+            },
+            "city": {
+              "required": false,
+              "description": "City name.",
+              "type": "string"
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name.",
+              "type": "string"
+            },
+            "priority": {
+              "required": false,
+              "description": "Tax priority.",
+              "type": "integer"
+            },
+            "compound": {
+              "required": false,
+              "description": "Whether or not this is a compound rate.",
+              "type": "boolean"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Whether or not this tax rate also gets applied to shipping.",
+              "type": "boolean"
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries.",
+              "type": "integer"
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/taxes/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "country": {
+              "required": false,
+              "description": "Country ISO 3166 code.",
+              "type": "string"
+            },
+            "state": {
+              "required": false,
+              "description": "State code.",
+              "type": "string"
+            },
+            "postcode": {
+              "required": false,
+              "description": "Postcode / ZIP.",
+              "type": "string"
+            },
+            "city": {
+              "required": false,
+              "description": "City name.",
+              "type": "string"
+            },
+            "rate": {
+              "required": false,
+              "description": "Tax rate.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tax rate name.",
+              "type": "string"
+            },
+            "priority": {
+              "required": false,
+              "description": "Tax priority.",
+              "type": "integer"
+            },
+            "compound": {
+              "required": false,
+              "description": "Whether or not this is a compound rate.",
+              "type": "boolean"
+            },
+            "shipping": {
+              "required": false,
+              "description": "Whether or not this tax rate also gets applied to shipping.",
+              "type": "boolean"
+            },
+            "order": {
+              "required": false,
+              "description": "Indicates the order that will appear in queries.",
+              "type": "integer"
+            },
+            "class": {
+              "required": false,
+              "enum": [
+                "standard",
+                "reduced-rate",
+                "zero-rate"
+              ],
+              "description": "Tax class.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/taxes/batch"
+      }
+    },
+    "/wc/v2/webhooks/(?P<webhook_id>[\\d]+)/deliveries": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "webhook_id": {
+              "required": false,
+              "description": "Unique identifier for the webhook.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/webhooks/(?P<webhook_id>[\\d]+)/deliveries/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "webhook_id": {
+              "required": false,
+              "description": "Unique identifier for the webhook.",
+              "type": "integer"
+            },
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/webhooks": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            },
+            "page": {
+              "required": false,
+              "default": 1,
+              "description": "Current page of the collection.",
+              "type": "integer"
+            },
+            "per_page": {
+              "required": false,
+              "default": 10,
+              "description": "Maximum number of items to be returned in result set.",
+              "type": "integer"
+            },
+            "search": {
+              "required": false,
+              "description": "Limit results to those matching a string.",
+              "type": "string"
+            },
+            "after": {
+              "required": false,
+              "description": "Limit response to resources published after a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "before": {
+              "required": false,
+              "description": "Limit response to resources published before a given ISO8601 compliant date.",
+              "type": "string"
+            },
+            "exclude": {
+              "required": false,
+              "default": [],
+              "description": "Ensure result set excludes specific IDs.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "include": {
+              "required": false,
+              "default": [],
+              "description": "Limit result set to specific ids.",
+              "type": "array",
+              "items": {
+                "type": "integer"
+              }
+            },
+            "offset": {
+              "required": false,
+              "description": "Offset the result set by a specific number of items.",
+              "type": "integer"
+            },
+            "order": {
+              "required": false,
+              "default": "desc",
+              "enum": [
+                "asc",
+                "desc"
+              ],
+              "description": "Order sort attribute ascending or descending.",
+              "type": "string"
+            },
+            "orderby": {
+              "required": false,
+              "default": "date",
+              "enum": [
+                "date",
+                "id",
+                "include",
+                "title",
+                "slug"
+              ],
+              "description": "Sort collection by object attribute.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "all",
+              "enum": [
+                "all",
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Limit result set to webhooks assigned a specific status.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "default": "active",
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status.",
+              "type": "string"
+            },
+            "topic": {
+              "required": true,
+              "description": "Webhook topic.",
+              "type": "string"
+            },
+            "secret": {
+              "required": true,
+              "description": "Webhook secret.",
+              "type": "string"
+            },
+            "delivery_url": {
+              "required": true,
+              "description": "Webhook delivery URL.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/webhooks"
+      }
+    },
+    "/wc/v2/webhooks/(?P<id>[\\d]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH",
+        "DELETE"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status.",
+              "type": "string"
+            },
+            "topic": {
+              "required": false,
+              "description": "Webhook topic.",
+              "type": "string"
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "DELETE"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "integer"
+            },
+            "force": {
+              "required": false,
+              "default": false,
+              "description": "Required to be true, as resource does not support trashing.",
+              "type": "boolean"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/webhooks/batch": {
+      "namespace": "wc/v2",
+      "methods": [
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "name": {
+              "required": false,
+              "description": "A friendly name for the webhook.",
+              "type": "string"
+            },
+            "status": {
+              "required": false,
+              "enum": [
+                "active",
+                "paused",
+                "disabled"
+              ],
+              "description": "Webhook status.",
+              "type": "string"
+            },
+            "topic": {
+              "required": false,
+              "description": "Webhook topic.",
+              "type": "string"
+            },
+            "secret": {
+              "required": false,
+              "description": "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/webhooks/batch"
+      }
+    },
+    "/wc/v2/system_status": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/system_status"
+      }
+    },
+    "/wc/v2/system_status/tools": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/system_status/tools"
+      }
+    },
+    "/wc/v2/system_status/tools/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "A unique identifier for the tool.",
+              "type": "string"
+            },
+            "name": {
+              "required": false,
+              "description": "Tool name.",
+              "type": "string"
+            },
+            "action": {
+              "required": false,
+              "description": "What running the tool will do.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Tool description.",
+              "type": "string"
+            },
+            "success": {
+              "required": false,
+              "description": "Did the tool run successfully?",
+              "type": "boolean"
+            },
+            "message": {
+              "required": false,
+              "description": "Tool return message.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/shipping_methods": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/shipping_methods"
+      }
+    },
+    "/wc/v2/shipping_methods/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ]
+    },
+    "/wc/v2/payment_gateways": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        }
+      ],
+      "_links": {
+        "self": "https://example.com/wp-json/wc/v2/payment_gateways"
+      }
+    },
+    "/wc/v2/payment_gateways/(?P<id>[\\w-]+)": {
+      "namespace": "wc/v2",
+      "methods": [
+        "GET",
+        "POST",
+        "PUT",
+        "PATCH"
+      ],
+      "endpoints": [
+        {
+          "methods": [
+            "GET"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "context": {
+              "required": false,
+              "default": "view",
+              "enum": [
+                "view",
+                "edit"
+              ],
+              "description": "Scope under which the request is made; determines fields present in response.",
+              "type": "string"
+            }
+          }
+        },
+        {
+          "methods": [
+            "POST",
+            "PUT",
+            "PATCH"
+          ],
+          "args": {
+            "id": {
+              "required": false,
+              "description": "Unique identifier for the resource.",
+              "type": "string"
+            },
+            "title": {
+              "required": false,
+              "description": "Payment gateway title on checkout.",
+              "type": "string"
+            },
+            "description": {
+              "required": false,
+              "description": "Payment gateway description on checkout.",
+              "type": "string"
+            },
+            "order": {
+              "required": false,
+              "description": "Payment gateway sort order.",
+              "type": "integer"
+            },
+            "enabled": {
+              "required": false,
+              "description": "Payment gateway enabled status.",
+              "type": "boolean"
+            },
+            "settings": {
+              "required": false,
+              "description": "Payment gateway settings.",
+              "type": "object"
+            }
+          }
+        }
+      ]
+    }
+  },
+  "_links": {
+    "up": [
+      {
+        "href": "https://example.com/wp-json/"
+      }
+    ]
+  }
+}
+

Coupons

+

The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.

+

Coupon properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the object. read-only
codestringCoupon code. mandatory
amountstringThe amount of discount. Should always be numeric, even if setting a percentage.
date_createddate-timeThe date the coupon was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the coupon was created, as GMT. read-only
date_modifieddate-timeThe date the coupon was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the coupon was last modified, as GMT. read-only
discount_typestringDetermines the type of discount that will be applied. Options: percent, fixed_cart and fixed_product. Default is fixed_cart.
descriptionstringCoupon description.
date_expiresstringThe date the coupon expires, in the site's timezone.
date_expires_gmtstringThe date the coupon expires, as GMT.
usage_countintegerNumber of times the coupon has been used already. read-only
individual_usebooleanIf true, the coupon can only be used individually. Other applied coupons will be removed from the cart. Default is false.
product_idsarrayList of product IDs the coupon can be used on.
excluded_product_idsarrayList of product IDs the coupon cannot be used on.
usage_limitintegerHow many times the coupon can be used in total.
usage_limit_per_userintegerHow many times the coupon can be used per customer.
limit_usage_to_x_itemsintegerMax number of items in the cart the coupon can be applied to.
free_shippingbooleanIf true and if the free shipping method requires a coupon, this coupon will enable free shipping. Default is false.
product_categoriesarrayList of category IDs the coupon applies to.
excluded_product_categoriesarrayList of category IDs the coupon does not apply to.
exclude_sale_itemsbooleanIf true, this coupon will not be applied to items that have sale prices. Default is false.
minimum_amountstringMinimum order amount that needs to be in the cart before coupon applies.
maximum_amountstringMaximum order amount allowed when using the coupon.
email_restrictionsarrayList of email addresses that can use this coupon.
used_byarrayList of user IDs (or guest email addresses) that have used the coupon. read-only
meta_dataarrayMeta data. See Coupon - Meta data properties
+

Coupon - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a coupon

+

This API helps you to create a new coupon.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/coupons
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/coupons \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "code": "10off",
+  "discount_type": "percent",
+  "amount": "10",
+  "individual_use": true,
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00"
+}'
+
const data = {
+  code: "10off",
+  discount_type: "percent",
+  amount: "10",
+  individual_use: true,
+  exclude_sale_items: true,
+  minimum_amount: "100.00"
+};
+
+WooCommerce.post("coupons", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'code' => '10off',
+    'discount_type' => 'percent',
+    'amount' => '10',
+    'individual_use' => true,
+    'exclude_sale_items' => true,
+    'minimum_amount' => '100.00'
+];
+
+print_r($woocommerce->post('coupons', $data));
+?>
+
data = {
+    "code": "10off",
+    "discount_type": "percent",
+    "amount": "10",
+    "individual_use": True,
+    "exclude_sale_items": True,
+    "minimum_amount": "100.00"
+}
+
+print(wcapi.post("coupons", data).json())
+
data = {
+  code: "10off",
+  discount_type: "percent",
+  amount: "10",
+  individual_use: true,
+  exclude_sale_items: true,
+  minimum_amount: "100.00"
+}
+
+woocommerce.post("coupons", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "10.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:23:00",
+  "date_modified_gmt": "2017-03-21T18:23:00",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons"
+      }
+    ]
+  }
+}
+

Retrieve a coupon

+

This API lets you retrieve and view a specific coupon by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/coupons/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/coupons/719 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("coupons/719")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('coupons/719')); ?>
+
print(wcapi.get("coupons/719").json())
+
woocommerce.get("coupons/719").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "10.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:23:00",
+  "date_modified_gmt": "2017-03-21T18:23:00",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons"
+      }
+    ]
+  }
+}
+

List all coupons

+

This API helps you to list all the coupons that have been created.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/coupons
+
+
+
curl https://example.com/wp-json/wc/v2/coupons \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("coupons")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('coupons')); ?>
+
print(wcapi.get("coupons").json())
+
woocommerce.get("coupons").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 720,
+    "code": "free shipping",
+    "amount": "0.00",
+    "date_created": "2017-03-21T15:25:02",
+    "date_created_gmt": "2017-03-21T18:25:02",
+    "date_modified": "2017-03-21T15:25:02",
+    "date_modified_gmt": "2017-03-21T18:25:02",
+    "discount_type": "fixed_cart",
+    "description": "",
+    "date_expires": null,
+    "date_expires_gmt": null,
+    "usage_count": 0,
+    "individual_use": true,
+    "product_ids": [],
+    "excluded_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": null,
+    "free_shipping": true,
+    "product_categories": [],
+    "excluded_product_categories": [],
+    "exclude_sale_items": false,
+    "minimum_amount": "0.00",
+    "maximum_amount": "0.00",
+    "email_restrictions": [],
+    "used_by": [],
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/coupons/720"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/coupons"
+        }
+      ]
+    }
+  },
+  {
+    "id": 719,
+    "code": "10off",
+    "amount": "10.00",
+    "date_created": "2017-03-21T15:23:00",
+    "date_created_gmt": "2017-03-21T18:23:00",
+    "date_modified": "2017-03-21T15:23:00",
+    "date_modified_gmt": "2017-03-21T18:23:00",
+    "discount_type": "percent",
+    "description": "",
+    "date_expires": null,
+    "date_expires_gmt": null,
+    "usage_count": 0,
+    "individual_use": true,
+    "product_ids": [],
+    "excluded_product_ids": [],
+    "usage_limit": null,
+    "usage_limit_per_user": null,
+    "limit_usage_to_x_items": null,
+    "free_shipping": false,
+    "product_categories": [],
+    "excluded_product_categories": [],
+    "exclude_sale_items": true,
+    "minimum_amount": "100.00",
+    "maximum_amount": "0.00",
+    "email_restrictions": [],
+    "used_by": [],
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/coupons/719"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/coupons"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
codestringLimit result set to resources with a specific code.
+

Update a coupon

+

This API lets you make changes to a coupon.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/coupons/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/coupons/719 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "amount": "5"
+}'
+
const data = {
+  amount: "5"
+};
+
+WooCommerce.put("coupons/719", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'amount' => '5'
+];
+
+print_r($woocommerce->put('coupons/719', $data)); 
+?>
+
data = {
+    "amount": "5"
+}
+
+print(wcapi.put("coupons/719", data).json())
+
data = {
+  amount: "5"
+}
+
+woocommerce.put("coupons/719", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "5.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:26:16",
+  "date_modified_gmt": "2017-03-21T18:26:16",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons"
+      }
+    ]
+  }
+}
+

Delete a coupon

+

This API helps you delete a coupon.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/coupons/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/coupons/719?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("coupons/719", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('coupons/719', ['force' => true])); ?>
+
print(wcapi.delete("coupons/719", params={"force": True}).json())
+
woocommerce.delete("coupons/719", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 719,
+  "code": "10off",
+  "amount": "5.00",
+  "date_created": "2017-03-21T15:23:00",
+  "date_created_gmt": "2017-03-21T18:23:00",
+  "date_modified": "2017-03-21T15:26:16",
+  "date_modified_gmt": "2017-03-21T18:26:16",
+  "discount_type": "percent",
+  "description": "",
+  "date_expires": null,
+  "date_expires_gmt": null,
+  "usage_count": 0,
+  "individual_use": true,
+  "product_ids": [],
+  "excluded_product_ids": [],
+  "usage_limit": null,
+  "usage_limit_per_user": null,
+  "limit_usage_to_x_items": null,
+  "free_shipping": false,
+  "product_categories": [],
+  "excluded_product_categories": [],
+  "exclude_sale_items": true,
+  "minimum_amount": "100.00",
+  "maximum_amount": "0.00",
+  "email_restrictions": [],
+  "used_by": [],
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons/719"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/coupons"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the coupon, Default is false.
+

Batch update coupons

+

This API helps you to batch create, update and delete multiple coupons.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/coupons/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/coupons/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "code": "20off",
+      "discount_type": "percent",
+      "amount": "20",
+      "individual_use": true,
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00"
+    },
+    {
+      "code": "30off",
+      "discount_type": "percent",
+      "amount": "30",
+      "individual_use": true,
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00"
+    }
+  ],
+  "update": [
+    {
+      "id": 719,
+      "minimum_amount": "50.00"
+    }
+  ],
+  "delete": [
+    720
+  ]
+}'
+
const data = {
+  create: [
+    {
+      code: "20off",
+      discount_type: "percent",
+      amount: "20",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    },
+    {
+      code: "30off",
+      discount_type: "percent",
+      amount: "30",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    }
+  ],
+  update: [
+    {
+      id: 719,
+      minimum_amount: "50.00"
+    }
+  ],
+  delete: [
+    720
+  ]
+};
+
+WooCommerce.post("customers/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'code' => '20off',
+            'discount_type' => 'percent',
+            'amount' => '20',
+            'individual_use' => true,
+            'exclude_sale_items' => true,
+            'minimum_amount' => '100.00'
+        ],
+        [
+            'code' => '30off',
+            'discount_type' => 'percent',
+            'amount' => '30',
+            'individual_use' => true,
+            'exclude_sale_items' => true,
+            'minimum_amount' => '100.00'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 719,
+            'minimum_amount' => '50.00'
+        ]
+    ],
+    'delete' => [
+        720
+    ]
+];
+
+print_r($woocommerce->post('customers/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "code": "20off",
+            "discount_type": "percent",
+            "amount": "20",
+            "individual_use": True,
+            "exclude_sale_items": True,
+            "minimum_amount": "100.00"
+        },
+        {
+            "code": "30off",
+            "discount_type": "percent",
+            "amount": "30",
+            "individual_use": True,
+            "exclude_sale_items": True,
+            "minimum_amount": "100.00"
+        }
+    ],
+    "update": [
+        {
+            "id": 719,
+            "minimum_amount": "50.00"
+        }
+    ],
+    "delete": [
+        720
+    ]
+}
+
+print(wcapi.post("customers/batch", data).json())
+
data = {
+  create: [
+    {
+      code: "20off",
+      discount_type: "percent",
+      amount: "20",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    },
+    {
+      code: "30off",
+      discount_type: "percent",
+      amount: "30",
+      individual_use: true,
+      exclude_sale_items: true,
+      minimum_amount: "100.00"
+    }
+  ],
+  update: [
+    {
+      id: 719,
+      minimum_amount: "50.00"
+    }
+  ],
+  delete: [
+    720
+  ]
+}
+
+woocommerce.post("customers/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 721,
+      "code": "20off",
+      "amount": "20.00",
+      "date_created": "2017-03-21T15:27:29",
+      "date_created_gmt": "2017-03-21T18:27:29",
+      "date_modified": "2017-03-21T15:27:29",
+      "date_modified_gmt": "2017-03-21T18:27:29",
+      "discount_type": "percent",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons/721"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons"
+          }
+        ]
+      }
+    },
+    {
+      "id": 722,
+      "code": "30off",
+      "amount": "30.00",
+      "date_created": "2017-03-21T15:27:31",
+      "date_created_gmt": "2017-03-21T18:27:31",
+      "date_modified": "2017-03-21T15:27:31",
+      "date_modified_gmt": "2017-03-21T18:27:31",
+      "discount_type": "percent",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "100.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons/722"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 719,
+      "code": "10off",
+      "amount": "5.00",
+      "date_created": "2017-03-21T15:23:00",
+      "date_created_gmt": "2017-03-21T18:23:00",
+      "date_modified": "2017-03-21T15:27:32",
+      "date_modified_gmt": "2017-03-21T18:27:32",
+      "discount_type": "percent",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": false,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": true,
+      "minimum_amount": "50.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons/719"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 720,
+      "code": "free shipping",
+      "amount": "0.00",
+      "date_created": "2017-03-21T15:25:02",
+      "date_created_gmt": "2017-03-21T18:25:02",
+      "date_modified": "2017-03-21T15:25:02",
+      "date_modified_gmt": "2017-03-21T18:25:02",
+      "discount_type": "fixed_cart",
+      "description": "",
+      "date_expires": null,
+      "date_expires_gmt": null,
+      "usage_count": 0,
+      "individual_use": true,
+      "product_ids": [],
+      "excluded_product_ids": [],
+      "usage_limit": null,
+      "usage_limit_per_user": null,
+      "limit_usage_to_x_items": null,
+      "free_shipping": true,
+      "product_categories": [],
+      "excluded_product_categories": [],
+      "exclude_sale_items": false,
+      "minimum_amount": "0.00",
+      "maximum_amount": "0.00",
+      "email_restrictions": [],
+      "used_by": [],
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons/720"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/coupons"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Customers

+

The customer API allows you to create, view, update, and delete individual, or a batch, of customers.

+

Customer properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the customer was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order was created, as GMT. read-only
date_modifieddate-timeThe date the customer was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the customer was last modified, as GMT. read-only
emailstringThe email address for the customer. mandatory
first_namestringCustomer first name.
last_namestringCustomer last name.
rolestringCustomer role. read-only
usernamestringCustomer login name.
passwordstringCustomer password. write-only
billingobjectList of billing address data. See Customer - Billing properties
shippingobjectList of shipping address data. See Customer - Shipping properties
is_paying_customerboolIs the customer a paying customer? read-only
orders_countintegerQuantity of orders made by the customer. read-only
total_spentstringTotal amount spent. read-only
avatar_urlstringAvatar URL. read-only
meta_dataarrayMeta data. See Customer - Meta data properties
+

Customer - Billing properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringISO code of the country.
emailstringEmail address.
phonestringPhone number.
+

Customer - Shipping properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringISO code of the country.
+

Customer - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a customer

+

This API helps you to create a new customer.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/customers
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/customers \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  }
+}'
+
const data = {
+  email: "john.doe@example.com",
+  first_name: "John",
+  last_name: "Doe",
+  username: "john.doe",
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  }
+};
+
+WooCommerce.post("customers", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'email' => 'john.doe@example.com',
+    'first_name' => 'John',
+    'last_name' => 'Doe',
+    'username' => 'john.doe',
+    'billing' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'company' => '',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US',
+        'email' => 'john.doe@example.com',
+        'phone' => '(555) 555-5555'
+    ],
+    'shipping' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'company' => '',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US'
+    ]
+];
+
+print_r($woocommerce->post('customers', $data));
+?>
+
data = {
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "username": "john.doe",
+    "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+    },
+    "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+    }
+}
+
+print(wcapi.post("customers", data).json())
+
data = {
+  email: "john.doe@example.com",
+  first_name: "John",
+  last_name: "Doe",
+  username: "john.doe",
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    company: "",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  }
+}
+
+woocommerce.post("customers", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:09:30",
+  "date_modified_gmt": "2017-03-21T19:09:30",
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "orders_count": 0,
+  "total_spent": "0.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers"
+      }
+    ]
+  }
+}
+

Retrieve a customer

+

This API lets you retrieve and view a specific customer by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/customers/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/customers/25 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers/25")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers/25')); ?>
+
print(wcapi.get("customers/25").json())
+
woocommerce.get("customers/25").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:09:30",
+  "date_modified_gmt": "2017-03-21T19:09:30",
+  "email": "john.doe@example.com",
+  "first_name": "John",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "orders_count": 0,
+  "total_spent": "0.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers"
+      }
+    ]
+  }
+}
+

List all customers

+

This API helps you to view all the customers.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/customers
+
+
+
curl https://example.com/wp-json/wc/v2/customers \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers')); ?>
+
print(wcapi.get("customers").json())
+
woocommerce.get("customers").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 26,
+    "date_created": "2017-03-21T16:11:14",
+    "date_created_gmt": "2017-03-21T19:11:14",
+    "date_modified": "2017-03-21T16:11:16",
+    "date_modified_gmt": "2017-03-21T19:11:16",
+    "email": "joao.silva@example.com",
+    "first_name": "João",
+    "last_name": "Silva",
+    "role": "customer",
+    "username": "joao.silva",
+    "billing": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR",
+      "email": "joao.silva@example.com",
+      "phone": "(55) 5555-5555"
+    },
+    "shipping": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR"
+    },
+    "is_paying_customer": false,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/be7b5febff88a2d947c3289e90cdf017?s=96",
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/customers/26"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/customers"
+        }
+      ]
+    }
+  },
+  {
+    "id": 25,
+    "date_created": "2017-03-21T16:09:28",
+    "date_created_gmt": "2017-03-21T19:09:28",
+    "date_modified": "2017-03-21T16:09:30",
+    "date_modified_gmt": "2017-03-21T19:09:30",
+    "email": "john.doe@example.com",
+    "first_name": "John",
+    "last_name": "Doe",
+    "role": "customer",
+    "username": "john.doe",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "is_paying_customer": false,
+    "orders_count": 0,
+    "total_spent": "0.00",
+    "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/customers/25"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/customers"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific IDs.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by object attribute. Options: id, include, name and registered_date. Default is name.
emailstringLimit result set to resources with a specific email.
rolestringLimit result set to resources with a specific role. Options: all, administrator, editor, author, contributor, subscriber, customer and shop_manager. Default is customer.
+

Update a customer

+

This API lets you make changes to a customer.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/customers/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/customers/25 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "first_name": "James",
+  "billing": {
+    "first_name": "James"
+  },
+  "shipping": {
+    "first_name": "James"
+  }
+}'
+
const data = {
+  first_name: "James",
+  billing: {
+    first_name: "James"
+  },
+  shipping: {
+    first_name: "James"
+  }
+};
+
+WooCommerce.put("customers/25", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'first_name' => 'James',
+    'billing' => [
+        'first_name' => 'James'
+    ],
+    'shipping' => [
+        'first_name' => 'James'
+    ]
+];
+
+print_r($woocommerce->put('customers/25', $data));
+?>
+
data = {
+    "first_name": "James",
+    "billing": {
+        "first_name": "James"
+    },
+    "shipping": {
+        "first_name": "James"
+    }
+}
+
+print(wcapi.put("customers/25", data).json())
+
data = {
+  first_name: "James",
+  billing: {
+    first_name: "James"
+  },
+  shipping: {
+    first_name: "James"
+  }
+}
+
+woocommerce.put("customers/25", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:12:28",
+  "date_modified_gmt": "2017-03-21T19:12:28",
+  "email": "john.doe@example.com",
+  "first_name": "James",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "orders_count": 0,
+  "total_spent": "0.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers"
+      }
+    ]
+  }
+}
+

Delete a customer

+

This API helps you delete a customer.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/customers/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/customers/25?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("customers/25", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('customers/25', ['force' => true])); ?>
+
print(wcapi.delete("customers/25", params={"force": True}).json())
+
woocommerce.delete("customers/25", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 25,
+  "date_created": "2017-03-21T16:09:28",
+  "date_created_gmt": "2017-03-21T19:09:28",
+  "date_modified": "2017-03-21T16:12:28",
+  "date_modified_gmt": "2017-03-21T19:12:28",
+  "email": "john.doe@example.com",
+  "first_name": "James",
+  "last_name": "Doe",
+  "role": "customer",
+  "username": "john.doe",
+  "billing": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "James",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "is_paying_customer": false,
+  "orders_count": 0,
+  "total_spent": "0.00",
+  "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers/25"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/customers"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
reassignintegerUser ID to reassign posts to.
+

Batch update customers

+

This API helps you to batch create, update and delete multiple customers.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/customers/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/customers/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "username": "john.doe2",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      }
+    },
+    {
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "username": "joao.silva2",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 26,
+      "billing": {
+        "phone": "(11) 1111-1111"
+      }
+    }
+  ],
+  "delete": [
+    25
+  ]
+}'
+
const data = {
+  create: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ],
+  update: [
+    {
+      id: 26,
+      billing: {
+        phone: "(11) 1111-1111"
+      }
+    }
+  ],
+  delete: [
+    11
+  ]
+};
+
+WooCommerce.post("customers/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'create' => [
+        [
+            'email' => 'john.doe2@example.com',
+            'first_name' => 'John',
+            'last_name' => 'Doe',
+            'username' => 'john.doe2',
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'company' => '',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'company' => '',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ]
+        ],
+        [
+            'email' => 'joao.silva2@example.com',
+            'first_name' => 'João',
+            'last_name' => 'Silva',
+            'username' => 'joao.silva2',
+            'billing' => [
+                'first_name' => 'João',
+                'last_name' => 'Silva',
+                'company' => '',
+                'address_1' => 'Av. Brasil, 432',
+                'address_2' => '',
+                'city' => 'Rio de Janeiro',
+                'state' => 'RJ',
+                'postcode' => '12345-000',
+                'country' => 'BR',
+                'email' => 'joao.silva@example.com',
+                'phone' => '(55) 5555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'João',
+                'last_name' => 'Silva',
+                'company' => '',
+                'address_1' => 'Av. Brasil, 432',
+                'address_2' => '',
+                'city' => 'Rio de Janeiro',
+                'state' => 'RJ',
+                'postcode' => '12345-000',
+                'country' => 'BR'
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 26,
+            'billing' => [
+                'phone' => '(11) 1111-1111'
+            ]
+        ]
+    ],
+    'delete' => [
+        25
+    ]
+];
+
+print_r($woocommerce->post('customers/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "email": "john.doe2@example.com",
+            "first_name": "John",
+            "last_name": "Doe",
+            "username": "john.doe2",
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "company": "",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            }
+        },
+        {
+            "email": "joao.silva2@example.com",
+            "first_name": "João",
+            "last_name": "Silva",
+            "username": "joao.silva2",
+            "billing": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR",
+                "email": "joao.silva@example.com",
+                "phone": "(55) 5555-5555"
+            },
+            "shipping": {
+                "first_name": "João",
+                "last_name": "Silva",
+                "company": "",
+                "address_1": "Av. Brasil, 432",
+                "address_2": "",
+                "city": "Rio de Janeiro",
+                "state": "RJ",
+                "postcode": "12345-000",
+                "country": "BR"
+            }
+        }
+    ],
+    "update": [
+        {
+            "id": 26,
+            "billing": {
+                "phone": "(11) 1111-1111"
+            }
+        }
+    ],
+    "delete": [
+        25
+    ]
+}
+
+print(wcapi.post("customers/batch", data).json())
+
data = {
+  create: [
+    {
+      email: "john.doe2@example.com",
+      first_name: "John",
+      last_name: "Doe",
+      username: "john.doe2",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        company: "",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      }
+    },
+    {
+      email: "joao.silva2@example.com",
+      first_name: "João",
+      last_name: "Silva",
+      username: "joao.silva2",
+      billing: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR",
+        email: "joao.silva@example.com",
+        phone: "(55) 5555-5555"
+      },
+      shipping: {
+        first_name: "João",
+        last_name: "Silva",
+        company: "",
+        address_1: "Av. Brasil, 432",
+        address_2: "",
+        city: "Rio de Janeiro",
+        state: "RJ",
+        postcode: "12345-000",
+        country: "BR"
+      }
+    }
+  ],
+  update: [
+    {
+      id: 26,
+      billing: {
+        phone: "(11) 1111-1111"
+      }
+    }
+  ],
+  delete: [
+    25
+  ]
+}
+
+woocommerce.post("customers/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 27,
+      "date_created": "2017-03-21T16:13:58",
+      "date_created_gmt": "2017-03-21T19:13:58",
+      "date_modified": "2017-03-21T16:13:59",
+      "date_modified_gmt": "2017-03-21T19:13:59",
+      "email": "john.doe2@example.com",
+      "first_name": "John",
+      "last_name": "Doe",
+      "role": "customer",
+      "username": "john.doe2",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "is_paying_customer": false,
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/6ad0b094bac53a85bb282ccdb3958279?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers/27"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers"
+          }
+        ]
+      }
+    },
+    {
+      "id": 28,
+      "date_created": "2017-03-21T16:14:00",
+      "date_created_gmt": "2017-03-21T19:14:00",
+      "date_modified": "2017-03-21T16:14:01",
+      "date_modified_gmt": "2017-03-21T19:14:01",
+      "email": "joao.silva2@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "role": "customer",
+      "username": "joao.silva2",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(55) 5555-5555"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "is_paying_customer": false,
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/ea9ad095f2970f27cbff07e7f5e99453?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers/28"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 26,
+      "date_created": "2017-03-21T16:11:14",
+      "date_created_gmt": "2017-03-21T19:11:14",
+      "date_modified": "2017-03-21T16:14:03",
+      "date_modified_gmt": "2017-03-21T19:14:03",
+      "email": "joao.silva@example.com",
+      "first_name": "João",
+      "last_name": "Silva",
+      "role": "customer",
+      "username": "joao.silva",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(11) 1111-1111"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "is_paying_customer": false,
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/be7b5febff88a2d947c3289e90cdf017?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers/26"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 25,
+      "date_created": "2017-03-21T16:09:28",
+      "date_created_gmt": "2017-03-21T19:09:28",
+      "date_modified": "2017-03-21T16:12:28",
+      "date_modified_gmt": "2017-03-21T19:12:28",
+      "email": "john.doe@example.com",
+      "first_name": "James",
+      "last_name": "Doe",
+      "role": "customer",
+      "username": "john.doe",
+      "billing": {
+        "first_name": "James",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "James",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "is_paying_customer": false,
+      "orders_count": 0,
+      "total_spent": "0.00",
+      "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96",
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers/25"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve customer downloads

+

This API lets you retrieve customer downloads permissions.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/customers/<id>/downloads
+
+
+
curl https://example.com/wp-json/wc/v2/customers/26/downloads \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("customers/26/downloads")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('customers/26/downloads')); ?>
+
print(wcapi.get("customers/26/downloads").json())
+
woocommerce.get("customers/26/downloads").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "download_id": "91447fd1849316bbc89dfb7e986a6006",
+    "download_url": "https://example.com/?download_file=87&order=wc_order_58d17c18352&email=joao.silva%40example.com&key=91447fd1849316bbc89dfb7e986a6006",
+    "product_id": 87,
+    "product_name": "Woo Album #2",
+    "download_name": "Woo Album #2 &ndash; Song 2",
+    "order_id": 723,
+    "order_key": "wc_order_58d17c18352",
+    "downloads_remaining": "3",
+    "access_expires": "never",
+    "access_expires_gmt": "never",
+    "file": {
+      "name": "Song 2",
+      "file": "http://example.com/wp-content/uploads/woocommerce_uploads/2013/06/Song.mp3"
+    },
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/customers/26/downloads"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/87"
+        }
+      ],
+      "order": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ]
+    }
+  }
+]
+

Customer downloads properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
download_idstringDownload ID (MD5). read-only
download_urlstringDownload file URL. read-only
product_idintegerDownloadable product ID. read-only
product_namestringProduct name. read-only
download_namestringDownloadable file name. read-only
order_idintegerOrder ID. read-only
order_keystringOrder key. read-only
downloads_remainingstringNumber of downloads remaining. read-only
access_expiresstringThe date when download access expires, in the site's timezone. read-only
access_expires_gmtstringThe date when download access expires, as GMT. read-only
fileobjectFile details. read-only See Customers downloads - File properties
+

Customer downloads - File properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringFile name. read-only
filestringFile URL. read-only
+

Orders

+

The orders API allows you to create, view, update, and delete individual, or a batch, of orders.

+

Order properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
parent_idintegerParent order ID.
numberstringOrder number. read-only
order_keystringOrder key. read-only
created_viastringShows where the order was created. read-only
versionstringVersion of WooCommerce which last updated the order. read-only
statusstringOrder status. Options: pending, processing, on-hold, completed, cancelled, refunded, failed and trash. Default is pending.
currencystringCurrency the order was created with, in ISO format. Options: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTC, BTN, BWP, BYR, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, IRT, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PRB, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR and ZMW. Default is USD.
date_createddate-timeThe date the order was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order was created, as GMT. read-only
date_modifieddate-timeThe date the order was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the order was last modified, as GMT. read-only
discount_totalstringTotal discount amount for the order. read-only
discount_taxstringTotal discount tax amount for the order. read-only
shipping_totalstringTotal shipping amount for the order. read-only
shipping_taxstringTotal shipping tax amount for the order. read-only
cart_taxstringSum of line item taxes only. read-only
totalstringGrand total. read-only
total_taxstringSum of all taxes. read-only
prices_include_taxbooleanTrue the prices included tax during checkout. read-only
customer_idintegerUser ID who owns the order. 0 for guests. Default is 0.
customer_ip_addressstringCustomer's IP address. read-only
customer_user_agentstringUser agent of the customer. read-only
customer_notestringNote left by customer during checkout.
billingobjectBilling address. See Order - Billing properties
shippingobjectShipping address. See Order - Shipping properties
payment_methodstringPayment method ID.
payment_method_titlestringPayment method title.
transaction_idstringUnique transaction ID.
date_paiddate-timeThe date the order was paid, in the site's timezone. read-only
date_paid_gmtdate-timeThe date the order was paid, as GMT. read-only
date_completeddate-timeThe date the order was completed, in the site's timezone. read-only
date_completed_gmtdate-timeThe date the order was completed, as GMT. read-only
cart_hashstringMD5 hash of cart items to ensure orders are not modified. read-only
meta_dataarrayMeta data. See Order - Meta data properties
line_itemsarrayLine items data. See Order - Line items properties
tax_linesarrayTax lines data. See Order - Tax lines properties read-only
shipping_linesarrayShipping lines data. See Order - Shipping lines properties
fee_linesarrayFee lines data. See Order - Fee lines properties
coupon_linesarrayCoupons line data. See Order - Coupon lines properties
refundsarrayList of refunds. See Order - Refunds properties read-only
set_paidbooleanDefine if the order is paid. It will set the status to processing and reduce stock items. Default is false. write-only
+

Order - Billing properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringCountry code in ISO 3166-1 alpha-2 format.
emailstringEmail address.
phonestringPhone number.
+

Order - Shipping properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
first_namestringFirst name.
last_namestringLast name.
companystringCompany name.
address_1stringAddress line 1
address_2stringAddress line 2
citystringCity name.
statestringISO code or name of the state, province or district.
postcodestringPostal code.
countrystringCountry code in ISO 3166-1 alpha-2 format.
+

Order - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Order - Line items properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringProduct name.
product_idintegerProduct ID.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classintegerTax class of product.
subtotalstringLine subtotal (before discounts).
subtotal_taxstringLine subtotal tax (before discounts). read-only
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order - Taxes properties read-only
meta_dataarrayMeta data. See Order - Meta data properties
skustringProduct SKU. read-only
pricestringProduct price. read-only
+

Order - Tax lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
rate_codestringTax rate code. read-only
rate_idstringTax rate ID. read-only
labelstringTax rate label. read-only
compoundbooleanShow if is a compound tax rate. read-only
tax_totalstringTax total (not including shipping taxes). read-only
shipping_tax_totalstringShipping tax total. read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Shipping lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
method_titlestringShipping method name.
method_idstringShipping method ID.
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order - Taxes properties read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Fee lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringFee name.
tax_classstringTax class of fee.
tax_statusstringTax status of fee. Options: taxable and none.
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order - Taxes properties read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Coupon lines properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
codestringCoupon code.
discountstringDiscount total.
discount_taxstringDiscount total tax. read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Order - Refunds properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerRefund ID. read-only
reasonstringRefund reason. read-only
totalstringRefund total. read-only
+

Order - Taxes properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
rate_codestringTax rate code. read-only
rate_idstringTax rate ID. read-only
labelstringTax rate label. read-only
compoundbooleanShow if is a compound tax rate. read-only
tax_totalstringTax total (not including shipping taxes). read-only
shipping_tax_totalstringShipping tax total. read-only
meta_dataarrayMeta data. See Order - Meta data properties
+

Create an order

+

This API helps you to create a new order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/orders
+
+
+ +
+

Example of create a paid order:

+
+
curl -X POST https://example.com/wp-json/wc/v2/orders \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "set_paid": true,
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "line_items": [
+    {
+      "product_id": 93,
+      "quantity": 2
+    },
+    {
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1
+    }
+  ],
+  "shipping_lines": [
+    {
+      "method_id": "flat_rate",
+      "method_title": "Flat Rate",
+      "total": "10.00"
+    }
+  ]
+}'
+
const data = {
+  payment_method: "bacs",
+  payment_method_title: "Direct Bank Transfer",
+  set_paid: true,
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  },
+  line_items: [
+    {
+      product_id: 93,
+      quantity: 2
+    },
+    {
+      product_id: 22,
+      variation_id: 23,
+      quantity: 1
+    }
+  ],
+  shipping_lines: [
+    {
+      method_id: "flat_rate",
+      method_title: "Flat Rate",
+      total: "10.00"
+    }
+  ]
+};
+
+WooCommerce.post("orders", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'payment_method' => 'bacs',
+    'payment_method_title' => 'Direct Bank Transfer',
+    'set_paid' => true,
+    'billing' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US',
+        'email' => 'john.doe@example.com',
+        'phone' => '(555) 555-5555'
+    ],
+    'shipping' => [
+        'first_name' => 'John',
+        'last_name' => 'Doe',
+        'address_1' => '969 Market',
+        'address_2' => '',
+        'city' => 'San Francisco',
+        'state' => 'CA',
+        'postcode' => '94103',
+        'country' => 'US'
+    ],
+    'line_items' => [
+        [
+            'product_id' => 93,
+            'quantity' => 2
+        ],
+        [
+            'product_id' => 22,
+            'variation_id' => 23,
+            'quantity' => 1
+        ]
+    ],
+    'shipping_lines' => [
+        [
+            'method_id' => 'flat_rate',
+            'method_title' => 'Flat Rate',
+            'total' => '10.00'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('orders', $data));
+?>
+
data = {
+    "payment_method": "bacs",
+    "payment_method_title": "Direct Bank Transfer",
+    "set_paid": True,
+    "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+    },
+    "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+    },
+    "line_items": [
+        {
+            "product_id": 93,
+            "quantity": 2
+        },
+        {
+            "product_id": 22,
+            "variation_id": 23,
+            "quantity": 1
+        }
+    ],
+    "shipping_lines": [
+        {
+            "method_id": "flat_rate",
+            "method_title": "Flat Rate",
+            "total": '10.00'
+        }
+    ]
+}
+
+print(wcapi.post("orders", data).json())
+
data = {
+  payment_method: "bacs",
+  payment_method_title: "Direct Bank Transfer",
+  set_paid: true,
+  billing: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US",
+    email: "john.doe@example.com",
+    phone: "(555) 555-5555"
+  },
+  shipping: {
+    first_name: "John",
+    last_name: "Doe",
+    address_1: "969 Market",
+    address_2: "",
+    city: "San Francisco",
+    state: "CA",
+    postcode: "94103",
+    country: "US"
+  },
+  line_items: [
+    {
+      product_id: 93,
+      quantity: 2
+    },
+    {
+      product_id: 22,
+      variation_id: 23,
+      quantity: 1
+    }
+  ],
+  shipping_lines: [
+    {
+      method_id: "flat_rate",
+      method_title: "Flat Rate",
+      total: '10.00'
+    }
+  ]
+}
+
+woocommerce.post("orders", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "processing",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:28:08",
+  "date_modified_gmt": "2017-03-22T19:28:08",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": null,
+  "date_completed_gmt": null,
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders"
+      }
+    ]
+  }
+}
+

Retrieve an order

+

This API lets you retrieve and view a specific order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/orders/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/orders/727 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/727")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/727')); ?>
+
print(wcapi.get("orders/727").json())
+
woocommerce.get("orders/727").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "processing",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:28:08",
+  "date_modified_gmt": "2017-03-22T19:28:08",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": null,
+  "date_completed_gmt": null,
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
dpstringNumber of decimal points to use in each resource.
+

List all orders

+

This API helps you to view all the orders.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/orders
+
+
+
curl https://example.com/wp-json/wc/v2/orders \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders')); ?>
+
print(wcapi.get("orders").json())
+
woocommerce.get("orders").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 727,
+    "parent_id": 0,
+    "number": "727",
+    "order_key": "wc_order_58d2d042d1d",
+    "created_via": "rest-api",
+    "version": "3.0.0",
+    "status": "processing",
+    "currency": "USD",
+    "date_created": "2017-03-22T16:28:02",
+    "date_created_gmt": "2017-03-22T19:28:02",
+    "date_modified": "2017-03-22T16:28:08",
+    "date_modified_gmt": "2017-03-22T19:28:08",
+    "discount_total": "0.00",
+    "discount_tax": "0.00",
+    "shipping_total": "10.00",
+    "shipping_tax": "0.00",
+    "cart_tax": "1.35",
+    "total": "29.35",
+    "total_tax": "1.35",
+    "prices_include_tax": false,
+    "customer_id": 0,
+    "customer_ip_address": "",
+    "customer_user_agent": "",
+    "customer_note": "",
+    "billing": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US",
+      "email": "john.doe@example.com",
+      "phone": "(555) 555-5555"
+    },
+    "shipping": {
+      "first_name": "John",
+      "last_name": "Doe",
+      "company": "",
+      "address_1": "969 Market",
+      "address_2": "",
+      "city": "San Francisco",
+      "state": "CA",
+      "postcode": "94103",
+      "country": "US"
+    },
+    "payment_method": "bacs",
+    "payment_method_title": "Direct Bank Transfer",
+    "transaction_id": "",
+    "date_paid": "2017-03-22T16:28:08",
+    "date_paid_gmt": "2017-03-22T19:28:08",
+    "date_completed": null,
+    "date_completed_gmt": null,
+    "cart_hash": "",
+    "meta_data": [
+      {
+        "id": 13106,
+        "key": "_download_permissions_granted",
+        "value": "yes"
+      },
+      {
+        "id": 13109,
+        "key": "_order_stock_reduced",
+        "value": "yes"
+      }
+    ],
+    "line_items": [
+      {
+        "id": 315,
+        "name": "Woo Single #1",
+        "product_id": 93,
+        "variation_id": 0,
+        "quantity": 2,
+        "tax_class": "",
+        "subtotal": "6.00",
+        "subtotal_tax": "0.45",
+        "total": "6.00",
+        "total_tax": "0.45",
+        "taxes": [
+          {
+            "id": 75,
+            "total": "0.45",
+            "subtotal": "0.45"
+          }
+        ],
+        "meta_data": [],
+        "sku": "",
+        "price": 3
+      },
+      {
+        "id": 316,
+        "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+        "product_id": 22,
+        "variation_id": 23,
+        "quantity": 1,
+        "tax_class": "",
+        "subtotal": "12.00",
+        "subtotal_tax": "0.90",
+        "total": "12.00",
+        "total_tax": "0.90",
+        "taxes": [
+          {
+            "id": 75,
+            "total": "0.9",
+            "subtotal": "0.9"
+          }
+        ],
+        "meta_data": [
+          {
+            "id": 2095,
+            "key": "pa_color",
+            "value": "black"
+          },
+          {
+            "id": 2096,
+            "key": "size",
+            "value": "M Test"
+          }
+        ],
+        "sku": "Bar3",
+        "price": 12
+      }
+    ],
+    "tax_lines": [
+      {
+        "id": 318,
+        "rate_code": "US-CA-STATE TAX",
+        "rate_id": 75,
+        "label": "State Tax",
+        "compound": false,
+        "tax_total": "1.35",
+        "shipping_tax_total": "0.00",
+        "meta_data": []
+      }
+    ],
+    "shipping_lines": [
+      {
+        "id": 317,
+        "method_title": "Flat Rate",
+        "method_id": "flat_rate",
+        "total": "10.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": []
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "refunds": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/727"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders"
+        }
+      ]
+    }
+  },
+  {
+    "id": 723,
+    "parent_id": 0,
+    "number": "723",
+    "order_key": "wc_order_58d17c18352",
+    "created_via": "checkout",
+    "version": "3.0.0",
+    "status": "completed",
+    "currency": "USD",
+    "date_created": "2017-03-21T16:16:00",
+    "date_created_gmt": "2017-03-21T19:16:00",
+    "date_modified": "2017-03-21T16:54:51",
+    "date_modified_gmt": "2017-03-21T19:54:51",
+    "discount_total": "0.00",
+    "discount_tax": "0.00",
+    "shipping_total": "10.00",
+    "shipping_tax": "0.00",
+    "cart_tax": "0.00",
+    "total": "39.00",
+    "total_tax": "0.00",
+    "prices_include_tax": false,
+    "customer_id": 26,
+    "customer_ip_address": "127.0.0.1",
+    "customer_user_agent": "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:52.0) gecko/20100101 firefox/52.0",
+    "customer_note": "",
+    "billing": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR",
+      "email": "joao.silva@example.com",
+      "phone": "(11) 1111-1111"
+    },
+    "shipping": {
+      "first_name": "João",
+      "last_name": "Silva",
+      "company": "",
+      "address_1": "Av. Brasil, 432",
+      "address_2": "",
+      "city": "Rio de Janeiro",
+      "state": "RJ",
+      "postcode": "12345-000",
+      "country": "BR"
+    },
+    "payment_method": "bacs",
+    "payment_method_title": "Direct bank transfer",
+    "transaction_id": "",
+    "date_paid": null,
+    "date_paid_gmt": null,
+    "date_completed": "2017-03-21T16:54:51",
+    "date_completed_gmt": "2017-03-21T19:54:51",
+    "cart_hash": "5040ce7273261e31d8bcf79f9be3d279",
+    "meta_data": [
+      {
+        "id": 13023,
+        "key": "_download_permissions_granted",
+        "value": "yes"
+      }
+    ],
+    "line_items": [
+      {
+        "id": 311,
+        "name": "Woo Album #2",
+        "product_id": 87,
+        "variation_id": 0,
+        "quantity": 1,
+        "tax_class": "",
+        "subtotal": "9.00",
+        "subtotal_tax": "0.00",
+        "total": "9.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [],
+        "sku": "",
+        "price": 9
+      },
+      {
+        "id": 313,
+        "name": "Woo Ninja",
+        "product_id": 34,
+        "variation_id": 0,
+        "quantity": 1,
+        "tax_class": "",
+        "subtotal": "20.00",
+        "subtotal_tax": "0.00",
+        "total": "20.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [],
+        "sku": "",
+        "price": 20
+      }
+    ],
+    "tax_lines": [],
+    "shipping_lines": [
+      {
+        "id": 312,
+        "method_title": "Flat rate",
+        "method_id": "flat_rate:25",
+        "total": "10.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [
+          {
+            "id": 2057,
+            "key": "Items",
+            "value": "Woo Album #2 &times; 1"
+          }
+        ]
+      }
+    ],
+    "fee_lines": [],
+    "coupon_lines": [],
+    "refunds": [
+      {
+        "id": 726,
+        "refund": "",
+        "total": "-10.00"
+      },
+      {
+        "id": 724,
+        "refund": "",
+        "total": "-9.00"
+      }
+    ],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders"
+        }
+      ],
+      "customer": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/customers/26"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
statusstringLimit result set to orders assigned a specific status. Options: any, pending, processing, on-hold, completed, cancelled, refunded and failed. Default is any.
customerintegerLimit result set to orders assigned a specific customer.
productintegerLimit result set to orders assigned a specific product.
dpintegerNumber of decimal points to use in each resource. Default is 2.
+

Update an Order

+

This API lets you make changes to an order.

+

HTTP Request

+
+
+ PUT +
/wp-json/wc/v2/orders/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/orders/727 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "status": "completed"
+}'
+
const data = {
+  status: "completed"
+};
+
+WooCommerce.put("orders/727", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'status' => 'completed'
+];
+
+print_r($woocommerce->put('orders/727', $data));
+?>
+
data = {
+    "status": "completed"
+}
+
+print(wcapi.put("orders/727", data).json())
+
data = {
+  status: "completed"
+}
+
+woocommerce.put("orders/727", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "completed",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:30:35",
+  "date_modified_gmt": "2017-03-22T19:30:35",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": "2017-03-22T16:30:35",
+  "date_completed_gmt": "2017-03-22T19:30:35",
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    },
+    {
+      "id": 13109,
+      "key": "_order_stock_reduced",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders"
+      }
+    ]
+  }
+}
+

Delete an order

+

This API helps you delete an order.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/orders/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/orders/727?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/727", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/727', ['force' => true])); ?>
+
print(wcapi.delete("orders/727", params={"force": True}).json())
+
woocommerce.delete("orders/727", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 727,
+  "parent_id": 0,
+  "number": "727",
+  "order_key": "wc_order_58d2d042d1d",
+  "created_via": "rest-api",
+  "version": "3.0.0",
+  "status": "completed",
+  "currency": "USD",
+  "date_created": "2017-03-22T16:28:02",
+  "date_created_gmt": "2017-03-22T19:28:02",
+  "date_modified": "2017-03-22T16:30:35",
+  "date_modified_gmt": "2017-03-22T19:30:35",
+  "discount_total": "0.00",
+  "discount_tax": "0.00",
+  "shipping_total": "10.00",
+  "shipping_tax": "0.00",
+  "cart_tax": "1.35",
+  "total": "29.35",
+  "total_tax": "1.35",
+  "prices_include_tax": false,
+  "customer_id": 0,
+  "customer_ip_address": "",
+  "customer_user_agent": "",
+  "customer_note": "",
+  "billing": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US",
+    "email": "john.doe@example.com",
+    "phone": "(555) 555-5555"
+  },
+  "shipping": {
+    "first_name": "John",
+    "last_name": "Doe",
+    "company": "",
+    "address_1": "969 Market",
+    "address_2": "",
+    "city": "San Francisco",
+    "state": "CA",
+    "postcode": "94103",
+    "country": "US"
+  },
+  "payment_method": "bacs",
+  "payment_method_title": "Direct Bank Transfer",
+  "transaction_id": "",
+  "date_paid": "2017-03-22T16:28:08",
+  "date_paid_gmt": "2017-03-22T19:28:08",
+  "date_completed": "2017-03-22T16:30:35",
+  "date_completed_gmt": "2017-03-22T19:30:35",
+  "cart_hash": "",
+  "meta_data": [
+    {
+      "id": 13106,
+      "key": "_download_permissions_granted",
+      "value": "yes"
+    },
+    {
+      "id": 13109,
+      "key": "_order_stock_reduced",
+      "value": "yes"
+    }
+  ],
+  "line_items": [
+    {
+      "id": 315,
+      "name": "Woo Single #1",
+      "product_id": 93,
+      "variation_id": 0,
+      "quantity": 2,
+      "tax_class": "",
+      "subtotal": "6.00",
+      "subtotal_tax": "0.45",
+      "total": "6.00",
+      "total_tax": "0.45",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.45",
+          "subtotal": "0.45"
+        }
+      ],
+      "meta_data": [],
+      "sku": "",
+      "price": 3
+    },
+    {
+      "id": 316,
+      "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+      "product_id": 22,
+      "variation_id": 23,
+      "quantity": 1,
+      "tax_class": "",
+      "subtotal": "12.00",
+      "subtotal_tax": "0.90",
+      "total": "12.00",
+      "total_tax": "0.90",
+      "taxes": [
+        {
+          "id": 75,
+          "total": "0.9",
+          "subtotal": "0.9"
+        }
+      ],
+      "meta_data": [
+        {
+          "id": 2095,
+          "key": "pa_color",
+          "value": "black"
+        },
+        {
+          "id": 2096,
+          "key": "size",
+          "value": "M Test"
+        }
+      ],
+      "sku": "Bar3",
+      "price": 12
+    }
+  ],
+  "tax_lines": [
+    {
+      "id": 318,
+      "rate_code": "US-CA-STATE TAX",
+      "rate_id": 75,
+      "label": "State Tax",
+      "compound": false,
+      "tax_total": "1.35",
+      "shipping_tax_total": "0.00",
+      "meta_data": []
+    }
+  ],
+  "shipping_lines": [
+    {
+      "id": 317,
+      "method_title": "Flat Rate",
+      "method_id": "flat_rate",
+      "total": "10.00",
+      "total_tax": "0.00",
+      "taxes": [],
+      "meta_data": []
+    }
+  ],
+  "fee_lines": [],
+  "coupon_lines": [],
+  "refunds": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/727"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the order, Default is false.
+

Batch update orders

+

This API helps you to batch create, update and delete multiple orders.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/orders/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/orders/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "line_items": [
+        {
+          "product_id": 79,
+          "quantity": 1
+        },
+        {
+          "product_id": 93,
+          "quantity": 1
+        },
+        {
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1
+        }
+      ],
+      "shipping_lines": [
+        {
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "30.00"
+        }
+      ]
+    },
+    {
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "set_paid": true,
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "line_items": [
+        {
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1
+        },
+        {
+          "product_id": 22,
+          "variation_id": 24,
+          "quantity": 1
+        }
+      ],
+      "shipping_lines": [
+        {
+          "method_id": "flat_rate",
+          "method_title": "Flat Rate",
+          "total": "20.00"
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 727,
+      "shipping_methods": "Local Delivery"
+    }
+  ],
+  "delete": [
+    723
+  ]
+}'
+
const data = {
+  create: [
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 79,
+          quantity: 1
+        },
+        {
+          product_id: 93,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "30.00"
+        }
+      ]
+    },
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      set_paid: true,
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 24,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "20.00"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 727,
+      shipping_methods: "Local Delivery"
+    }
+  ],
+  delete: [
+    723
+  ]
+};
+
+WooCommerce.post("orders/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'payment_method' => 'bacs',
+            'payment_method_title' => 'Direct Bank Transfer',
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ],
+            'line_items' => [
+                [
+                    'product_id' => 79,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 93,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 22,
+                    'variation_id' => 23,
+                    'quantity' => 1
+                ]
+            ],
+            'shipping_lines' => [
+                [
+                    'method_id' => 'flat_rate',
+                    'method_title' => 'Flat Rate',
+                    'total' => '30.00'
+                ]
+            ]
+        ],
+        [
+            'payment_method' => 'bacs',
+            'payment_method_title' => 'Direct Bank Transfer',
+            'set_paid' => true,
+            'billing' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US',
+                'email' => 'john.doe@example.com',
+                'phone' => '(555) 555-5555'
+            ],
+            'shipping' => [
+                'first_name' => 'John',
+                'last_name' => 'Doe',
+                'address_1' => '969 Market',
+                'address_2' => '',
+                'city' => 'San Francisco',
+                'state' => 'CA',
+                'postcode' => '94103',
+                'country' => 'US'
+            ],
+            'line_items' => [
+                [
+                    'product_id' => 22,
+                    'variation_id' => 23,
+                    'quantity' => 1
+                ],
+                [
+                    'product_id' => 22,
+                    'variation_id' => 24,
+                    'quantity' => 1
+                ]
+            ],
+            'shipping_lines' => [
+                [
+                    'method_id' => 'flat_rate',
+                    'method_title' => 'Flat Rate',
+                    'total' => '20.00'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 727,
+            'shipping_methods' => 'Local Delivery'
+        ]
+    ],
+    'delete' => [
+        723
+    ]
+];
+
+print_r($woocommerce->post('orders/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "payment_method": "bacs",
+            "payment_method_title": "Direct Bank Transfer",
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            },
+            "line_items": [
+                {
+                    "product_id": 79,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 93,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 22,
+                    "variation_id": 23,
+                    "quantity": 1
+                }
+            ],
+            "shipping_lines": [
+                {
+                    "method_id": "flat_rate",
+                    "method_title": "Flat Rate",
+                    "total": "30.00"
+                }
+            ]
+        },
+        {
+            "payment_method": "bacs",
+            "payment_method_title": "Direct Bank Transfer",
+            "set_paid": True,
+            "billing": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US",
+                "email": "john.doe@example.com",
+                "phone": "(555) 555-5555"
+            },
+            "shipping": {
+                "first_name": "John",
+                "last_name": "Doe",
+                "address_1": "969 Market",
+                "address_2": "",
+                "city": "San Francisco",
+                "state": "CA",
+                "postcode": "94103",
+                "country": "US"
+            },
+            "line_items": [
+                {
+                    "product_id": 22,
+                    "variation_id": 23,
+                    "quantity": 1
+                },
+                {
+                    "product_id": 22,
+                    "variation_id": 24,
+                    "quantity": 1
+                }
+            ],
+            "shipping_lines": [
+                {
+                    "method_id": "flat_rate",
+                    "method_title": "Flat Rate",
+                    "total": "20.00"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 727,
+            "shipping_methods": "Local Delivery"
+        }
+    ],
+    "delete": [
+        723
+    ]
+}
+
+print(wcapi.post("orders/batch", data).json())
+
data = {
+  create: [
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 79,
+          quantity: 1
+        },
+        {
+          product_id: 93,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "30.00"
+        }
+      ]
+    },
+    {
+      payment_method: "bacs",
+      payment_method_title: "Direct Bank Transfer",
+      set_paid: true,
+      billing: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US",
+        email: "john.doe@example.com",
+        phone: "(555) 555-5555"
+      },
+      shipping: {
+        first_name: "John",
+        last_name: "Doe",
+        address_1: "969 Market",
+        address_2: "",
+        city: "San Francisco",
+        state: "CA",
+        postcode: "94103",
+        country: "US"
+      },
+      line_items: [
+        {
+          product_id: 22,
+          variation_id: 23,
+          quantity: 1
+        },
+        {
+          product_id: 22,
+          variation_id: 24,
+          quantity: 1
+        }
+      ],
+      shipping_lines: [
+        {
+          method_id: "flat_rate",
+          method_title: "Flat Rate",
+          total: "20.00"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 727,
+      shipping_methods: "Local Delivery"
+    }
+  ],
+  delete: [
+    723
+  ]
+}
+
+woocommerce.post("orders/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 728,
+      "parent_id": 0,
+      "number": "728",
+      "order_key": "wc_order_58d2d18e580",
+      "created_via": "rest-api",
+      "version": "3.0.0",
+      "status": "pending",
+      "currency": "USD",
+      "date_created": "2017-03-22T16:33:34",
+      "date_created_gmt": "2017-03-22T19:33:34",
+      "date_modified": "2017-03-22T16:33:34",
+      "date_modified_gmt": "2017-03-22T19:33:34",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "30.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "2.25",
+      "total": "62.25",
+      "total_tax": "2.25",
+      "prices_include_tax": false,
+      "customer_id": 0,
+      "customer_ip_address": "",
+      "customer_user_agent": "",
+      "customer_note": "",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "transaction_id": "",
+      "date_paid": null,
+      "date_paid_gmt": null,
+      "date_completed": null,
+      "date_completed_gmt": null,
+      "cart_hash": "",
+      "meta_data": [],
+      "line_items": [
+        {
+          "id": 319,
+          "name": "Woo Logo",
+          "product_id": 79,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "15.00",
+          "subtotal_tax": "1.13",
+          "total": "15.00",
+          "total_tax": "1.13",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "1.125",
+              "subtotal": "1.125"
+            }
+          ],
+          "meta_data": [],
+          "sku": "",
+          "price": 15
+        },
+        {
+          "id": 320,
+          "name": "Woo Single #1",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "3.00",
+          "subtotal_tax": "0.23",
+          "total": "3.00",
+          "total_tax": "0.23",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.225",
+              "subtotal": "0.225"
+            }
+          ],
+          "meta_data": [],
+          "sku": "",
+          "price": 3
+        },
+        {
+          "id": 321,
+          "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "12.00",
+          "subtotal_tax": "0.90",
+          "total": "12.00",
+          "total_tax": "0.90",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.9",
+              "subtotal": "0.9"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2133,
+              "key": "pa_color",
+              "value": "black"
+            },
+            {
+              "id": 2134,
+              "key": "size",
+              "value": "M Test"
+            }
+          ],
+          "sku": "Bar3",
+          "price": 12
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 323,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": 75,
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "2.25",
+          "shipping_tax_total": "0.00",
+          "meta_data": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 322,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "30.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders/728"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders"
+          }
+        ]
+      }
+    },
+    {
+      "id": 729,
+      "parent_id": 0,
+      "number": "729",
+      "order_key": "wc_order_58d2d196171",
+      "created_via": "rest-api",
+      "version": "3.0.0",
+      "status": "processing",
+      "currency": "USD",
+      "date_created": "2017-03-22T16:33:42",
+      "date_created_gmt": "2017-03-22T19:33:42",
+      "date_modified": "2017-03-22T16:33:47",
+      "date_modified_gmt": "2017-03-22T19:33:47",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "20.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "2.40",
+      "total": "54.40",
+      "total_tax": "2.40",
+      "prices_include_tax": false,
+      "customer_id": 0,
+      "customer_ip_address": "",
+      "customer_user_agent": "",
+      "customer_note": "",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "transaction_id": "",
+      "date_paid": "2017-03-22T16:33:47",
+      "date_paid_gmt": "2017-03-22T19:33:47",
+      "date_completed": null,
+      "date_completed_gmt": null,
+      "cart_hash": "",
+      "meta_data": [
+        {
+          "id": 13198,
+          "key": "_download_permissions_granted",
+          "value": "yes"
+        }
+      ],
+      "line_items": [
+        {
+          "id": 324,
+          "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "12.00",
+          "subtotal_tax": "0.90",
+          "total": "12.00",
+          "total_tax": "0.90",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.9",
+              "subtotal": "0.9"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2153,
+              "key": "pa_color",
+              "value": "black"
+            },
+            {
+              "id": 2154,
+              "key": "size",
+              "value": "M Test"
+            }
+          ],
+          "sku": "Bar3",
+          "price": 12
+        },
+        {
+          "id": 325,
+          "name": "Ship Your Idea &ndash; Color: Green, Size: S Test",
+          "product_id": 22,
+          "variation_id": 24,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "20.00",
+          "subtotal_tax": "1.50",
+          "total": "20.00",
+          "total_tax": "1.50",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "1.5",
+              "subtotal": "1.5"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2164,
+              "key": "pa_color",
+              "value": "green"
+            },
+            {
+              "id": 2165,
+              "key": "size",
+              "value": "S Test"
+            }
+          ],
+          "sku": "",
+          "price": 20
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 327,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": 75,
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "2.40",
+          "shipping_tax_total": "0.00",
+          "meta_data": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 326,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders/729"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 727,
+      "parent_id": 0,
+      "number": "727",
+      "order_key": "wc_order_58d2d042d1d",
+      "created_via": "rest-api",
+      "version": "3.0.0",
+      "status": "completed",
+      "currency": "USD",
+      "date_created": "2017-03-22T16:28:02",
+      "date_created_gmt": "2017-03-22T19:28:02",
+      "date_modified": "2017-03-22T16:30:35",
+      "date_modified_gmt": "2017-03-22T19:30:35",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "10.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "1.35",
+      "total": "29.35",
+      "total_tax": "1.35",
+      "prices_include_tax": false,
+      "customer_id": 0,
+      "customer_ip_address": "",
+      "customer_user_agent": "",
+      "customer_note": "",
+      "billing": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US",
+        "email": "john.doe@example.com",
+        "phone": "(555) 555-5555"
+      },
+      "shipping": {
+        "first_name": "John",
+        "last_name": "Doe",
+        "company": "",
+        "address_1": "969 Market",
+        "address_2": "",
+        "city": "San Francisco",
+        "state": "CA",
+        "postcode": "94103",
+        "country": "US"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct Bank Transfer",
+      "transaction_id": "",
+      "date_paid": "2017-03-22T16:28:08",
+      "date_paid_gmt": "2017-03-22T19:28:08",
+      "date_completed": "2017-03-22T16:30:35",
+      "date_completed_gmt": "2017-03-22T19:30:35",
+      "cart_hash": "",
+      "meta_data": [
+        {
+          "id": 13106,
+          "key": "_download_permissions_granted",
+          "value": "yes"
+        },
+        {
+          "id": 13109,
+          "key": "_order_stock_reduced",
+          "value": "yes"
+        }
+      ],
+      "line_items": [
+        {
+          "id": 315,
+          "name": "Woo Single #1",
+          "product_id": 93,
+          "variation_id": 0,
+          "quantity": 2,
+          "tax_class": "",
+          "subtotal": "6.00",
+          "subtotal_tax": "0.45",
+          "total": "6.00",
+          "total_tax": "0.45",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.45",
+              "subtotal": "0.45"
+            }
+          ],
+          "meta_data": [],
+          "sku": "",
+          "price": 3
+        },
+        {
+          "id": 316,
+          "name": "Ship Your Idea &ndash; Color: Black, Size: M Test",
+          "product_id": 22,
+          "variation_id": 23,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "12.00",
+          "subtotal_tax": "0.90",
+          "total": "12.00",
+          "total_tax": "0.90",
+          "taxes": [
+            {
+              "id": 75,
+              "total": "0.9",
+              "subtotal": "0.9"
+            }
+          ],
+          "meta_data": [
+            {
+              "id": 2095,
+              "key": "pa_color",
+              "value": "black"
+            },
+            {
+              "id": 2096,
+              "key": "size",
+              "value": "M Test"
+            }
+          ],
+          "sku": "Bar3",
+          "price": 12
+        }
+      ],
+      "tax_lines": [
+        {
+          "id": 318,
+          "rate_code": "US-CA-STATE TAX",
+          "rate_id": 75,
+          "label": "State Tax",
+          "compound": false,
+          "tax_total": "1.35",
+          "shipping_tax_total": "0.00",
+          "meta_data": []
+        }
+      ],
+      "shipping_lines": [
+        {
+          "id": 317,
+          "method_title": "Flat Rate",
+          "method_id": "flat_rate",
+          "total": "10.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": []
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders/727"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 723,
+      "parent_id": 0,
+      "number": "723",
+      "order_key": "wc_order_58d17c18352",
+      "created_via": "checkout",
+      "version": "3.0.0",
+      "status": "completed",
+      "currency": "USD",
+      "date_created": "2017-03-21T16:16:00",
+      "date_created_gmt": "2017-03-21T19:16:00",
+      "date_modified": "2017-03-21T16:54:51",
+      "date_modified_gmt": "2017-03-21T19:54:51",
+      "discount_total": "0.00",
+      "discount_tax": "0.00",
+      "shipping_total": "10.00",
+      "shipping_tax": "0.00",
+      "cart_tax": "0.00",
+      "total": "39.00",
+      "total_tax": "0.00",
+      "prices_include_tax": false,
+      "customer_id": 26,
+      "customer_ip_address": "127.0.0.1",
+      "customer_user_agent": "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:52.0) gecko/20100101 firefox/52.0",
+      "customer_note": "",
+      "billing": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR",
+        "email": "joao.silva@example.com",
+        "phone": "(11) 1111-1111"
+      },
+      "shipping": {
+        "first_name": "João",
+        "last_name": "Silva",
+        "company": "",
+        "address_1": "Av. Brasil, 432",
+        "address_2": "",
+        "city": "Rio de Janeiro",
+        "state": "RJ",
+        "postcode": "12345-000",
+        "country": "BR"
+      },
+      "payment_method": "bacs",
+      "payment_method_title": "Direct bank transfer",
+      "transaction_id": "",
+      "date_paid": null,
+      "date_paid_gmt": null,
+      "date_completed": "2017-03-21T16:54:51",
+      "date_completed_gmt": "2017-03-21T19:54:51",
+      "cart_hash": "5040ce7273261e31d8bcf79f9be3d279",
+      "meta_data": [
+        {
+          "id": 13023,
+          "key": "_download_permissions_granted",
+          "value": "yes"
+        }
+      ],
+      "line_items": [
+        {
+          "id": 311,
+          "name": "Woo Album #2",
+          "product_id": 87,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "9.00",
+          "subtotal_tax": "0.00",
+          "total": "9.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": [],
+          "sku": "",
+          "price": 9
+        },
+        {
+          "id": 313,
+          "name": "Woo Ninja",
+          "product_id": 34,
+          "variation_id": 0,
+          "quantity": 1,
+          "tax_class": "",
+          "subtotal": "20.00",
+          "subtotal_tax": "0.00",
+          "total": "20.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": [],
+          "sku": "",
+          "price": 20
+        }
+      ],
+      "tax_lines": [],
+      "shipping_lines": [
+        {
+          "id": 312,
+          "method_title": "Flat rate",
+          "method_id": "flat_rate:25",
+          "total": "10.00",
+          "total_tax": "0.00",
+          "taxes": [],
+          "meta_data": [
+            {
+              "id": 2057,
+              "key": "Items",
+              "value": "Woo Album #2 &times; 1"
+            }
+          ]
+        }
+      ],
+      "fee_lines": [],
+      "coupon_lines": [],
+      "refunds": [
+        {
+          "id": 726,
+          "refund": "",
+          "total": "-10.00"
+        },
+        {
+          "id": 724,
+          "refund": "",
+          "total": "-9.00"
+        }
+      ],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders/723"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/orders"
+          }
+        ],
+        "customer": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/customers/26"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Order notes

+

The order notes API allows you to create, view, and delete individual order notes.
+Order notes are added by administrators and programmatically to store data about an order, or order events.

+

Order note properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the order note was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order note was created, as GMT. read-only
notestringOrder note content. mandatory
customer_notebooleanIf true, the note will be shown to customers and they will be notified. If false, the note will be for admin reference only. Default is false.
+

Create an order note

+

This API helps you to create a new note for an order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/orders/<id>/notes
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/orders/723/notes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "note": "Order ok!!!"
+}'
+
const data = {
+  note: "Order ok!!!"
+};
+
+WooCommerce.post("orders/723/notes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'note' => 'Order ok!!!'
+];
+
+print_r($woocommerce->post('orders/723/notes', $data));
+?>
+
data = {
+    "note": "Order ok!!!"
+}
+
+print(wcapi.post("orders/723/notes", data).json())
+
data = {
+  note: "Order ok!!!"
+}
+
+woocommerce.post("orders/723/notes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 281,
+  "date_created": "2017-03-21T16:46:41",
+  "date_created_gmt": "2017-03-21T19:46:41",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/notes/281"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723"
+      }
+    ]
+  }
+}
+

Retrieve an order note

+

This API lets you retrieve and view a specific note from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/orders/<id>/notes/<note_id>
+
+
+
curl https://example.com/wp-json/wc/v2/orders/723/notes/281 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/notes/281")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/notes/281')); ?>
+
print(wcapi.get("orders/723/notes/281").json())
+
woocommerce.get("orders/723/notes/281").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 281,
+  "date_created": "2017-03-21T16:46:41",
+  "date_created_gmt": "2017-03-21T19:46:41",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/notes/281"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723"
+      }
+    ]
+  }
+}
+

List all order notes

+

This API helps you to view all the notes from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/orders/<id>/notes
+
+
+
curl https://example.com/wp-json/wc/v2/orders/723/notes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/notes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/notes')); ?>
+
print(wcapi.get("orders/723/notes").json())
+
woocommerce.get("orders/723/notes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 281,
+    "date_created": "2017-03-21T16:46:41",
+    "date_created_gmt": "2017-03-21T19:46:41",
+    "note": "Order ok!!!",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/notes/281"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ]
+    }
+  },
+  {
+    "id": 280,
+    "date_created": "2017-03-21T16:16:58",
+    "date_created_gmt": "2017-03-21T19:16:58",
+    "note": "Order status changed from On hold to Completed.",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/notes/280"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ]
+    }
+  },
+  {
+    "id": 279,
+    "date_created": "2017-03-21T16:16:46",
+    "date_created_gmt": "2017-03-21T19:16:46",
+    "note": "Awaiting BACS payment Order status changed from Pending payment to On hold.",
+    "customer_note": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/notes/279"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/notes"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
typestringLimit result to customers or internal notes. Options: any, customer and internal. Default is any.
+

Delete an order note

+

This API helps you delete an order note.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/orders/<id>/notes/<note_id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/orders/723/notes/281?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/723/notes/281", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/723/notes/281', ['force' => true])); ?>
+
print(wcapi.delete("orders/723/notes/281", params={"force": True}).json())
+
woocommerce.delete("orders/723/notes/281", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 281,
+  "date_created": "2017-03-21T16:46:41",
+  "date_created_gmt": "2017-03-21T19:46:41",
+  "note": "Order ok!!!",
+  "customer_note": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/notes/281"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/notes"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Refunds

+

The refunds API allows you to create, view, and delete individual refunds.

+

Order refund properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the order refund was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the order refund was created, as GMT. read-only
amountstringRefund amount.
reasonstringReason for refund.
refunded_byintegerUser ID of user who created the refund.
meta_dataarrayMeta data. See Order refund - Meta data properties
line_itemsarrayLine items data. See Order refund - Line items properties
api_refundbooleanWhen true, the payment gateway API is used to generate the refund. Default is true. write-only
+

Order refund - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Order refund - Line items properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerItem ID. read-only
namestringProduct name.
product_idintegerProduct ID.
variation_idintegerVariation ID, if applicable.
quantityintegerQuantity ordered.
tax_classintegerTax class of product.
subtotalstringLine subtotal (before discounts).
subtotal_taxstringLine subtotal tax (before discounts). read-only
totalstringLine total (after discounts).
total_taxstringLine total tax (after discounts). read-only
taxesarrayLine taxes. See Order refund line item - Taxes properties read-only
meta_dataarrayMeta data. See Order refund - Meta data properties
skustringProduct SKU. read-only
pricestringProduct price. read-only
+

Order refund line item - Taxes properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTax rate ID. read-only
totalstringTax total. read-only
subtotalstringTax subtotal. read-only
+

Create a refund

+

This API helps you to create a new refund for an order.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/orders/<id>/refunds
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/orders/723/refunds \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "amount": "10"
+}'
+
const data = {
+  amount: "10"
+};
+
+WooCommerce.post("orders/723/refunds", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'amount' => '10'
+];
+
+print_r($woocommerce->post('orders/723/refunds', $data));
+?>
+
data = {
+    "amount": "10"
+}
+
+print(wcapi.post("orders/723/refunds", data).json())
+
data = {
+  amount: "10"
+}
+
+woocommerce.post("orders/723/refunds", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 726,
+  "date_created": "2017-03-21T17:07:11",
+  "date_created_gmt": "2017-03-21T20:07:11",
+  "amount": "10.00",
+  "reason": "",
+  "meta_data": [],
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/refunds/726"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723"
+      }
+    ]
+  }
+}
+

Retrieve a refund

+

This API lets you retrieve and view a specific refund from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/orders/<id>/refunds/<refund_id>
+
+
+
curl https://example.com/wp-json/wc/v2/orders/723/refunds/726 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/refunds/726")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/refunds/726')); ?>
+
print(wcapi.get("orders/723/refunds/726").json())
+
woocommerce.get("orders/723/refunds/726").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 726,
+  "date_created": "2017-03-21T17:07:11",
+  "date_created_gmt": "2017-03-21T20:07:11",
+  "amount": "10.00",
+  "reason": "",
+  "meta_data": [],
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/refunds/726"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
dpstringNumber of decimal points to use in each resource.
+

List all refunds

+

This API helps you to view all the refunds from an order.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/orders/<id>/refunds
+
+
+
curl https://example.com/wp-json/wc/v2/orders/723/refunds \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("orders/723/refunds")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('orders/723/refunds')); ?>
+
print(wcapi.get("orders/723/refunds").json())
+
woocommerce.get("orders/723/refunds").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 726,
+    "date_created": "2017-03-21T17:07:11",
+    "date_created_gmt": "2017-03-21T20:07:11",
+    "amount": "10.00",
+    "reason": "",
+    "refunded_by": 1,
+    "meta_data": [],
+    "line_items": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/refunds/726"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/refunds"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ]
+    }
+  },
+  {
+    "id": 724,
+    "date_created": "2017-03-21T16:55:37",
+    "date_created_gmt": "2017-03-21T19:55:37",
+    "amount": "9.00",
+    "reason": "",
+    "refunded_by": 1,
+    "meta_data": [],
+    "line_items": [
+      {
+        "id": 314,
+        "name": "Woo Album #2",
+        "product_id": 87,
+        "variation_id": 0,
+        "quantity": -1,
+        "tax_class": "",
+        "subtotal": "-9.00",
+        "subtotal_tax": "0.00",
+        "total": "-9.00",
+        "total_tax": "0.00",
+        "taxes": [],
+        "meta_data": [
+          {
+            "id": 2076,
+            "key": "_refunded_item_id",
+            "value": "311"
+          }
+        ],
+        "sku": "",
+        "price": -9
+      }
+    ],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/refunds/724"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723/refunds"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/orders/723"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
dpintegerNumber of decimal points to use in each resource. Default is 2.
+

Delete a refund

+

This API helps you delete an order refund.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/orders/<id>/refunds/<refund_id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/orders/723/refunds/726?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("orders/723/refunds/726", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('orders/723/refunds/726', ['force' => true])); ?>
+
print(wcapi.delete("orders/723/refunds/726", params={"force": True}).json())
+
woocommerce.delete("orders/723/refunds/726", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 726,
+  "date_created": "2017-03-21T17:07:11",
+  "date_created_gmt": "2017-03-21T20:07:11",
+  "amount": "10.00",
+  "reason": "",
+  "meta_data": [],
+  "line_items": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/refunds/726"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723/refunds"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/orders/723"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Products

+

The products API allows you to create, view, update, and delete individual, or a batch, of products.

+

Product properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringProduct name.
slugstringProduct slug.
permalinkstringProduct URL. read-only
date_createddate-timeThe date the product was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the product was created, as GMT. read-only
date_modifieddate-timeThe date the product was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the product was last modified, as GMT. read-only
typestringProduct type. Options: simple, grouped, external and variable. Default is simple.
statusstringProduct status (post status). Options: draft, pending, private and publish. Default is publish.
featuredbooleanFeatured product. Default is false.
catalog_visibilitystringCatalog visibility. Options: visible, catalog, search and hidden. Default is visible.
descriptionstringProduct description.
short_descriptionstringProduct short description.
skustringUnique identifier.
pricestringCurrent product price. read-only
regular_pricestringProduct regular price.
sale_pricestringProduct sale price.
date_on_sale_fromdate-timeStart date of sale price, in the site's timezone.
date_on_sale_from_gmtdate-timeStart date of sale price, as GMT.
date_on_sale_todate-timeEnd date of sale price, in the site's timezone.
date_on_sale_to_gmtdate-timeEnd date of sale price, as GMT.
price_htmlstringPrice formatted in HTML. read-only
on_salebooleanShows if the product is on sale. read-only
purchasablebooleanShows if the product can be bought. read-only
total_salesintegerAmount of sales. read-only
virtualbooleanIf the product is virtual. Default is false.
downloadablebooleanIf the product is downloadable. Default is false.
downloadsarrayList of downloadable files. See Product - Downloads properties
download_limitintegerNumber of times downloadable files can be downloaded after purchase. Default is -1.
download_expiryintegerNumber of days until access to downloadable files expires. Default is -1.
external_urlstringProduct external URL. Only for external products.
button_textstringProduct external button text. Only for external products.
tax_statusstringTax status. Options: taxable, shipping and none. Default is taxable.
tax_classstringTax class.
manage_stockbooleanStock management at product level. Default is false.
stock_quantityintegerStock quantity.
in_stockbooleanControls whether or not the product is listed as "in stock" or "out of stock" on the frontend. Default is true.
backordersstringIf managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.
backorders_allowedbooleanShows if backorders are allowed. read-only
backorderedbooleanShows if the product is on backordered. read-only
sold_individuallybooleanAllow one item to be bought in a single order. Default is false.
weightstringProduct weight.
dimensionsobjectProduct dimensions. See Product - Dimensions properties
shipping_requiredbooleanShows if the product need to be shipped. read-only
shipping_taxablebooleanShows whether or not the product shipping is taxable. read-only
shipping_classstringShipping class slug.
shipping_class_idintegerShipping class ID. read-only
reviews_allowedbooleanAllow reviews. Default is true.
average_ratingstringReviews average rating. read-only
rating_countintegerAmount of reviews that the product have. read-only
related_idsarrayList of related products IDs. read-only
upsell_idsarrayList of up-sell products IDs.
cross_sell_idsarrayList of cross-sell products IDs.
parent_idintegerProduct parent ID.
purchase_notestringOptional note to send the customer after purchase.
categoriesarrayList of categories. See Product - Categories properties
tagsarrayList of tags. See Product - Tags propertiesarrayList of images. See Product - Images properties
attributesarrayList of attributes. See Product - Attributes properties
default_attributesarrayDefaults variation attributes. See Product - Default attributes properties
variationsarrayList of variations IDs. read-only
grouped_productsarrayList of grouped products ID.
menu_orderintegerMenu order, used to custom sort products.
meta_dataarrayMeta data. See Product - Meta data properties
+

Product - Downloads properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID.
namestringFile name.
filestringFile URL.
+

Product - Dimensions properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringProduct length.
widthstringProduct width.
heightstringProduct height.
+

Product - Categories properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerCategory ID.
namestringCategory name. read-only
slugstringCategory slug. read-only
+

Product - Tags properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerTag ID.
namestringTag name. read-only
slugstringTag slug. read-only
+

Product - Images properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the image was created, as GMT. read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the image was last modified, as GMT. read-only
srcstringImage URL.
namestringImage name.
altstringImage alternative text.
positionintegerImage position. 0 means that the image is featured.
+

Product - Attributes properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID.
namestringAttribute name.
positionintegerAttribute position.
visiblebooleanDefine if the attribute is visible on the "Additional information" tab in the product's page. Default is false.
variationbooleanDefine if the attribute can be used as variation. Default is false.
optionsarrayList of available term names of the attribute.
+

Product - Default attributes properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID.
namestringAttribute name.
optionstringSelected attribute term name.
+

Product - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a product

+

This API helps you to create a new product.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products
+
+
+ +
+

Example of how to create a simple product:

+
+
curl -X POST https://example.com/wp-json/wc/v2/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Premium Quality",
+  "type": "simple",
+  "regular_price": "21.99",
+  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  "categories": [
+    {
+      "id": 9
+    },
+    {
+      "id": 14
+    }
+  ],
+  "images": [
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+      "position": 0
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+      "position": 1
+    }
+  ]
+}'
+
const data = {
+  name: "Premium Quality",
+  type: "simple",
+  regular_price: "21.99",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+      position: 1
+    }
+  ]
+};
+
+WooCommerce.post("products", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Premium Quality',
+    'type' => 'simple',
+    'regular_price' => '21.99',
+    'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    'categories' => [
+        [
+            'id' => 9
+        ],
+        [
+            'id' => 14
+        ]
+    ],
+    'images' => [
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg',
+            'position' => 0
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg',
+            'position' => 1
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "name": "Premium Quality",
+    "type": "simple",
+    "regular_price": "21.99",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+        {
+            "id": 9
+        },
+        {
+            "id": 14
+        }
+    ],
+    "images": [
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+            "position": 0
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+            "position": 1
+        }
+    ]
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  name: "Premium Quality",
+  type: "simple",
+  regular_price: "21.99",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+      position: 1
+    }
+  ]
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "21.99",
+  "regular_price": "21.99",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    53,
+    40,
+    56,
+    479,
+    99
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products"
+      }
+    ]
+  }
+}
+
+
+

Example of how to create a variable product with global and non-global attributes:

+
+
curl -X POST https://example.com/wp-json/wc/v2/products \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Ship Your Idea",
+  "type": "variable",
+  "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  "categories": [
+    {
+      "id": 9
+    },
+    {
+      "id": 14
+    }
+  ],
+  "images": [
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+      "position": 0
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+      "position": 1
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+      "position": 2
+    },
+    {
+      "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+      "position": 3
+    }
+  ],
+  "attributes": [
+    {
+      "id": 6,
+      "position": 0,
+      "visible": false,
+      "variation": true,
+      "options": [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      "name": "Size",
+      "position": 0,
+      "visible": true,
+      "variation": true,
+      "options": [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  "default_attributes": [
+    {
+      "id": 6,
+      "option": "Black"
+    },
+    {
+      "name": "Size",
+      "option": "S"
+    }
+  ]
+}'
+
const data = {
+  name: "Ship Your Idea",
+  type: "variable",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+      position: 1
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+      position: 2
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+      position: 3
+    }
+  ],
+  attributes: [
+    {
+      id: 6,
+      position: 0,
+      visible: true,
+      variation: true,
+      options: [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      name: "Size",
+      position: 0,
+      visible: false,
+      variation: true,
+      options: [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  default_attributes: [
+    {
+      id: 6,
+      option: "Black"
+    },
+    {
+      name: "Size",
+      option: "S"
+    }
+  ]
+};
+
+WooCommerce.post("products", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Ship Your Idea',
+    'type' => 'variable',
+    'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+    'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+    'categories' => [
+        [
+            'id' => 9
+        ],
+        [
+            'id' => 14
+        ]
+    ],
+    'images' => [
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg',
+            'position' => 0
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg',
+            'position' => 1
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg',
+            'position' => 2
+        ],
+        [
+            'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg',
+            'position' => 3
+        ]
+    ],
+    'attributes' => [
+        [
+            'id' => 6,
+            'position' => 0,
+            'visible' => false,
+            'variation' => true,
+            'options' => [
+                'Black',
+                'Green'
+            ]
+        ],
+        [
+            'name' => 'Size',
+            'position' => 0,
+            'visible' => true,
+            'variation' => true,
+            'options' => [
+                'S',
+                'M'
+            ]
+        ]
+    ],
+    'default_attributes' => [
+        [
+            'id' => 6,
+            'option' => 'Black'
+        ],
+        [
+            'name' => 'Size',
+            'option' => 'S'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+
data = {
+    "name": "Ship Your Idea",
+    "type": "variable",
+    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+    "categories": [
+        {
+            "id": 9
+        },
+        {
+            "id": 14
+        }
+    ],
+    "images": [
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+            "position": 0
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+            "position": 1
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+            "position": 2
+        },
+        {
+            "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+            "position": 3
+        }
+    ],
+    "attributes": [
+        {
+            "id": 6,
+            "position": 0,
+            "visible": False,
+            "variation": True,
+            "options": [
+                "Black",
+                "Green"
+            ]
+        },
+        {
+            "name": "Size",
+            "position": 0,
+            "visible": True,
+            "variation": True,
+            "options": [
+                "S",
+                "M"
+            ]
+        }
+    ],
+    "default_attributes": [
+        {
+            "id": 6,
+            "option": "Black"
+        },
+        {
+            "name": "Size",
+            "option": "S"
+        }
+    ]
+}
+
+print(wcapi.post("products", data).json())
+
data = {
+  name: "Ship Your Idea",
+  type: "variable",
+  description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+  short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+  categories: [
+    {
+      id: 9
+    },
+    {
+      id: 14
+    }
+  ],
+  images: [
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg",
+      position: 0
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg",
+      position: 1
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg",
+      position: 2
+    },
+    {
+      src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg",
+      position: 3
+    }
+  ],
+  attributes: [
+    {
+      id: 6,
+      position: 0,
+      visible: false,
+      variation: true,
+      options: [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      name: "Size",
+      position: 0,
+      visible: true,
+      variation: true,
+      options: [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  default_attributes: [
+    {
+      id: 6,
+      option: "Black"
+    },
+    {
+      name: "Size",
+      option: "S"
+    }
+  ]
+}
+
+woocommerce.post("products", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 799,
+  "name": "Ship Your Idea",
+  "slug": "ship-your-idea-22",
+  "permalink": "https://example.com/product/ship-your-idea-22/",
+  "date_created": "2017-03-23T17:03:12",
+  "date_created_gmt": "2017-03-23T20:03:12",
+  "date_modified": "2017-03-23T17:03:12",
+  "date_modified_gmt": "2017-03-23T20:03:12",
+  "type": "variable",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "",
+  "regular_price": "",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "",
+  "on_sale": false,
+  "purchasable": false,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    472,
+    387,
+    19,
+    53,
+    396
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 795,
+      "date_created": "2017-03-23T14:03:08",
+      "date_created_gmt": "2017-03-23T20:03:08",
+      "date_modified": "2017-03-23T14:03:08",
+      "date_modified_gmt": "2017-03-23T20:03:08",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 796,
+      "date_created": "2017-03-23T14:03:09",
+      "date_created_gmt": "2017-03-23T20:03:09",
+      "date_modified": "2017-03-23T14:03:09",
+      "date_modified_gmt": "2017-03-23T20:03:09",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    },
+    {
+      "id": 797,
+      "date_created": "2017-03-23T14:03:10",
+      "date_created_gmt": "2017-03-23T20:03:10",
+      "date_modified": "2017-03-23T14:03:10",
+      "date_modified_gmt": "2017-03-23T20:03:10",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg",
+      "name": "",
+      "alt": "",
+      "position": 2
+    },
+    {
+      "id": 798,
+      "date_created": "2017-03-23T14:03:11",
+      "date_created_gmt": "2017-03-23T20:03:11",
+      "date_modified": "2017-03-23T14:03:11",
+      "date_modified_gmt": "2017-03-23T20:03:11",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg",
+      "name": "",
+      "alt": "",
+      "position": 3
+    }
+  ],
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "position": 0,
+      "visible": false,
+      "variation": true,
+      "options": [
+        "Black",
+        "Green"
+      ]
+    },
+    {
+      "id": 0,
+      "name": "Size",
+      "position": 0,
+      "visible": true,
+      "variation": true,
+      "options": [
+        "S",
+        "M"
+      ]
+    }
+  ],
+  "default_attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "black"
+    },
+    {
+      "id": 0,
+      "name": "Size",
+      "option": "S"
+    }
+  ],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/799"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products"
+      }
+    ]
+  }
+}
+

Retrieve a product

+

This API lets you retrieve and view a specific product by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/products/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/794 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/794")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/794')); ?>
+
print(wcapi.get("products/794").json())
+
woocommerce.get("products/794").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "21.99",
+  "regular_price": "21.99",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    53,
+    40,
+    56,
+    479,
+    99
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products"
+      }
+    ]
+  }
+}
+

List all products

+

This API helps you to view all the products.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/products
+
+
+
curl https://example.com/wp-json/wc/v2/products \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products')); ?>
+
print(wcapi.get("products").json())
+
woocommerce.get("products").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 799,
+    "name": "Ship Your Idea",
+    "slug": "ship-your-idea-22",
+    "permalink": "https://example.com/product/ship-your-idea-22/",
+    "date_created": "2017-03-23T17:03:12",
+    "date_created_gmt": "2017-03-23T20:03:12",
+    "date_modified": "2017-03-23T17:03:12",
+    "date_modified_gmt": "2017-03-23T20:03:12",
+    "type": "variable",
+    "status": "publish",
+    "featured": false,
+    "catalog_visibility": "visible",
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "sku": "",
+    "price": "",
+    "regular_price": "",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "price_html": "",
+    "on_sale": false,
+    "purchasable": false,
+    "total_sales": 0,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "external_url": "",
+    "button_text": "",
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "in_stock": true,
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      31,
+      22,
+      369,
+      414,
+      56
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "purchase_note": "",
+    "categories": [
+      {
+        "id": 9,
+        "name": "Clothing",
+        "slug": "clothing"
+      },
+      {
+        "id": 14,
+        "name": "T-shirts",
+        "slug": "t-shirts"
+      }
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 795,
+        "date_created": "2017-03-23T14:03:08",
+        "date_created_gmt": "2017-03-23T20:03:08",
+        "date_modified": "2017-03-23T14:03:08",
+        "date_modified_gmt": "2017-03-23T20:03:08",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
+        "name": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 796,
+        "date_created": "2017-03-23T14:03:09",
+        "date_created_gmt": "2017-03-23T20:03:09",
+        "date_modified": "2017-03-23T14:03:09",
+        "date_modified_gmt": "2017-03-23T20:03:09",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg",
+        "name": "",
+        "alt": "",
+        "position": 1
+      },
+      {
+        "id": 797,
+        "date_created": "2017-03-23T14:03:10",
+        "date_created_gmt": "2017-03-23T20:03:10",
+        "date_modified": "2017-03-23T14:03:10",
+        "date_modified_gmt": "2017-03-23T20:03:10",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg",
+        "name": "",
+        "alt": "",
+        "position": 2
+      },
+      {
+        "id": 798,
+        "date_created": "2017-03-23T14:03:11",
+        "date_created_gmt": "2017-03-23T20:03:11",
+        "date_modified": "2017-03-23T14:03:11",
+        "date_modified_gmt": "2017-03-23T20:03:11",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg",
+        "name": "",
+        "alt": "",
+        "position": 3
+      }
+    ],
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "position": 0,
+        "visible": false,
+        "variation": true,
+        "options": [
+          "Black",
+          "Green"
+        ]
+      },
+      {
+        "id": 0,
+        "name": "Size",
+        "position": 0,
+        "visible": true,
+        "variation": true,
+        "options": [
+          "S",
+          "M"
+        ]
+      }
+    ],
+    "default_attributes": [],
+    "variations": [],
+    "grouped_products": [],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/799"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products"
+        }
+      ]
+    }
+  },
+  {
+    "id": 794,
+    "name": "Premium Quality",
+    "slug": "premium-quality-19",
+    "permalink": "https://example.com/product/premium-quality-19/",
+    "date_created": "2017-03-23T17:01:14",
+    "date_created_gmt": "2017-03-23T20:01:14",
+    "date_modified": "2017-03-23T17:01:14",
+    "date_modified_gmt": "2017-03-23T20:01:14",
+    "type": "simple",
+    "status": "publish",
+    "featured": false,
+    "catalog_visibility": "visible",
+    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+    "sku": "",
+    "price": "21.99",
+    "regular_price": "21.99",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+    "on_sale": false,
+    "purchasable": true,
+    "total_sales": 0,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "external_url": "",
+    "button_text": "",
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "in_stock": true,
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "sold_individually": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_required": true,
+    "shipping_taxable": true,
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "reviews_allowed": true,
+    "average_rating": "0.00",
+    "rating_count": 0,
+    "related_ids": [
+      463,
+      47,
+      31,
+      387,
+      458
+    ],
+    "upsell_ids": [],
+    "cross_sell_ids": [],
+    "parent_id": 0,
+    "purchase_note": "",
+    "categories": [
+      {
+        "id": 9,
+        "name": "Clothing",
+        "slug": "clothing"
+      },
+      {
+        "id": 14,
+        "name": "T-shirts",
+        "slug": "t-shirts"
+      }
+    ],
+    "tags": [],
+    "images": [
+      {
+        "id": 792,
+        "date_created": "2017-03-23T14:01:13",
+        "date_created_gmt": "2017-03-23T20:01:13",
+        "date_modified": "2017-03-23T14:01:13",
+        "date_modified_gmt": "2017-03-23T20:01:13",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+        "name": "",
+        "alt": "",
+        "position": 0
+      },
+      {
+        "id": 793,
+        "date_created": "2017-03-23T14:01:14",
+        "date_created_gmt": "2017-03-23T20:01:14",
+        "date_modified": "2017-03-23T14:01:14",
+        "date_modified_gmt": "2017-03-23T20:01:14",
+        "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+        "name": "",
+        "alt": "",
+        "position": 1
+      }
+    ],
+    "attributes": [],
+    "default_attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "black"
+      },
+      {
+        "id": 0,
+        "name": "Size",
+        "option": "S"
+      }
+    ],
+    "variations": [],
+    "grouped_products": [],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/794"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
slugstringLimit result set to products with a specific slug.
statusstringLimit result set to products assigned a specific status. Options: any, draft, pending, private and publish. Default is any.
typestringLimit result set to products assigned a specific type. Options: simple, grouped, external and variable.
skustringLimit result set to products with a specific SKU.
featuredbooleanLimit result set to featured products.
categorystringLimit result set to products assigned a specific category ID.
tagstringLimit result set to products assigned a specific tag ID.
shipping_classstringLimit result set to products assigned a specific shipping class ID.
attributestringLimit result set to products with a specific attribute.
attribute_termstringLimit result set to products with a specific attribute term ID (required an assigned attribute).
tax_classstringLimit result set to products with a specific tax class. Default options: standard, reduced-rate and zero-rate.
in_stockbooleanLimit result set to products in stock or out of stock.
on_salebooleanLimit result set to products on sale.
min_pricestringLimit result set to products based on a minimum price.
max_pricestringLimit result set to products based on a maximum price.
+

Update a product

+

This API lets you make changes to a product.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/794 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "24.54"
+}'
+
const data = {
+  regular_price: "24.54"
+};
+
+WooCommerce.put("products/794", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '24.54'
+];
+
+print_r($woocommerce->put('products/794', $data));
+?>
+
data = {
+    "regular_price": "24.54"
+}
+
+print(wcapi.put("products/794", data).json())
+
data = {
+  regular_price: "24.54"
+}
+
+woocommerce.put("products/794", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "24.54",
+  "regular_price": "24.54",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>24.54</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    479,
+    387,
+    22,
+    463,
+    396
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products"
+      }
+    ]
+  }
+}
+

Delete a product

+

This API helps you delete a product.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/products/794?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/794", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/794', ['force' => true])); ?>
+
print(wcapi.delete("products/794", params={"force": True}).json())
+
woocommerce.delete("products/794", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 794,
+  "name": "Premium Quality",
+  "slug": "premium-quality-19",
+  "permalink": "https://example.com/product/premium-quality-19/",
+  "date_created": "2017-03-23T17:01:14",
+  "date_created_gmt": "2017-03-23T20:01:14",
+  "date_modified": "2017-03-23T17:01:14",
+  "date_modified_gmt": "2017-03-23T20:01:14",
+  "type": "simple",
+  "status": "publish",
+  "featured": false,
+  "catalog_visibility": "visible",
+  "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+  "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+  "sku": "",
+  "price": "24.54",
+  "regular_price": "24.54",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>24.54</span>",
+  "on_sale": false,
+  "purchasable": true,
+  "total_sales": 0,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "external_url": "",
+  "button_text": "",
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "sold_individually": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_required": true,
+  "shipping_taxable": true,
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "reviews_allowed": true,
+  "average_rating": "0.00",
+  "rating_count": 0,
+  "related_ids": [
+    479,
+    387,
+    22,
+    463,
+    396
+  ],
+  "upsell_ids": [],
+  "cross_sell_ids": [],
+  "parent_id": 0,
+  "purchase_note": "",
+  "categories": [
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing"
+    },
+    {
+      "id": 14,
+      "name": "T-shirts",
+      "slug": "t-shirts"
+    }
+  ],
+  "tags": [],
+  "images": [
+    {
+      "id": 792,
+      "date_created": "2017-03-23T14:01:13",
+      "date_created_gmt": "2017-03-23T20:01:13",
+      "date_modified": "2017-03-23T14:01:13",
+      "date_modified_gmt": "2017-03-23T20:01:13",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    {
+      "id": 793,
+      "date_created": "2017-03-23T14:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T14:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+      "name": "",
+      "alt": "",
+      "position": 1
+    }
+  ],
+  "attributes": [],
+  "default_attributes": [],
+  "variations": [],
+  "grouped_products": [],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/794"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the product, Default is false.
+

Batch update products

+

This API helps you to batch create, update and delete multiple products.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/products/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Woo Single #1",
+      "type": "simple",
+      "regular_price": "21.99",
+      "virtual": true,
+      "downloadable": true,
+      "downloads": [
+        {
+          "name": "Woo Single",
+          "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      "categories": [
+        {
+          "id": 11
+        },
+        {
+          "id": 13
+        }
+      ],
+      "images": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+          "position": 0
+        }
+      ]
+    },
+    {
+      "name": "New Premium Quality",
+      "type": "simple",
+      "regular_price": "21.99",
+      "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      "categories": [
+        {
+          "id": 9
+        },
+        {
+          "id": 14
+        }
+      ],
+      "images": [
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+          "position": 0
+        },
+        {
+          "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+          "position": 1
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 799,
+      "default_attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Green"
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "option": "M"
+        }
+      ]
+    }
+  ],
+  "delete": [
+    794
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Woo Single #1",
+      type: "simple",
+      regular_price: "21.99",
+      virtual: true,
+      downloadable: true,
+      downloads: [
+        {
+          name: "Woo Single",
+          file: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      categories: [
+        {
+          id: 11
+        },
+        {
+          id: 13
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+          position: 0
+        }
+      ]
+    },
+    {
+      name: "New Premium Quality",
+      type: "simple",
+      regular_price: "21.99",
+      description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      categories: [
+        {
+          id: 9
+        },
+        {
+          id: 14
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+          position: 0
+        },
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+          position: 1
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 799,
+      default_attributes: [
+        {
+          id: 6,
+          name: "Color",
+          option: "Green"
+        },
+        {
+          id: 0,
+          name: "Size",
+          option: "M"
+        }
+      ]
+    }
+  ],
+  delete: [
+    794
+  ]
+};
+
+WooCommerce.post("products/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Woo Single #1',
+            'type' => 'simple',
+            'regular_price' => '21.99',
+            'virtual' => true,
+            'downloadable' => true,
+            'downloads' => [
+                [
+                    'name' => 'Woo Single',
+                    'file' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg'
+                ]
+            ],
+            'categories' => [
+                [
+                    'id' => 11
+                ],
+                [
+                    'id' => 13
+                ]
+            ],
+            'images' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg',
+                    'position' => 0
+                ]
+            ]
+        ],
+        [
+            'name' => 'New Premium Quality',
+            'type' => 'simple',
+            'regular_price' => '21.99',
+            'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+            'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+            'categories' => [
+                [
+                    'id' => 9
+                ],
+                [
+                    'id' => 14
+                ]
+            ],
+            'images' => [
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg',
+                    'position' => 0
+                ],
+                [
+                    'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg',
+                    'position' => 1
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 799,
+            'default_attributes' => [
+                [
+                    'id' => 6,
+                    'name' => 'Color',
+                    'option' => 'Green'
+                ],
+                [
+                    'id' => 0,
+                    'name' => 'Size',
+                    'option' => 'M'
+                ]
+            ]
+        ]
+    ],
+    'delete' => [
+        794
+    ]
+];
+
+print_r($woocommerce->post('products/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Woo Single #1",
+            "type": "simple",
+            "regular_price": "21.99",
+            "virtual": True,
+            "downloadable": True,
+            "downloads": [
+                {
+                    "name": "Woo Single",
+                    "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+                }
+            ],
+            "categories": [
+                {
+                    "id": 11
+                },
+                {
+                    "id": 13
+                }
+            ],
+            "images": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+                    "position": 0
+                }
+            ]
+        },
+        {
+            "name": "New Premium Quality",
+            "type": "simple",
+            "regular_price": "21.99",
+            "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+            "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+            "categories": [
+                {
+                    "id": 9
+                },
+                {
+                    "id": 14
+                }
+            ],
+            "images": [
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+                    "position": 0
+                },
+                {
+                    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+                    "position": 1
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 799,
+            "default_attributes": [
+                {
+                    "id": 6,
+                    "name": "Color,
+                    "option": "Green"
+                },
+                {
+                    "id": 0,
+                    "name": "Size",
+                    "option": "M"
+                }
+            ]
+        }
+    ],
+    "delete": [
+        794
+    ]
+}
+
+print(wcapi.post("products/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Woo Single #1",
+      type: "simple",
+      regular_price: "21.99",
+      virtual: true,
+      downloadable: true,
+      downloads: [
+        {
+          name: "Woo Single",
+          file: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      categories: [
+        {
+          id: 11
+        },
+        {
+          id: 13
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg",
+          position: 0
+        }
+      ]
+    },
+    {
+      name: "New Premium Quality",
+      type: "simple",
+      regular_price: "21.99",
+      description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
+      short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
+      categories: [
+        {
+          id: 9
+        },
+        {
+          id: 14
+        }
+      ],
+      images: [
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
+          position: 0
+        },
+        {
+          src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+          position: 1
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 799,
+      default_attributes: [
+        {
+          id: 6,
+          name: "Color,
+          option: "Green"
+        },
+        {
+          id: 0,
+          name: "Size",
+          option: "M"
+        }
+      ]
+    }
+  ],
+  delete: [
+    794
+  ]
+}
+
+woocommerce.post("products/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 801,
+      "name": "Woo Single #1",
+      "slug": "woo-single-1-4",
+      "permalink": "https://example.com/product/woo-single-1-4/",
+      "date_created": "2017-03-23T17:35:43",
+      "date_created_gmt": "2017-03-23T20:35:43",
+      "date_modified": "2017-03-23T17:35:43",
+      "date_modified_gmt": "2017-03-23T20:35:43",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "",
+      "short_description": "",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": true,
+      "downloadable": true,
+      "downloads": [
+        {
+          "id": 0,
+          "name": "Woo Single",
+          "file": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg"
+        }
+      ],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": false,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        588,
+        87,
+        573,
+        96,
+        329
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 11,
+          "name": "Music",
+          "slug": "music"
+        },
+        {
+          "id": 13,
+          "name": "Singles",
+          "slug": "singles"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 800,
+          "date_created": "2017-03-23T14:35:43",
+          "date_created_gmt": "2017-03-23T20:35:43",
+          "date_modified": "2017-03-23T14:35:43",
+          "date_modified_gmt": "2017-03-23T20:35:43",
+          "src": "https://example.com/wp-content/uploads/2017/03/cd_4_angle.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/801"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products"
+          }
+        ]
+      }
+    },
+    {
+      "id": 804,
+      "name": "New Premium Quality",
+      "slug": "new-premium-quality",
+      "permalink": "https://example.com/product/new-premium-quality/",
+      "date_created": "2017-03-23T17:35:48",
+      "date_created_gmt": "2017-03-23T20:35:48",
+      "date_modified": "2017-03-23T17:35:48",
+      "date_modified_gmt": "2017-03-23T20:35:48",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "21.99",
+      "regular_price": "21.99",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        458,
+        56,
+        99,
+        34,
+        378
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 802,
+          "date_created": "2017-03-23T14:35:47",
+          "date_created_gmt": "2017-03-23T20:35:47",
+          "date_modified": "2017-03-23T14:35:47",
+          "date_modified_gmt": "2017-03-23T20:35:47",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-5.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 803,
+          "date_created": "2017-03-23T14:35:48",
+          "date_created_gmt": "2017-03-23T20:35:48",
+          "date_modified": "2017-03-23T14:35:48",
+          "date_modified_gmt": "2017-03-23T20:35:48",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-3.jpg",
+          "name": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/804"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 799,
+      "name": "Ship Your Idea",
+      "slug": "ship-your-idea-22",
+      "permalink": "https://example.com/product/ship-your-idea-22/",
+      "date_created": "2017-03-23T17:03:12",
+      "date_created_gmt": "2017-03-23T20:03:12",
+      "date_modified": "2017-03-23T17:03:12",
+      "date_modified_gmt": "2017-03-23T20:03:12",
+      "type": "variable",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "",
+      "regular_price": "",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "",
+      "on_sale": false,
+      "purchasable": false,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        414,
+        40,
+        34,
+        463,
+        15
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 795,
+          "date_created": "2017-03-23T14:03:08",
+          "date_created_gmt": "2017-03-23T20:03:08",
+          "date_modified": "2017-03-23T14:03:08",
+          "date_modified_gmt": "2017-03-23T20:03:08",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 796,
+          "date_created": "2017-03-23T14:03:09",
+          "date_created_gmt": "2017-03-23T20:03:09",
+          "date_modified": "2017-03-23T14:03:09",
+          "date_modified_gmt": "2017-03-23T20:03:09",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg",
+          "name": "",
+          "alt": "",
+          "position": 1
+        },
+        {
+          "id": 797,
+          "date_created": "2017-03-23T14:03:10",
+          "date_created_gmt": "2017-03-23T20:03:10",
+          "date_modified": "2017-03-23T14:03:10",
+          "date_modified_gmt": "2017-03-23T20:03:10",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg",
+          "name": "",
+          "alt": "",
+          "position": 2
+        },
+        {
+          "id": 798,
+          "date_created": "2017-03-23T14:03:11",
+          "date_created_gmt": "2017-03-23T20:03:11",
+          "date_modified": "2017-03-23T14:03:11",
+          "date_modified_gmt": "2017-03-23T20:03:11",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg",
+          "name": "",
+          "alt": "",
+          "position": 3
+        }
+      ],
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "position": 0,
+          "visible": false,
+          "variation": true,
+          "options": [
+            "Black",
+            "Green"
+          ]
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "position": 0,
+          "visible": true,
+          "variation": true,
+          "options": [
+            "S",
+            "M"
+          ]
+        }
+      ],
+      "default_attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "green"
+        },
+        {
+          "id": 0,
+          "name": "Size",
+          "option": "M"
+        }
+      ],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/799"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 794,
+      "name": "Premium Quality",
+      "slug": "premium-quality-19",
+      "permalink": "https://example.com/product/premium-quality-19/",
+      "date_created": "2017-03-23T17:01:14",
+      "date_created_gmt": "2017-03-23T20:01:14",
+      "date_modified": "2017-03-23T17:01:14",
+      "date_modified_gmt": "2017-03-23T20:01:14",
+      "type": "simple",
+      "status": "publish",
+      "featured": false,
+      "catalog_visibility": "visible",
+      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
+      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
+      "sku": "",
+      "price": "24.54",
+      "regular_price": "24.54",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>24.54</span>",
+      "on_sale": false,
+      "purchasable": true,
+      "total_sales": 0,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "external_url": "",
+      "button_text": "",
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "sold_individually": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_required": true,
+      "shipping_taxable": true,
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "reviews_allowed": true,
+      "average_rating": "0.00",
+      "rating_count": 0,
+      "related_ids": [
+        369,
+        56,
+        378,
+        31,
+        22
+      ],
+      "upsell_ids": [],
+      "cross_sell_ids": [],
+      "parent_id": 0,
+      "purchase_note": "",
+      "categories": [
+        {
+          "id": 9,
+          "name": "Clothing",
+          "slug": "clothing"
+        },
+        {
+          "id": 14,
+          "name": "T-shirts",
+          "slug": "t-shirts"
+        }
+      ],
+      "tags": [],
+      "images": [
+        {
+          "id": 792,
+          "date_created": "2017-03-23T14:01:13",
+          "date_created_gmt": "2017-03-23T20:01:13",
+          "date_modified": "2017-03-23T14:01:13",
+          "date_modified_gmt": "2017-03-23T20:01:13",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
+          "name": "",
+          "alt": "",
+          "position": 0
+        },
+        {
+          "id": 793,
+          "date_created": "2017-03-23T14:01:14",
+          "date_created_gmt": "2017-03-23T20:01:14",
+          "date_modified": "2017-03-23T14:01:14",
+          "date_modified_gmt": "2017-03-23T20:01:14",
+          "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
+          "name": "",
+          "alt": "",
+          "position": 1
+        }
+      ],
+      "attributes": [],
+      "default_attributes": [],
+      "variations": [],
+      "grouped_products": [],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/794"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve product reviews

+

This API lets you retrieve and view a specific product review by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/products/<product_id>/reviews/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/22/reviews/5 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/products/22/reviews/5")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/22/reviews/5')); ?>
+
print(wcapi.get("products/products/22/reviews/5").json())
+
woocommerce.get("products/products/22/reviews/5").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "date_created": "2013-06-07T11:43:13",
+  "date_created_gmt": "2013-06-07T11:43:13",
+  "review": "Nice T-shirt, I got one in black. Goes with anything!",
+  "rating": 4,
+  "name": "James Koster",
+  "email": "james@example.com",
+  "verified": false,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/reviews/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/reviews"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22"
+      }
+    ]
+  }
+}
+

Product review properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
reviewstringThe content of the review. mandatory
date_createddate-timeThe date the review was created, in the site's timezone.
date_created_gmtdate-timeThe date the review was created, as GMT.
ratingintegerReview rating (0 to 5).
namestringReviewer name. mandatory
emailstringReviewer email. mandatory
verifiedbooleanShows if the reviewer bought the product or not. read-only
+

List all product reviews

+

This API lets you retrieve all reviews of a product.

+ +
+
+ GET +
/wp-json/wc/v2/products/<product_id>/reviews
+
+
+
curl https://example.com/wp-json/wc/v2/products/22/reviews \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/22/reviews")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/22/reviews')); ?>
+
print(wcapi.get("products/22/reviews").json())
+
woocommerce.get("products/22/reviews").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 5,
+    "date_created": "2013-06-07T11:43:13",
+    "date_created_gmt": "2013-06-07T11:43:13",
+    "review": "Nice T-shirt, I got one in black. Goes with anything!",
+    "rating": 4,
+    "name": "James Koster",
+    "email": "james@example.com",
+    "verified": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/reviews/5"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/reviews"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22"
+        }
+      ]
+    }
+  },
+  {
+    "id": 6,
+    "date_created": "2013-06-07T11:55:15",
+    "date_created_gmt": "2013-06-07T11:55:15",
+    "review": "Very comfortable shirt, and I love the graphic!",
+    "rating": 4,
+    "name": "Cobus Bester",
+    "email": "bester@example.com",
+    "verified": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/reviews/6"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/reviews"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22"
+        }
+      ]
+    }
+  },
+  {
+    "id": 7,
+    "date_created": "2013-06-07T13:02:14",
+    "date_created_gmt": "2013-06-07T13:02:14",
+    "review": "Great T-shirt quality, Great Design and Great Service.",
+    "rating": 5,
+    "name": "Stuart",
+    "email": "stuart@example.com",
+    "verified": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/reviews/7"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/reviews"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22"
+        }
+      ]
+    }
+  }
+]
+

Product variations

+

The product variations API allows you to create, view, update, and delete individual, or a batch, of product variations.

+

Product variation properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
date_createddate-timeThe date the variation was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the variation was created, as GMT. read-only
date_modifieddate-timeThe date the variation was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the variation was last modified, as GMT. read-only
descriptionstringVariation description.
permalinkstringVariation URL. read-only
skustringUnique identifier.
pricestringCurrent variation price. read-only
regular_pricestringVariation regular price.
sale_pricestringVariation sale price.
date_on_sale_fromdate-timeStart date of sale price, in the site's timezone.
date_on_sale_from_gmtdate-timeStart date of sale price, as GMT.
date_on_sale_todate-timeEnd date of sale price, in the site's timezone.
date_on_sale_to_gmtdate-timeEnd date of sale price, as GMT.
on_salebooleanShows if the variation is on sale. read-only
visiblebooleanDefine if the attribute is visible on the "Additional information" tab in the product's page. Default is true.
purchasablebooleanShows if the variation can be bought. read-only
virtualbooleanIf the variation is virtual. Default is false.
downloadablebooleanIf the variation is downloadable. Default is false.
downloadsarrayList of downloadable files. See Product variation - Downloads properties
download_limitintegerNumber of times downloadable files can be downloaded after purchase. Default is -1.
download_expiryintegerNumber of days until access to downloadable files expires. Default is -1.
tax_statusstringTax status. Options: taxable, shipping and none. Default is taxable.
tax_classstringTax class.
manage_stockbooleanStock management at variation level. Default is false.
stock_quantityintegerStock quantity.
in_stockbooleanControls whether or not the variation is listed as "in stock" or "out of stock" on the frontend. Default is true.
backordersstringIf managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.
backorders_allowedbooleanShows if backorders are allowed. read-only
backorderedbooleanShows if the variation is on backordered. read-only
weightstringVariation weight.
dimensionsobjectVariation dimensions. See Product variation - Dimensions properties
shipping_classstringShipping class slug.
shipping_class_idstringShipping class ID. read-only
imageobjectVariation image data. See Product variation - Image properties
attributesarrayList of attributes. See Product variation - Attributes properties
menu_orderintegerMenu order, used to custom sort products.
meta_dataarrayMeta data. See Product variation - Meta data properties
+

Product variation - Downloads properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringFile ID.
namestringFile name.
filestringFile URL.
+

Product variation - Dimensions properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
lengthstringVariation length.
widthstringVariation width.
heightstringVariation height.
+

Product variation - Image properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the image was created, as GMT. read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the image was last modified, as GMT. read-only
srcstringImage URL.
namestringImage name.
altstringImage alternative text.
positionintegerImage position. 0 means that the image is featured.
+

Product variation - Attributes properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerAttribute ID.
namestringAttribute name.
optionstringSelected attribute term name.
+

Product variation - Meta data properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuestringMeta value.
+

Create a product variation

+

This API helps you to create a new product variation.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/<product_id>/variations
+
+
+ +
+

JSON response example:

+
+
curl -X POST https://example.com/wp-json/wc/v2/products/22/variations \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "9.00",
+  "image": {
+    "id": 423
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "option": "Black"
+    }
+  ]
+}'
+
const data = {
+  regular_price: "9.00",
+  image: {
+    id: 423
+  },
+  attributes: [
+    {
+      id: 9,
+      option: "Black"
+    }
+  ]
+};
+
+WooCommerce.post("products/22/variations", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '9.00',
+    'image' => [
+        'id' => 423
+    ],
+    'attributes' => [
+        [
+            'id' => 9,
+            'option' => 'Black'
+        ]
+    ]
+];
+
+print_r($woocommerce->post('products/22/variations', $data));
+?>
+
data = {
+    "regular_price": "9.00",
+    "image": {
+        "id": 423
+    },
+    "attributes": [
+        {
+            "id": 9,
+            "option": "Black"
+        }
+    ]
+}
+
+print(wcapi.post("products/22/variations", data).json())
+
data = {
+  regular_price: "9.00",
+  image: {
+    id: 423
+  },
+  attributes: [
+    {
+      id: 9,
+      position: "Black"
+    }
+  ]
+}
+
+woocommerce.post("products/22/variations", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 732,
+  "date_created": "2017-03-23T00:36:38",
+  "date_created_gmt": "2017-03-23T03:36:38",
+  "date_modified": "2017-03-23T00:36:38",
+  "date_modified_gmt": "2017-03-23T03:36:38",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+  "sku": "",
+  "price": "9.00",
+  "regular_price": "9.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "visible": true,
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 423,
+    "date_created": "2016-10-19T12:21:14",
+    "date_created_gmt": "2016-10-19T16:21:14",
+    "date_modified": "2016-10-19T12:21:14",
+    "date_modified_gmt": "2016-10-19T16:21:14",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+    "name": "",
+    "alt": "",
+    "position": 0
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Black"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations/732"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22"
+      }
+    ]
+  }
+}
+

Retrieve a product variation

+

This API lets you retrieve and view a specific product variation by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/products/<product_id>/variations/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/22/variations/732 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/22/variations/732")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/22/variations/732')); ?>
+
print(wcapi.get("products/22/variations/732").json())
+
woocommerce.get("products/22/variations/732").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 732,
+  "date_created": "2017-03-23T00:36:38",
+  "date_created_gmt": "2017-03-23T03:36:38",
+  "date_modified": "2017-03-23T00:36:38",
+  "date_modified_gmt": "2017-03-23T03:36:38",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+  "sku": "",
+  "price": "9.00",
+  "regular_price": "9.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "visible": true,
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 423,
+    "date_created": "2016-10-19T12:21:14",
+    "date_created_gmt": "2016-10-19T16:21:14",
+    "date_modified": "2016-10-19T12:21:14",
+    "date_modified_gmt": "2016-10-19T16:21:14",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+    "name": "",
+    "alt": "",
+    "position": 0
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Black"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations/732"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22"
+      }
+    ]
+  }
+}
+

List all product variations

+

This API helps you to view all the product variations.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/products/<product_id>/variations
+
+
+
curl https://example.com/wp-json/wc/v2/products/22/variations \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/22/variations")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/22/variations')); ?>
+
print(wcapi.get("products/22/variations").json())
+
woocommerce.get("products/22/variations").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 733,
+    "date_created": "2017-03-23T00:53:11",
+    "date_created_gmt": "2017-03-23T03:53:11",
+    "date_modified": "2017-03-23T00:53:11",
+    "date_modified_gmt": "2017-03-23T03:53:11",
+    "description": "",
+    "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+    "sku": "",
+    "price": "9.00",
+    "regular_price": "9.00",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "on_sale": false,
+    "visible": true,
+    "purchasable": true,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "in_stock": true,
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "image": {
+      "id": 425,
+      "date_created": "2016-10-19T12:21:16",
+      "date_created_gmt": "2016-10-19T16:21:16",
+      "date_modified": "2016-10-19T12:21:16",
+      "date_modified_gmt": "2016-10-19T16:21:16",
+      "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "Green"
+      }
+    ],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/variations/733"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22"
+        }
+      ]
+    }
+  },
+  {
+    "id": 732,
+    "date_created": "2017-03-23T00:36:38",
+    "date_created_gmt": "2017-03-23T03:36:38",
+    "date_modified": "2017-03-23T00:36:38",
+    "date_modified_gmt": "2017-03-23T03:36:38",
+    "description": "",
+    "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+    "sku": "",
+    "price": "9.00",
+    "regular_price": "9.00",
+    "sale_price": "",
+    "date_on_sale_from": null,
+    "date_on_sale_from_gmt": null,
+    "date_on_sale_to": null,
+    "date_on_sale_to_gmt": null,
+    "on_sale": false,
+    "visible": true,
+    "purchasable": true,
+    "virtual": false,
+    "downloadable": false,
+    "downloads": [],
+    "download_limit": -1,
+    "download_expiry": -1,
+    "tax_status": "taxable",
+    "tax_class": "",
+    "manage_stock": false,
+    "stock_quantity": null,
+    "in_stock": true,
+    "backorders": "no",
+    "backorders_allowed": false,
+    "backordered": false,
+    "weight": "",
+    "dimensions": {
+      "length": "",
+      "width": "",
+      "height": ""
+    },
+    "shipping_class": "",
+    "shipping_class_id": 0,
+    "image": {
+      "id": 423,
+      "date_created": "2016-10-19T12:21:14",
+      "date_created_gmt": "2016-10-19T16:21:14",
+      "date_modified": "2016-10-19T12:21:14",
+      "date_modified_gmt": "2016-10-19T16:21:14",
+      "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+      "name": "",
+      "alt": "",
+      "position": 0
+    },
+    "attributes": [
+      {
+        "id": 6,
+        "name": "Color",
+        "option": "Black"
+      }
+    ],
+    "menu_order": 0,
+    "meta_data": [],
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/variations/732"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/22"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
slugstringLimit result set to products with a specific slug.
statusstringLimit result set to products assigned a specific status. Options: any, draft, pending, private and publish. Default is any.
typestringLimit result set to products assigned a specific type. Options: simple, grouped, external and variable.
skustringLimit result set to products with a specific SKU.
featuredbooleanLimit result set to featured products.
categorystringLimit result set to products assigned a specific category ID.
tagstringLimit result set to products assigned a specific tag ID.
shipping_classstringLimit result set to products assigned a specific shipping class ID.
attributestringLimit result set to products with a specific attribute.
attribute_termstringLimit result set to products with a specific attribute term ID (required an assigned attribute).
tax_classstringLimit result set to products with a specific tax class. Default options: standard, reduced-rate and zero-rate.
in_stockbooleanLimit result set to products in stock or out of stock.
on_salebooleanLimit result set to products on sale.
min_pricestringLimit result set to products based on a minimum price.
max_pricestringLimit result set to products based on a maximum price.
+

Update a product variation

+

This API lets you make changes to a product variation.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/<product_id>/variations/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/22/variations/733 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "regular_price": "10.00"
+}'
+
const data = {
+  regular_price: "10.00"
+};
+
+WooCommerce.put("products/22/variations/733", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => '10.00'
+];
+
+print_r($woocommerce->put('products/22/variations/733', $data));
+?>
+
data = {
+    "regular_price": "10.00"
+}
+
+print(wcapi.put("products/22/variations/733", data).json())
+
data = {
+  regular_price: "10.00"
+}
+
+woocommerce.put("products/22/variations/733", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 733,
+  "date_created": "2017-03-23T00:53:11",
+  "date_created_gmt": "2017-03-23T03:53:11",
+  "date_modified": "2017-03-23T00:53:11",
+  "date_modified_gmt": "2017-03-23T03:53:11",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+  "sku": "",
+  "price": "10.00",
+  "regular_price": "10.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "visible": true,
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 425,
+    "date_created": "2016-10-19T12:21:16",
+    "date_created_gmt": "2016-10-19T16:21:16",
+    "date_modified": "2016-10-19T12:21:16",
+    "date_modified_gmt": "2016-10-19T16:21:16",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+    "name": "",
+    "alt": "",
+    "position": 0
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Green"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations/733"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22"
+      }
+    ]
+  }
+}
+

Delete a product variation

+

This API helps you delete a product variation.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/<product_id>/variations/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/products/22/variations/733?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/22/variations/733", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/22/variations/733', ['force' => true])); ?>
+
print(wcapi.delete("products/22/variations/733", params={"force": True}).json())
+
woocommerce.delete("products/22/variations/733", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 733,
+  "date_created": "2017-03-23T00:53:11",
+  "date_created_gmt": "2017-03-23T03:53:11",
+  "date_modified": "2017-03-23T00:53:11",
+  "date_modified_gmt": "2017-03-23T03:53:11",
+  "description": "",
+  "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+  "sku": "",
+  "price": "10.00",
+  "regular_price": "10.00",
+  "sale_price": "",
+  "date_on_sale_from": null,
+  "date_on_sale_from_gmt": null,
+  "date_on_sale_to": null,
+  "date_on_sale_to_gmt": null,
+  "on_sale": false,
+  "visible": true,
+  "purchasable": true,
+  "virtual": false,
+  "downloadable": false,
+  "downloads": [],
+  "download_limit": -1,
+  "download_expiry": -1,
+  "tax_status": "taxable",
+  "tax_class": "",
+  "manage_stock": false,
+  "stock_quantity": null,
+  "in_stock": true,
+  "backorders": "no",
+  "backorders_allowed": false,
+  "backordered": false,
+  "weight": "",
+  "dimensions": {
+    "length": "",
+    "width": "",
+    "height": ""
+  },
+  "shipping_class": "",
+  "shipping_class_id": 0,
+  "image": {
+    "id": 425,
+    "date_created": "2016-10-19T12:21:16",
+    "date_created_gmt": "2016-10-19T16:21:16",
+    "date_modified": "2016-10-19T12:21:16",
+    "date_modified_gmt": "2016-10-19T16:21:16",
+    "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+    "name": "",
+    "alt": "",
+    "position": 0
+  },
+  "attributes": [
+    {
+      "id": 6,
+      "name": "Color",
+      "option": "Green"
+    }
+  ],
+  "menu_order": 0,
+  "meta_data": [],
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations/733"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/22"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product variations

+

This API helps you to batch create, update and delete multiple product variations.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/<product_id>/variations/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/products/22/variations/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "regular_price": "10.00",
+      "attributes": [
+        {
+          "id": 6,
+          "option": "Blue"
+        }
+      ]
+    },
+    {
+      "regular_price": "10.00",
+      "attributes": [
+        {
+          "id": 6,
+          "option": "White"
+        }
+      ]
+    }
+  ],
+  "update": [
+    {
+      "id": 733,
+      "regular_price": "10.00"
+    }
+  ],
+  "delete": [
+    732
+  ]
+}'
+
const data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+};
+
+WooCommerce.post("products/22/variations/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'Blue'
+                ]
+            ]
+        ],
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'White'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 733,
+            'regular_price' => '10.00'
+        ]
+    ],
+    'delete' => [
+        732
+    ]
+];
+
+print_r($woocommerce->post('products/22/variations/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "Blue"
+                }
+            ]
+        },
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "White"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 733,
+            "regular_price": "10.00"
+        }
+    ],
+    "delete": [
+        732
+    ]
+}
+
+print(wcapi.post("products/22/variations/batch", data).json())
+
data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+}
+
+woocommerce.post("products/22/variations/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 735,
+      "date_created": "2017-03-23T01:19:37",
+      "date_created_gmt": "2017-03-23T04:19:37",
+      "date_modified": "2017-03-23T01:19:37",
+      "date_modified_gmt": "2017-03-23T04:19:37",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=blue",
+      "sku": "",
+      "price": "10.00",
+      "regular_price": "10.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "visible": true,
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 0,
+        "date_created": "2017-03-22T22:19:40",
+        "date_created_gmt": "2017-03-23T04:19:40",
+        "date_modified": "2017-03-22T22:19:40",
+        "date_modified_gmt": "2017-03-23T04:19:40",
+        "src": "https://example.com/wp-content/plugins/woocommerce/assets/images/placeholder.png",
+        "name": "Placeholder",
+        "alt": "Placeholder",
+        "position": 0
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Blue"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations/735"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22"
+          }
+        ]
+      }
+    },
+    {
+      "id": 736,
+      "date_created": "2017-03-23T01:19:40",
+      "date_created_gmt": "2017-03-23T04:19:40",
+      "date_modified": "2017-03-23T01:19:40",
+      "date_modified_gmt": "2017-03-23T04:19:40",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=white",
+      "sku": "",
+      "price": "10.00",
+      "regular_price": "10.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "visible": true,
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 0,
+        "date_created": "2017-03-22T22:19:42",
+        "date_created_gmt": "2017-03-23T04:19:42",
+        "date_modified": "2017-03-22T22:19:42",
+        "date_modified_gmt": "2017-03-23T04:19:42",
+        "src": "https://example.com/wp-content/plugins/woocommerce/assets/images/placeholder.png",
+        "name": "Placeholder",
+        "alt": "Placeholder",
+        "position": 0
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "White"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations/736"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 733,
+      "date_created": "2017-03-23T00:53:11",
+      "date_created_gmt": "2017-03-23T03:53:11",
+      "date_modified": "2017-03-23T00:53:11",
+      "date_modified_gmt": "2017-03-23T03:53:11",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
+      "sku": "",
+      "price": "10.00",
+      "regular_price": "10.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "visible": true,
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 425,
+        "date_created": "2016-10-19T12:21:16",
+        "date_created_gmt": "2016-10-19T16:21:16",
+        "date_modified": "2016-10-19T12:21:16",
+        "date_modified_gmt": "2016-10-19T16:21:16",
+        "src": "https://example.com/wp-content/uploads/2016/10/T_3_front-12.jpg",
+        "name": "",
+        "alt": "",
+        "position": 0
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Green"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations/733"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 732,
+      "date_created": "2017-03-23T00:36:38",
+      "date_created_gmt": "2017-03-23T03:36:38",
+      "date_modified": "2017-03-23T00:36:38",
+      "date_modified_gmt": "2017-03-23T03:36:38",
+      "description": "",
+      "permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=black",
+      "sku": "",
+      "price": "9.00",
+      "regular_price": "9.00",
+      "sale_price": "",
+      "date_on_sale_from": null,
+      "date_on_sale_from_gmt": null,
+      "date_on_sale_to": null,
+      "date_on_sale_to_gmt": null,
+      "on_sale": false,
+      "visible": true,
+      "purchasable": true,
+      "virtual": false,
+      "downloadable": false,
+      "downloads": [],
+      "download_limit": -1,
+      "download_expiry": -1,
+      "tax_status": "taxable",
+      "tax_class": "",
+      "manage_stock": false,
+      "stock_quantity": null,
+      "in_stock": true,
+      "backorders": "no",
+      "backorders_allowed": false,
+      "backordered": false,
+      "weight": "",
+      "dimensions": {
+        "length": "",
+        "width": "",
+        "height": ""
+      },
+      "shipping_class": "",
+      "shipping_class_id": 0,
+      "image": {
+        "id": 423,
+        "date_created": "2016-10-19T12:21:14",
+        "date_created_gmt": "2016-10-19T16:21:14",
+        "date_modified": "2016-10-19T12:21:14",
+        "date_modified_gmt": "2016-10-19T16:21:14",
+        "src": "https://example.com/wp-content/uploads/2016/10/T_4_front-12.jpg",
+        "name": "",
+        "alt": "",
+        "position": 0
+      },
+      "attributes": [
+        {
+          "id": 6,
+          "name": "Color",
+          "option": "Black"
+        }
+      ],
+      "menu_order": 0,
+      "meta_data": [],
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations/732"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22/variations"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/22"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product attributes

+

The product attributes API allows you to create, view, update, and delete individual, or a batch, of product attributes.

+

Product attribute properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringAttribute name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
typestringType of attribute. By default only select is supported.
order_bystringDefault sort order. Options: menu_order, name, name_num and id. Default is menu_order.
has_archivesbooleanEnable/Disable attribute archives. Default is false.
+

Create a product attribute

+

This API helps you to create a new product attribute.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/attributes
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/products/attributes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true
+}'
+
const data = {
+  name: "Color",
+  slug: "pa_color",
+  type: "select",
+  order_by: "menu_order",
+  has_archives: true
+};
+
+WooCommerce.post("products/attributes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Color',
+    'slug' => 'pa_color',
+    'type' => 'select',
+    'order_by' => 'menu_order',
+    'has_archives' => true
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+
data = {
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": True
+}
+
+print(wcapi.post("products/attributes", data).json())
+
data = {
+  name: "Color",
+  slug: "pa_color",
+  type: "select",
+  order_by: "menu_order",
+  has_archives: true
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes"
+      }
+    ]
+  }
+}
+

Retrieve a product attribute

+

This API lets you retrieve and view a specific product attribute by ID.

+ +
+
+ GET +
/wp-json/wc/v2/products/attributes/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/attributes/1 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/1")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/1')); ?>
+
print(wcapi.get("products/attributes/1").json())
+
woocommerce.get("products/attributes/1").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes"
+      }
+    ]
+  }
+}
+

List all product attributes

+

This API helps you to view all the product attributes.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/products/attributes
+
+
+
curl https://example.com/wp-json/wc/v2/products/attributes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes')); ?>
+
print(wcapi.get("products/attributes").json())
+
woocommerce.get("products/attributes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 1,
+    "name": "Color",
+    "slug": "pa_color",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": true,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/6"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 2,
+    "name": "Size",
+    "slug": "pa_size",
+    "type": "select",
+    "order_by": "menu_order",
+    "has_archives": false,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
+

Update a product attribute

+

This API lets you make changes to a product attribute.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/attributes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/attributes/1 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order_by": "name"
+}'
+
const data = {
+  order_by: "name"
+};
+
+WooCommerce.put("products/attributes/1", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'order_by' => 'name'
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+
data = {
+    "order_by": "name"
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+
data = {
+  order_by: "name"
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "name",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes"
+      }
+    ]
+  }
+}
+

Delete a product attribute

+

This API helps you delete a product attribute.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/attributes/<id>
+
+
+ + +
curl -X DELETE https://example.com/wp-json/wc/v2/products/attributes/1?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/attributes/1", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/attributes/1', ['force' => true])); ?>
+
print(wcapi.delete("products/attributes/1", params={"force": True}).json())
+
woocommerce.delete("products/attributes/1", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 1,
+  "name": "Color",
+  "slug": "pa_color",
+  "type": "select",
+  "order_by": "menu_order",
+  "has_archives": true,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/6"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product attributes

+

This API helps you to batch create, update and delete multiple product attributes.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/attributes/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/products/attributes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Brand"
+    },
+    {
+      "name": "Publisher"
+    }
+  ],
+  "update": [
+    {
+      "id": 2,
+      "order_by": "name"
+    }
+  ],
+  "delete": [
+    1
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Brand"
+    },
+    {
+      name: "Publisher"
+    }
+  ],
+  update: [
+    {
+      id: 2,
+      order_by: "name"
+    }
+  ],
+  delete: [
+    1
+  ]
+};
+
+WooCommerce.post("products/attributes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Brand'
+        ],
+        [
+            'name' => 'Publisher'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 2,
+            'order_by' => 'name'
+        ]
+    ],
+    'delete' => [
+        1
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Brand"
+        },
+        {
+            "name": "Publisher"
+        }
+    ],
+    "update": [
+        {
+            "id": 2,
+            "order_by": "name"
+        }
+    ],
+    "delete": [
+        1
+    ]
+}
+
+print(wcapi.post("products/attributes/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 2,
+      order_by: "name"
+    }
+  ],
+  delete: [
+    1
+  ]
+}
+
+woocommerce.post("products/attributes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 7,
+      "name": "Brand",
+      "slug": "pa_brand",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/7"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 8,
+      "name": "Publisher",
+      "slug": "pa_publisher",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/8"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 2,
+      "name": "Size",
+      "slug": "pa_size",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": false,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 1,
+      "name": "Color",
+      "slug": "pa_color",
+      "type": "select",
+      "order_by": "menu_order",
+      "has_archives": true,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/6"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product attribute terms

+

The product attribute terms API allows you to create, view, update, and delete individual, or a batch, of attribute terms.

+

Product attribute term properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringTerm name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
menu_orderintegerMenu order, used to custom sort the resource.
countintegerNumber of published products for the resource. read-only
+

Create an attribute term

+

This API helps you to create a new product attribute term.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/attributes/<attribute_id>/terms
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/products/attributes/2/terms \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "XXS"
+}'
+
const data = {
+  name: "XXS"
+};
+
+WooCommerce.post("products/attributes/2/terms", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'XXS'
+];
+
+print_r($woocommerce->post('products/attributes/2/terms', $data));
+?>
+
data = {
+    "name": "XXS"
+}
+
+print(wcapi.post("products/attributes/2/terms", data).json())
+
data = {
+  name: "XXS"
+}
+
+woocommerce.post("products/attributes/2/terms", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Retrieve an attribute term

+

This API lets you retrieve a product attribute term by ID.

+ +
+
+ GET +
/wp-json/wc/v2/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/attributes/2/terms/23 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/2/terms/23")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/2/terms/23')); ?>
+
print(wcapi.get("products/attributes/2/terms/23").json())
+
woocommerce.get("products/attributes/2/terms/23").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

List all attribute terms

+

This API lets you retrieve all terms from a product attribute.

+ +
+
+ GET +
/wp-json/wc/v2/products/attributes/<attribute_id>/terms
+
+
+
curl https://example.com/wp-json/wc/v2/products/attributes/2/terms \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/attributes/2/terms")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/attributes/2/terms')); ?>
+
print(wcapi.get("products/attributes/2/terms").json())
+
woocommerce.get("products/attributes/2/terms").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 23,
+    "name": "XXS",
+    "slug": "xxs",
+    "description": "",
+    "menu_order": 1,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/23"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 22,
+    "name": "XS",
+    "slug": "xs",
+    "description": "",
+    "menu_order": 2,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/22"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 17,
+    "name": "S",
+    "slug": "s",
+    "description": "",
+    "menu_order": 3,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/17"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 18,
+    "name": "M",
+    "slug": "m",
+    "description": "",
+    "menu_order": 4,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/18"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 19,
+    "name": "L",
+    "slug": "l",
+    "description": "",
+    "menu_order": 5,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/19"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 20,
+    "name": "XL",
+    "slug": "xl",
+    "description": "",
+    "menu_order": 6,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/20"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  },
+  {
+    "id": 21,
+    "name": "XXL",
+    "slug": "xxl",
+    "description": "",
+    "menu_order": 7,
+    "count": 1,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/21"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
parentintegerLimit result set to resources assigned to a specific parent.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update an attribute term

+

This API lets you make changes to a product attribute term.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/attributes/2/terms/23 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "XXS"
+}'
+
const data = {
+  name: "XXS"
+};
+
+WooCommerce.put("products/attributes/2/terms/23", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'XXS'
+];
+
+print_r($woocommerce->put('products/attributes/2/terms/23', $data));
+?>
+
data = {
+    "name": "XXS"
+}
+
+print(wcapi.put("products/attributes/2/terms/23", data).json())
+
data = {
+  name: "XXS"
+}
+
+woocommerce.put("products/attributes/2/terms/23", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Delete an attribute term

+

This API helps you delete a product attribute term.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/attributes/<attribute_id>/terms/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/products/attributes/2/terms/23?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/attributes/2/terms/23", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/attributes/2/terms/23', ['force' => true])); ?>
+
print(wcapi.delete("products/attributes/2/terms/23", params={"force": True}).json())
+
woocommerce.delete("products/attributes/2/terms/23", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 23,
+  "name": "XXS",
+  "slug": "xxs",
+  "description": "",
+  "menu_order": 1,
+  "count": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/23"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update attribute terms

+

This API helps you to batch create, update and delete multiple product attribute terms.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/attributes/<attribute_id>/terms/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/products/attributes/&lt;attribute_id&gt;/terms/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "XXS"
+    },
+    {
+      "name": "S"
+    }
+  ],
+  "update": [
+    {
+      "id": 19,
+      "menu_order": 6
+    }
+  ],
+  "delete": [
+    21,
+    20
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "XXS"
+    },
+    {
+      name: "S"
+    }
+  ],
+  update: [
+    {
+      id: 19,
+      menu_order: 6
+    }
+  ],
+  delete: [
+    21,
+    20
+  ]
+};
+
+WooCommerce.post("products/attributes/2/terms/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'XXS'
+        ],
+        [
+            'name' => 'S'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 19,
+            'menu_order' => 6
+        ]
+    ],
+    'delete' => [
+        21,
+        20
+    ]
+];
+
+print_r($woocommerce->post('products/attributes/2/terms/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "XXS"
+        },
+        {
+            "name": "S"
+        }
+    ],
+    "update": [
+        {
+            "id": 19,
+            "menu_order": 6
+        }
+    ],
+    "delete": [
+        21,
+        20
+    ]
+}
+
+print(wcapi.post("products/attributes/2/terms/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "XXS"
+    },
+    {
+      name: "S"
+    }
+  ],
+  update: [
+    {
+      id: 19,
+      menu_order: 6
+    }
+  ],
+  delete: [
+    21,
+    20
+  ]
+}
+
+woocommerce.post("products/attributes/2/terms/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 23,
+      "name": "XXS",
+      "slug": "xxs",
+      "description": "",
+      "menu_order": 1,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/23"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+          }
+        ]
+      }
+    },
+    {
+      "id": 17,
+      "name": "S",
+      "slug": "s",
+      "description": "",
+      "menu_order": 3,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/17"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 19,
+      "name": "L",
+      "slug": "l",
+      "description": "",
+      "menu_order": 5,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/19"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 21,
+      "name": "XXL",
+      "slug": "xxl",
+      "description": "",
+      "menu_order": 7,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/21"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+          }
+        ]
+      }
+    },
+    {
+      "id": 20,
+      "name": "XL",
+      "slug": "xl",
+      "description": "",
+      "menu_order": 6,
+      "count": 1,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms/20"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/attributes/2/terms"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product categories

+

The product categories API allows you to create, view, update, and delete individual, or a batch, of categories.

+

Product category properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringCategory name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
parentintegerThe ID for the parent of the resource.
descriptionstringHTML description of the resource.
displaystringCategory archive display type. Options: default, products, subcategories and both. Default is default.
imageobjectImage data. See Product category - Image properties
menu_orderintegerMenu order, used to custom sort the resource.
countintegerNumber of published products for the resource. read-only
+

Product category - Image properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerImage ID.
date_createddate-timeThe date the image was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the image was created, as GMT read-only
date_modifieddate-timeThe date the image was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the image was last modified, as GMT. read-only
srcstringImage URL.
titlestringImage name.
altstringImage alternative text.
+

Create a product category

+

This API helps you to create a new product category.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/categories
+
+
+ +
+

Example of how to create a product category:

+
+
curl -X POST https://example.com/wp-json/wc/v2/products/categories \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Clothing",
+  "image": {
+    "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+}'
+
const data = {
+  name: "Clothing",
+  image: {
+    src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+};
+
+WooCommerce.post("products/categories", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Clothing',
+    'image' => [
+        'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
+    ]
+];
+
+print_r($woocommerce->post('products/categories', $data));
+?>
+
data = {
+    "name": "Clothing",
+    "image": {
+        "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+    }
+}
+
+print(wcapi.post("products/categories", data).json())
+
data = {
+  name: "Clothing",
+  image: {
+    src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
+  }
+}
+
+woocommerce.post("products/categories", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories"
+      }
+    ]
+  }
+}
+

Retrieve a product category

+

This API lets you retrieve a product category by ID.

+ +
+
+ GET +
/wp-json/wc/v2/products/categories/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/categories/9 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/categories/9")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/categories/9')); ?>
+
print(wcapi.get("products/categories/9").json())
+
woocommerce.get("products/categories/9").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories"
+      }
+    ]
+  }
+}
+

List all product categories

+

This API lets you retrieve all product categories.

+ +
+
+ GET +
/wp-json/wc/v2/products/categories
+
+
+
curl https://example.com/wp-json/wc/v2/products/categories \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/categories")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/categories')); ?>
+
print(wcapi.get("products/categories").json())
+
woocommerce.get("products/categories").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 15,
+    "name": "Albums",
+    "slug": "albums",
+    "parent": 11,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 4,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/15"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/11"
+        }
+      ]
+    }
+  },
+  {
+    "id": 9,
+    "name": "Clothing",
+    "slug": "clothing",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": {
+      "id": 730,
+      "date_created": "2017-03-23T00:01:07",
+      "date_created_gmt": "2017-03-23T03:01:07",
+      "date_modified": "2017-03-23T00:01:07",
+      "date_modified_gmt": "2017-03-23T03:01:07",
+      "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+      "title": "",
+      "alt": ""
+    },
+    "menu_order": 0,
+    "count": 36,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example/wp-json/wc/v2/products/categories/9"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example/wp-json/wc/v2/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 10,
+    "name": "Hoodies",
+    "slug": "hoodies",
+    "parent": 9,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 6,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/10"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+        }
+      ]
+    }
+  },
+  {
+    "id": 11,
+    "name": "Music",
+    "slug": "music",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 7,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/11"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 12,
+    "name": "Posters",
+    "slug": "posters",
+    "parent": 0,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 5,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/12"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories"
+        }
+      ]
+    }
+  },
+  {
+    "id": 13,
+    "name": "Singles",
+    "slug": "singles",
+    "parent": 11,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 3,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/13"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/11"
+        }
+      ]
+    }
+  },
+  {
+    "id": 14,
+    "name": "T-shirts",
+    "slug": "t-shirts",
+    "parent": 9,
+    "description": "",
+    "display": "default",
+    "image": [],
+    "menu_order": 0,
+    "count": 6,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/14"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
parentintegerLimit result set to resources assigned to a specific parent.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a product category

+

This API lets you make changes to a product category.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/categories/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/categories/9 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "All kinds of clothes."
+}'
+
const data = {
+  description: "All kinds of clothes."
+};
+
+WooCommerce.put("products/categories/9", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description' => 'All kinds of clothes.'
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+
data = {
+    "description": "All kinds of clothes."
+}
+
+print(wcapi.put("products/categories/9", data).json())
+
data = {
+  description: "All kinds of clothes."
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "All kinds of clothes.",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories"
+      }
+    ]
+  }
+}
+

Delete a product category

+

This API helps you delete a product category.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/categories/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/products/categories/9?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/categories/9", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/categories/9', ['force' => true])); ?>
+
print(wcapi.delete("products/categories/9", params={"force": True}).json())
+
woocommerce.delete("products/categories/9", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 9,
+  "name": "Clothing",
+  "slug": "clothing",
+  "parent": 0,
+  "description": "All kinds of clothes.",
+  "display": "default",
+  "image": {
+    "id": 730,
+    "date_created": "2017-03-23T00:01:07",
+    "date_created_gmt": "2017-03-23T03:01:07",
+    "date_modified": "2017-03-23T00:01:07",
+    "date_modified_gmt": "2017-03-23T03:01:07",
+    "src": "https://example.com/wp-content/uploads/2017/03/T_2_front.jpg",
+    "title": "",
+    "alt": ""
+  },
+  "menu_order": 0,
+  "count": 36,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/categories"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product categories

+

This API helps you to batch create, update and delete multiple product categories.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/categories/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/products/categories/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Albums"
+    },
+    {
+      "name": "Clothing"
+    }
+  ],
+  "update": [
+    {
+      "id": 10,
+      "description": "Nice hoodies"
+    }
+  ],
+  "delete": [
+    11,
+    12
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Albums"
+    },
+    {
+      name: "Clothing"
+    }
+  ],
+  update: [
+    {
+      id: 10,
+      description: "Nice hoodies"
+    }
+  ],
+  delete: [
+    11,
+    12
+  ]
+};
+
+WooCommerce.post("products/categories/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Albums'
+        ],
+        [
+            'name' => 'Clothing'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 10,
+            'description' => 'Nice hoodies'
+        ]
+    ],
+    'delete' => [
+        11,
+        12
+    ]
+];
+
+print_r($woocommerce->post('products/categories/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Albums"
+        },
+        {
+            "name": "Clothing"
+        }
+    ],
+    "update": [
+        {
+            "id": 10,
+            "description": "Nice hoodies"
+        }
+    ],
+    "delete": [
+        11,
+        12
+    ]
+}
+
+print(wcapi.post("products/categories/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Albums"
+    },
+    {
+      name: "Clothing"
+    }
+  ],
+  update: [
+    {
+      id: 10,
+      description: "Nice hoodies"
+    }
+  ],
+  delete: [
+    11,
+    12
+  ]
+}
+
+woocommerce.post("products/categories/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 15,
+      "name": "Albums",
+      "slug": "albums",
+      "parent": 11,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/15"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/11"
+          }
+        ]
+      }
+    },
+    {
+      "id": 9,
+      "name": "Clothing",
+      "slug": "clothing",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 10,
+      "name": "Hoodies",
+      "slug": "hoodies",
+      "parent": 9,
+      "description": "Nice hoodies",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 6,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/10"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories"
+          }
+        ],
+        "up": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/9"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 11,
+      "name": "Music",
+      "slug": "music",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 7,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/11"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories"
+          }
+        ]
+      }
+    },
+    {
+      "id": 12,
+      "name": "Posters",
+      "slug": "posters",
+      "parent": 0,
+      "description": "",
+      "display": "default",
+      "image": [],
+      "menu_order": 0,
+      "count": 5,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories/12"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/categories"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product shipping classes

+

The product shipping class API allows you to create, view, update, and delete individual, or a batch, of shipping classes.

+

Product shipping class properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringShipping class name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
countintegerNumber of published products for the resource. read-only
+

Create a shipping class

+

This API helps you to create a new product shipping class.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/shipping_classes
+
+
+ +
+

Example of how to create a product shipping class:

+
+
curl -X POST https://example.com/wp-json/wc/v2/products/shipping_classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Priority"
+}'
+
const data = {
+  name: "Priority"
+};
+
+WooCommerce.post("products/shipping_classes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Priority'
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+
data = {
+    "name": "Priority"
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+
data = {
+  name: "Priority"
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Retrieve a shipping class

+

This API lets you retrieve a product shipping class by ID.

+ +
+
+ GET +
/wp-json/wc/v2/products/shipping_classes/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/shipping_classes/32 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/shipping_classes/32")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/shipping_classes/32')); ?>
+
print(wcapi.get("products/shipping_classes/32").json())
+
woocommerce.get("products/shipping_classes/32").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+      }
+    ]
+  }
+}
+

List all shipping classes

+

This API lets you retrieve all product shipping classes.

+ +
+
+ GET +
/wp-json/wc/v2/products/shipping_classes
+
+
+
curl https://example.com/wp-json/wc/v2/products/shipping_classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/shipping_classes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+
print(wcapi.get("products/shipping_classes").json())
+
woocommerce.get("products/shipping_classes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 33,
+    "name": "Express",
+    "slug": "express",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/33"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 32,
+    "name": "Priority",
+    "slug": "priority",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/32"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a shipping class

+

This API lets you make changes to a product shipping class.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/shipping_classes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/shipping_classes/32 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "Priority mail."
+}'
+
const data = {
+  description: "Priority mail."
+};
+
+WooCommerce.put("products/shipping_classes/32", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description' => 'Priority mail.'
+];
+
+print_r($woocommerce->put('products/shipping_classes/32', $data));
+?>
+
data = {
+    "description": "Priority mail."
+}
+
+print(wcapi.put("products/shipping_classes/32", data).json())
+
data = {
+  description: "Priority mail."
+}
+
+woocommerce.put("products/shipping_classes/32", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "Priority mail.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Delete a shipping class

+

This API helps you delete a product shipping class.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/shipping_classes/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/products/shipping_classes/32?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/shipping_classes/32", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/shipping_classes/32', ['force' => true])); ?>
+
print(wcapi.delete("products/shipping_classes/32", params={"force": True}).json())
+
woocommerce.delete("products/shipping_classes/32", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 32,
+  "name": "Priority",
+  "slug": "priority",
+  "description": "Priority mail.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/32"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update shipping classes

+

This API helps you to batch create, update and delete multiple product shipping classes.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/shipping_classes/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/products/shipping_classes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Small items"
+    },
+    {
+      "name": "Large items"
+    }
+  ],
+  "update": [
+    {
+      "id": 33,
+      "description": "Express shipping"
+    }
+  ],
+  "delete": [
+    32
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Small items"
+    },
+    {
+      name: "Large items"
+    }
+  ],
+  update: [
+    {
+      id: 33,
+      description: "Express shipping"
+    }
+  ],
+  delete: [
+    32
+  ]
+};
+
+WooCommerce.post("products/shipping_classes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Small items'
+        ],
+        [
+            'name' => 'Large items'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 33,
+            'description' => 'Express shipping'
+        ]
+    ],
+    'delete' => [
+        32
+    ]
+];
+
+print_r($woocommerce->post('products/shipping_classes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Small items"
+        },
+        {
+            "name": "Large items"
+        }
+    ],
+    "update": [
+        {
+            "id": 33,
+            "description": "Express shipping"
+        }
+    ],
+    "delete": [
+        32
+    ]
+}
+
+print(wcapi.post("products/shipping_classes/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Small items"
+    },
+    {
+      name: "Large items"
+    }
+  ],
+  update: [
+    {
+      id: 33,
+      description: "Express shipping"
+    }
+  ],
+  delete: [
+    32
+  ]
+}
+
+woocommerce.post("products/shipping_classes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 34,
+      "name": "Small items",
+      "slug": "small-items",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/34"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 35,
+      "name": "Large items",
+      "slug": "large-items",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/35"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 33,
+      "name": "Express",
+      "slug": "express",
+      "description": "Express shipping",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/33"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 32,
+      "name": "Priority",
+      "slug": "priority",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes/32"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/shipping_classes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Product tags

+

The product tags API allows you to create, view, update, and delete individual, or a batch, of product tags.

+

Product tag properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringTag name. mandatory
slugstringAn alphanumeric identifier for the resource unique to its type.
descriptionstringHTML description of the resource.
countintegerNumber of published products for the resource. read-only
+

Create a product tag

+

This API helps you to create a new product tag.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/tags
+
+
+ +
+

Example of how to create a product tag:

+
+
curl -X POST https://example.com/wp-json/wc/v2/products/tags \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Leather Shoes"
+}'
+
const data = {
+  name: "Leather Shoes"
+};
+
+WooCommerce.post("products/tags", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Leather Shoes'
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+
data = {
+    "name": "Leather Shoes"
+}
+
+print(wcapi.post("products/tags", data).json())
+
data = {
+  name: "Leather Shoes"
+}
+
+woocommerce.post("products/tags", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags"
+      }
+    ]
+  }
+}
+

Retrieve a product tag

+

This API lets you retrieve a product tag by ID.

+ +
+
+ GET +
/wp-json/wc/v2/products/tags/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/products/tags/34 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags/34")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags/34')); ?>
+
print(wcapi.get("products/tags/34").json())
+
woocommerce.get("products/tags/34").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags"
+      }
+    ]
+  }
+}
+

List all product tags

+

This API lets you retrieve all product tag.

+ +
+
+ GET +
/wp-json/wc/v2/products/tags
+
+
+
curl https://example.com/wp-json/wc/v2/products/tags \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("products/tags")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('products/tags')); ?>
+
print(wcapi.get("products/tags").json())
+
woocommerce.get("products/tags").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 34,
+    "name": "Leather Shoes",
+    "slug": "leather-shoes",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/tags/34"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/tags"
+        }
+      ]
+    }
+  },
+  {
+    "id": 35,
+    "name": "Oxford Shoes",
+    "slug": "oxford-shoes",
+    "description": "",
+    "count": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/tags/35"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/tags"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
excludearrayEnsure result set excludes specific ids.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is asc.
orderbystringSort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name.
hide_emptybooleanWhether to hide resources not assigned to any products. Default is false.
productintegerLimit result set to resources assigned to a specific product.
slugstringLimit result set to resources with a specific slug.
+

Update a product tag

+

This API lets you make changes to a product tag.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/products/tags/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/products/tags/34 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "description": "Genuine leather."
+}'
+
const data = {
+  description: "Genuine leather."
+};
+
+WooCommerce.put("products/tags/34", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'description': 'Genuine leather.'
+];
+
+print_r($woocommerce->put('products/tags/34', $data));
+?>
+
data = {
+    "description": "Genuine leather."
+}
+
+print(wcapi.put("products/tags/34", data).json())
+
data = {
+  description: "Genuine leather."
+}
+
+woocommerce.put("products/tags/34", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "Genuine leather.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags"
+      }
+    ]
+  }
+}
+

Delete a product tag

+

This API helps you delete a product tag.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/products/tags/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/products/tags/34?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("products/tags/34", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('products/tags/34', ['force' => true])); ?>
+
print(wcapi.delete("products/tags/34", params={"force": True}).json())
+
woocommerce.delete("products/tags/34", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 34,
+  "name": "Leather Shoes",
+  "slug": "leather-shoes",
+  "description": "Genuine leather.",
+  "count": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags/34"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/products/tags"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update product tags

+

This API helps you to batch create, update and delete multiple product tags.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/products/tags/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/products/tags/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Round toe"
+    },
+    {
+      "name": "Flat"
+    }
+  ],
+  "update": [
+    {
+      "id": 34,
+      "description": "Genuine leather."
+    }
+  ],
+  "delete": [
+    35
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 34,
+      description: "Genuine leather."
+    }
+  ],
+  delete: [
+    35
+  ]
+};
+
+WooCommerce.post("products/tags/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Round toe'
+        ],
+        [
+            'name' => 'Flat'
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 34,
+            'description' => 'Genuine leather.'
+        ]
+    ],
+    'delete' => [
+        35
+    ]
+];
+
+print_r($woocommerce->post('products/tags/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Round toe"
+        },
+        {
+            "name": "Flat"
+        }
+    ],
+    "update": [
+        {
+            "id": 34,
+            "description": "Genuine leather."
+        }
+    ],
+    "delete": [
+        35
+    ]
+}
+
+print(wcapi.post("products/tags/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe"
+    },
+    {
+      name: "Flat"
+    }
+  ],
+  update: [
+    {
+      id: 34,
+      description: "Genuine leather."
+    }
+  ],
+  delete: [
+    35
+  ]
+}
+
+woocommerce.post("products/tags/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 36,
+      "name": "Round toe",
+      "slug": "round-toe",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags/36"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags"
+          }
+        ]
+      }
+    },
+    {
+      "id": 37,
+      "name": "Flat",
+      "slug": "flat",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags/37"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags"
+          }
+        ]
+      }
+    }
+  ],
+  "update": [
+    {
+      "id": 34,
+      "name": "Leather Shoes",
+      "slug": "leather-shoes",
+      "description": "Genuine leather.",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags/34"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 35,
+      "name": "Oxford Shoes",
+      "slug": "oxford-shoes",
+      "description": "",
+      "count": 0,
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags/35"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/products/tags"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Reports

+

The reports API allows you to view all types of reports available.

+

List all reports

+

This API lets you retrieve and view a simple list of available reports.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/reports
+
+
+
curl https://example.com/wp-json/wc/v2/reports \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('reports')); ?>
+
print(wcapi.get("reports").json())
+
woocommerce.get("reports").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "slug": "sales",
+    "description": "List of sales reports.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports/sales"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "top_sellers",
+    "description": "List of top sellers products.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports/top_sellers"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports"
+        }
+      ]
+    }
+  }
+]
+

Retrieve sales report

+

This API lets you retrieve and view a sales report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/reports/sales
+
+
+
curl https://example.com/wp-json/wc/v2/reports/sales?date_min=2016-05-03&date_max=2016-05-04 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/sales", {
+  date_min: "2016-05-03",
+  date_max: "2016-05-04"
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$query = [
+    'date_min' => '2016-05-03', 
+    'date_max' => '2016-05-04'
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+
print(wcapi.get("reports/sales?date_min=2016-05-03&date_max=2016-05-04").json())
+
query = {
+  date_min: "2016-05-03",
+  date_max: "2016-05-04"
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "total_sales": "14.00",
+    "net_sales": "4.00",
+    "average_sales": "2.00",
+    "total_orders": 3,
+    "total_items": 6,
+    "total_tax": "0.00",
+    "total_shipping": "10.00",
+    "total_refunds": 0,
+    "total_discount": "0.00",
+    "totals_grouped_by": "day",
+    "totals": {
+      "2016-05-03": {
+        "sales": "14.00",
+        "orders": 3,
+        "items": 6,
+        "tax": "0.00",
+        "shipping": "10.00",
+        "discount": "0.00",
+        "customers": 0
+      },
+      "2016-05-04": {
+        "sales": "0.00",
+        "orders": 0,
+        "items": 0,
+        "tax": "0.00",
+        "shipping": "0.00",
+        "discount": "0.00",
+        "customers": 0
+      }
+    },
+    "total_customers": 0,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports"
+        }
+      ]
+    }
+  }
+]
+

Sales report properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
total_salesstringGross sales in the period. read-only
net_salesstringNet sales in the period. read-only
average_salesstringAverage net daily sales. read-only
total_ordersintegerTotal of orders placed. read-only
total_itemsintegerTotal of items purchased. read-only
total_taxstringTotal charged for taxes. read-only
total_shippingstringTotal charged for shipping. read-only
total_refundsnumberTotal of refunded orders. read-only
total_discountintegerTotal of coupons used. read-only
totals_grouped_bystringGroup type. read-only
totalsarrayTotals. read-only
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is today's date. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.
+

Retrieve top sellers report

+

This API lets you retrieve and view a list of top sellers report.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/reports/top_sellers
+
+
+
curl https://example.com/wp-json/wc/v2/reports/top_sellers?period=last_month \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("reports/top_sellers", {
+  period: "last_month"
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$query = [
+    'period' => 'last_month'
+];
+
+print_r($woocommerce->get('reports/top_sellers', $query));
+?>
+
print(wcapi.get("reports/top_sellers?period=last_month").json())
+
query = {
+  period: "last_month"
+}
+
+woocommerce.get("reports/top_sellers", query).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "title": "Happy Ninja",
+    "product_id": 37,
+    "quantity": 1,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/37"
+        }
+      ]
+    }
+  },
+  {
+    "title": "Woo Album #4",
+    "product_id": 96,
+    "quantity": 1,
+    "_links": {
+      "about": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/reports"
+        }
+      ],
+      "product": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/products/96"
+        }
+      ]
+    }
+  }
+]
+

Top sellers report properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
titlestringProduct title. read-only
product_idintegerProduct ID. read-only
quantityintegerTotal number of purchases. read-only
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Default is view. Options: view.
periodstringReport period. Default is week. Options: week, month, last_month and year
date_minstringReturn sales for a specific start date, the date need to be in the YYYY-MM-DD format.
date_maxstringReturn sales for a specific end date, the date need to be in the YYYY-MM-DD format.
+

Tax rates

+

The taxes API allows you to create, view, update, and delete individual tax rates, or a batch of tax rates.

+

Tax rate properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
countrystringCountry ISO 3166 code. See ISO 3166 Codes (Countries) for more details
statestringState code.
postcodestringPostcode/ZIP.
citystringCity name.
ratestringTax rate.
namestringTax rate name.
priorityintegerTax priority. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate. Default is 1.
compoundbooleanWhether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is false.
shippingbooleanWhether or not this tax rate also gets applied to shipping. Default is true.
orderintegerIndicates the order that will appear in queries.
classstringTax class. Default is standard.
+

Create a tax rate

+

This API helps you to create a new tax rate.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/taxes
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/taxes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "country": "US",
+  "state": "AL",
+  "rate": "4",
+  "name": "State Tax",
+  "shipping": false
+}'
+
const data = {
+  country: "US",
+  state: "AL",
+  rate: "4",
+  name: "State Tax",
+  shipping: false
+};
+
+WooCommerce.post("taxes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'country' => 'US',
+    'state' => 'AL',
+    'rate' => '4',
+    'name' => 'State Tax',
+    'shipping' => false
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+
data = {
+    "country": "US",
+    "state": "AL",
+    "rate": "4",
+    "name": "State Tax",
+    "shipping": False
+}
+
+print(wcapi.post("taxes", data).json())
+
data = {
+  country: "US",
+  state: "AL",
+  rate: "4",
+  name: "State Tax",
+  shipping: false
+}
+
+woocommerce.post("taxes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "State Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes"
+      }
+    ]
+  }
+}
+

Retrieve a tax rate

+

This API lets you retrieve and view a specific tax rate by ID.

+ +
+
+ GET +
/wp-json/wc/v2/taxes/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/taxes/72 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes/72")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes/72')); ?>
+
print(wcapi.get("taxes/72").json())
+
woocommerce.get("taxes/72").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "State Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes"
+      }
+    ]
+  }
+}
+

List all tax rates

+

This API helps you to view all the tax rates.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/taxes
+
+
+
curl https://example.com/wp-json/wc/v2/taxes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes')); ?>
+
print(wcapi.get("taxes").json())
+
woocommerce.get("taxes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 72,
+    "country": "US",
+    "state": "AL",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 1,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/72"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 73,
+    "country": "US",
+    "state": "AZ",
+    "postcode": "",
+    "city": "",
+    "rate": "5.6000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 2,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/73"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 74,
+    "country": "US",
+    "state": "AR",
+    "postcode": "",
+    "city": "",
+    "rate": "6.5000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 3,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/74"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 75,
+    "country": "US",
+    "state": "CA",
+    "postcode": "",
+    "city": "",
+    "rate": "7.5000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 4,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/75"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 76,
+    "country": "US",
+    "state": "CO",
+    "postcode": "",
+    "city": "",
+    "rate": "2.9000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 5,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/76"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 77,
+    "country": "US",
+    "state": "CT",
+    "postcode": "",
+    "city": "",
+    "rate": "6.3500",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 6,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/77"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 78,
+    "country": "US",
+    "state": "DC",
+    "postcode": "",
+    "city": "",
+    "rate": "5.7500",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 7,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/78"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 79,
+    "country": "US",
+    "state": "FL",
+    "postcode": "",
+    "city": "",
+    "rate": "6.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 8,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/79"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 80,
+    "country": "US",
+    "state": "GA",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": true,
+    "order": 9,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/80"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  },
+  {
+    "id": 81,
+    "country": "US",
+    "state": "GU",
+    "postcode": "",
+    "city": "",
+    "rate": "4.0000",
+    "name": "State Tax",
+    "priority": 0,
+    "compound": false,
+    "shipping": false,
+    "order": 10,
+    "class": "standard",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/81"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit.
pageintegerCurrent page of the collection.
per_pageintegerMaximum number of items to be returned in result set.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderbystringSort collection by object attribute. Default is name. Options: id, include, name, slug, term_group, description and count.
classstringSort by tax class.
+

Update a tax rate

+

This API lets you make changes to a tax rate.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/taxes/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/taxes/72 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "US Tax"
+}'
+
const data = {
+  name: "US Tax"
+};
+
+WooCommerce.put("taxes/72", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'US Tax'
+];
+
+print_r($woocommerce->put('taxes/72', $data));
+?>
+
data = {
+    "name": "US Tax"
+}
+
+print(wcapi.put("taxes/72", data).json())
+
data = {
+  name: "US Tax"
+}
+
+woocommerce.put("taxes/72", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "US Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes"
+      }
+    ]
+  }
+}
+

Delete a tax rate

+

This API helps you delete a tax rate.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/taxes/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/taxes/72?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("taxes/72", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('taxes/72', ['force' => true])); ?>
+
print(wcapi.delete("taxes/72", params={"force": True}).json())
+
woocommerce.delete("taxes/72", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 72,
+  "country": "US",
+  "state": "AL",
+  "postcode": "",
+  "city": "",
+  "rate": "4.0000",
+  "name": "US Tax",
+  "priority": 0,
+  "compound": false,
+  "shipping": false,
+  "order": 1,
+  "class": "standard",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes/72"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Batch update tax rates

+

This API helps you to batch create, update and delete multiple tax rates.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/taxes/batch
+
+
+ +
+

Example batch creating all US taxes:

+
+
curl -X POST https://example.com/wp-json/wc/v2/taxes/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "country": "US",
+      "state": "AL",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 1
+    },
+    {
+      "country": "US",
+      "state": "AZ",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 2
+    },
+    {
+      "country": "US",
+      "state": "AR",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 3
+    },
+    {
+      "country": "US",
+      "state": "CA",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 4
+    },
+    {
+      "country": "US",
+      "state": "CO",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 5
+    },
+    {
+      "country": "US",
+      "state": "CT",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 6
+    },
+    {
+      "country": "US",
+      "state": "DC",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 7
+    },
+    {
+      "country": "US",
+      "state": "FL",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 8
+    },
+    {
+      "country": "US",
+      "state": "GA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 9
+    },
+    {
+      "country": "US",
+      "state": "GU",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 10
+    },
+    {
+      "country": "US",
+      "state": "HI",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 11
+    },
+    {
+      "country": "US",
+      "state": "ID",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 12
+    },
+    {
+      "country": "US",
+      "state": "IL",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 13
+    },
+    {
+      "country": "US",
+      "state": "IN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 14
+    },
+    {
+      "country": "US",
+      "state": "IA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 15
+    },
+    {
+      "country": "US",
+      "state": "KS",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 16
+    },
+    {
+      "country": "US",
+      "state": "KY",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 17
+    },
+    {
+      "country": "US",
+      "state": "LA",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 18
+    },
+    {
+      "country": "US",
+      "state": "ME",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 19
+    },
+    {
+      "country": "US",
+      "state": "MD",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 20
+    },
+    {
+      "country": "US",
+      "state": "MA",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 21
+    },
+    {
+      "country": "US",
+      "state": "MI",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 22
+    },
+    {
+      "country": "US",
+      "state": "MN",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 23
+    },
+    {
+      "country": "US",
+      "state": "MS",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 24
+    },
+    {
+      "country": "US",
+      "state": "MO",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 25
+    },
+    {
+      "country": "US",
+      "state": "NE",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 26
+    },
+    {
+      "country": "US",
+      "state": "NV",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 27
+    },
+    {
+      "country": "US",
+      "state": "NJ",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 28
+    },
+    {
+      "country": "US",
+      "state": "NM",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 29
+    },
+    {
+      "country": "US",
+      "state": "NY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 30
+    },
+    {
+      "country": "US",
+      "state": "NC",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 31
+    },
+    {
+      "country": "US",
+      "state": "ND",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 32
+    },
+    {
+      "country": "US",
+      "state": "OH",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 33
+    },
+    {
+      "country": "US",
+      "state": "OK",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 34
+    },
+    {
+      "country": "US",
+      "state": "PA",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 35
+    },
+    {
+      "country": "US",
+      "state": "PR",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 36
+    },
+    {
+      "country": "US",
+      "state": "RI",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 37
+    },
+    {
+      "country": "US",
+      "state": "SC",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 38
+    },
+    {
+      "country": "US",
+      "state": "SD",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 39
+    },
+    {
+      "country": "US",
+      "state": "TN",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 40
+    },
+    {
+      "country": "US",
+      "state": "TX",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 41
+    },
+    {
+      "country": "US",
+      "state": "UT",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 42
+    },
+    {
+      "country": "US",
+      "state": "VT",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 43
+    },
+    {
+      "country": "US",
+      "state": "VA",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "shipping": false,
+      "order": 44
+    },
+    {
+      "country": "US",
+      "state": "WA",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 45
+    },
+    {
+      "country": "US",
+      "state": "WV",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 46
+    },
+    {
+      "country": "US",
+      "state": "WI",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 47
+    },
+    {
+      "country": "US",
+      "state": "WY",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "shipping": true,
+      "order": 48
+    }
+  ]
+}'
+
const data = {
+  create: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+};
+
+WooCommerce.post("taxes/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'country' => 'US',
+            'state' => 'AL',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 1
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AZ',
+            'rate' => '5.6000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 2
+        ],
+        [
+            'country' => 'US',
+            'state' => 'AR',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 3
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CA',
+            'rate' => '7.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 4
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CO',
+            'rate' => '2.9000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 5
+        ],
+        [
+            'country' => 'US',
+            'state' => 'CT',
+            'rate' => '6.3500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 6
+        ],
+        [
+            'country' => 'US',
+            'state' => 'DC',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 7
+        ],
+        [
+            'country' => 'US',
+            'state' => 'FL',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 8
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 9
+        ],
+        [
+            'country' => 'US',
+            'state' => 'GU',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 10
+        ],
+        [
+            'country' => 'US',
+            'state' => 'HI',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 11
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ID',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 12
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IL',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 13
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 14
+        ],
+        [
+            'country' => 'US',
+            'state' => 'IA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 15
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KS',
+            'rate' => '6.1500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 16
+        ],
+        [
+            'country' => 'US',
+            'state' => 'KY',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 17
+        ],
+        [
+            'country' => 'US',
+            'state' => 'LA',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 18
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ME',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 19
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MD',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 20
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MA',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 21
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MI',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 22
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MN',
+            'rate' => '6.8750',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 23
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MS',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 24
+        ],
+        [
+            'country' => 'US',
+            'state' => 'MO',
+            'rate' => '4.2250',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 25
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NE',
+            'rate' => '5.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 26
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NV',
+            'rate' => '6.8500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 27
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NJ',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 28
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NM',
+            'rate' => '5.1250',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 29
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 30
+        ],
+        [
+            'country' => 'US',
+            'state' => 'NC',
+            'rate' => '4.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 31
+        ],
+        [
+            'country' => 'US',
+            'state' => 'ND',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 32
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OH',
+            'rate' => '5.7500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 33
+        ],
+        [
+            'country' => 'US',
+            'state' => 'OK',
+            'rate' => '4.5000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 34
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PA',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 35
+        ],
+        [
+            'country' => 'US',
+            'state' => 'PR',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 36
+        ],
+        [
+            'country' => 'US',
+            'state' => 'RI',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 37
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SC',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 38
+        ],
+        [
+            'country' => 'US',
+            'state' => 'SD',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 39
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TN',
+            'rate' => '7.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 40
+        ],
+        [
+            'country' => 'US',
+            'state' => 'TX',
+            'rate' => '6.2500',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 41
+        ],
+        [
+            'country' => 'US',
+            'state' => 'UT',
+            'rate' => '5.9500',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 42
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VT',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 43
+        ],
+        [
+            'country' => 'US',
+            'state' => 'VA',
+            'rate' => '5.3000',
+            'name' => 'State Tax',
+            'shipping' => false,
+            'order' => 44
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WA',
+            'rate' => '6.5000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 45
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WV',
+            'rate' => '6.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 46
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WI',
+            'rate' => '5.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 47
+        ],
+        [
+            'country' => 'US',
+            'state' => 'WY',
+            'rate' => '4.0000',
+            'name' => 'State Tax',
+            'shipping' => true,
+            'order' => 48
+        ]
+    ]
+];
+
+print_r($woocommerce->post('taxes/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "country": "US",
+            "state": "AL",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 1
+        },
+        {
+            "country": "US",
+            "state": "AZ",
+            "rate": "5.6000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 2
+        },
+        {
+            "country": "US",
+            "state": "AR",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 3
+        },
+        {
+            "country": "US",
+            "state": "CA",
+            "rate": "7.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 4
+        },
+        {
+            "country": "US",
+            "state": "CO",
+            "rate": "2.9000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 5
+        },
+        {
+            "country": "US",
+            "state": "CT",
+            "rate": "6.3500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 6
+        },
+        {
+            "country": "US",
+            "state": "DC",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 7
+        },
+        {
+            "country": "US",
+            "state": "FL",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 8
+        },
+        {
+            "country": "US",
+            "state": "GA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 9
+        },
+        {
+            "country": "US",
+            "state": "GU",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 10
+        },
+        {
+            "country": "US",
+            "state": "HI",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 11
+        },
+        {
+            "country": "US",
+            "state": "ID",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 12
+        },
+        {
+            "country": "US",
+            "state": "IL",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 13
+        },
+        {
+            "country": "US",
+            "state": "IN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 14
+        },
+        {
+            "country": "US",
+            "state": "IA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 15
+        },
+        {
+            "country": "US",
+            "state": "KS",
+            "rate": "6.1500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 16
+        },
+        {
+            "country": "US",
+            "state": "KY",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 17
+        },
+        {
+            "country": "US",
+            "state": "LA",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 18
+        },
+        {
+            "country": "US",
+            "state": "ME",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 19
+        },
+        {
+            "country": "US",
+            "state": "MD",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 20
+        },
+        {
+            "country": "US",
+            "state": "MA",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 21
+        },
+        {
+            "country": "US",
+            "state": "MI",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 22
+        },
+        {
+            "country": "US",
+            "state": "MN",
+            "rate": "6.8750",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 23
+        },
+        {
+            "country": "US",
+            "state": "MS",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 24
+        },
+        {
+            "country": "US",
+            "state": "MO",
+            "rate": "4.2250",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 25
+        },
+        {
+            "country": "US",
+            "state": "NE",
+            "rate": "5.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 26
+        },
+        {
+            "country": "US",
+            "state": "NV",
+            "rate": "6.8500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 27
+        },
+        {
+            "country": "US",
+            "state": "NJ",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 28
+        },
+        {
+            "country": "US",
+            "state": "NM",
+            "rate": "5.1250",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 29
+        },
+        {
+            "country": "US",
+            "state": "NY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 30
+        },
+        {
+            "country": "US",
+            "state": "NC",
+            "rate": "4.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 31
+        },
+        {
+            "country": "US",
+            "state": "ND",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 32
+        },
+        {
+            "country": "US",
+            "state": "OH",
+            "rate": "5.7500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 33
+        },
+        {
+            "country": "US",
+            "state": "OK",
+            "rate": "4.5000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 34
+        },
+        {
+            "country": "US",
+            "state": "PA",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 35
+        },
+        {
+            "country": "US",
+            "state": "PR",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 36
+        },
+        {
+            "country": "US",
+            "state": "RI",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 37
+        },
+        {
+            "country": "US",
+            "state": "SC",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 38
+        },
+        {
+            "country": "US",
+            "state": "SD",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 39
+        },
+        {
+            "country": "US",
+            "state": "TN",
+            "rate": "7.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 40
+        },
+        {
+            "country": "US",
+            "state": "TX",
+            "rate": "6.2500",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 41
+        },
+        {
+            "country": "US",
+            "state": "UT",
+            "rate": "5.9500",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 42
+        },
+        {
+            "country": "US",
+            "state": "VT",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 43
+        },
+        {
+            "country": "US",
+            "state": "VA",
+            "rate": "5.3000",
+            "name": "State Tax",
+            "shipping": False,
+            "order": 44
+        },
+        {
+            "country": "US",
+            "state": "WA",
+            "rate": "6.5000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 45
+        },
+        {
+            "country": "US",
+            "state": "WV",
+            "rate": "6.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 46
+        },
+        {
+            "country": "US",
+            "state": "WI",
+            "rate": "5.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 47
+        },
+        {
+            "country": "US",
+            "state": "WY",
+            "rate": "4.0000",
+            "name": "State Tax",
+            "shipping": True,
+            "order": 48
+        }
+    ]
+}
+
+print(wcapi.post("taxes/batch", data).json())
+
data = {
+  create: [
+    {
+      country: "US",
+      state: "AL",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 1
+    },
+    {
+      country: "US",
+      state: "AZ",
+      rate: "5.6000",
+      name: "State Tax",
+      shipping: false,
+      order: 2
+    },
+    {
+      country: "US",
+      state: "AR",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 3
+    },
+    {
+      country: "US",
+      state: "CA",
+      rate: "7.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 4
+    },
+    {
+      country: "US",
+      state: "CO",
+      rate: "2.9000",
+      name: "State Tax",
+      shipping: false,
+      order: 5
+    },
+    {
+      country: "US",
+      state: "CT",
+      rate: "6.3500",
+      name: "State Tax",
+      shipping: true,
+      order: 6
+    },
+    {
+      country: "US",
+      state: "DC",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 7
+    },
+    {
+      country: "US",
+      state: "FL",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 8
+    },
+    {
+      country: "US",
+      state: "GA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 9
+    },
+    {
+      country: "US",
+      state: "GU",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 10
+    },
+    {
+      country: "US",
+      state: "HI",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 11
+    },
+    {
+      country: "US",
+      state: "ID",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 12
+    },
+    {
+      country: "US",
+      state: "IL",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 13
+    },
+    {
+      country: "US",
+      state: "IN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 14
+    },
+    {
+      country: "US",
+      state: "IA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 15
+    },
+    {
+      country: "US",
+      state: "KS",
+      rate: "6.1500",
+      name: "State Tax",
+      shipping: true,
+      order: 16
+    },
+    {
+      country: "US",
+      state: "KY",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 17
+    },
+    {
+      country: "US",
+      state: "LA",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 18
+    },
+    {
+      country: "US",
+      state: "ME",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 19
+    },
+    {
+      country: "US",
+      state: "MD",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 20
+    },
+    {
+      country: "US",
+      state: "MA",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: false,
+      order: 21
+    },
+    {
+      country: "US",
+      state: "MI",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 22
+    },
+    {
+      country: "US",
+      state: "MN",
+      rate: "6.8750",
+      name: "State Tax",
+      shipping: true,
+      order: 23
+    },
+    {
+      country: "US",
+      state: "MS",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 24
+    },
+    {
+      country: "US",
+      state: "MO",
+      rate: "4.2250",
+      name: "State Tax",
+      shipping: false,
+      order: 25
+    },
+    {
+      country: "US",
+      state: "NE",
+      rate: "5.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 26
+    },
+    {
+      country: "US",
+      state: "NV",
+      rate: "6.8500",
+      name: "State Tax",
+      shipping: false,
+      order: 27
+    },
+    {
+      country: "US",
+      state: "NJ",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 28
+    },
+    {
+      country: "US",
+      state: "NM",
+      rate: "5.1250",
+      name: "State Tax",
+      shipping: true,
+      order: 29
+    },
+    {
+      country: "US",
+      state: "NY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 30
+    },
+    {
+      country: "US",
+      state: "NC",
+      rate: "4.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 31
+    },
+    {
+      country: "US",
+      state: "ND",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 32
+    },
+    {
+      country: "US",
+      state: "OH",
+      rate: "5.7500",
+      name: "State Tax",
+      shipping: true,
+      order: 33
+    },
+    {
+      country: "US",
+      state: "OK",
+      rate: "4.5000",
+      name: "State Tax",
+      shipping: false,
+      order: 34
+    },
+    {
+      country: "US",
+      state: "PA",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 35
+    },
+    {
+      country: "US",
+      state: "PR",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 36
+    },
+    {
+      country: "US",
+      state: "RI",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: false,
+      order: 37
+    },
+    {
+      country: "US",
+      state: "SC",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 38
+    },
+    {
+      country: "US",
+      state: "SD",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 39
+    },
+    {
+      country: "US",
+      state: "TN",
+      rate: "7.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 40
+    },
+    {
+      country: "US",
+      state: "TX",
+      rate: "6.2500",
+      name: "State Tax",
+      shipping: true,
+      order: 41
+    },
+    {
+      country: "US",
+      state: "UT",
+      rate: "5.9500",
+      name: "State Tax",
+      shipping: false,
+      order: 42
+    },
+    {
+      country: "US",
+      state: "VT",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 43
+    },
+    {
+      country: "US",
+      state: "VA",
+      rate: "5.3000",
+      name: "State Tax",
+      shipping: false,
+      order: 44
+    },
+    {
+      country: "US",
+      state: "WA",
+      rate: "6.5000",
+      name: "State Tax",
+      shipping: true,
+      order: 45
+    },
+    {
+      country: "US",
+      state: "WV",
+      rate: "6.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 46
+    },
+    {
+      country: "US",
+      state: "WI",
+      rate: "5.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 47
+    },
+    {
+      country: "US",
+      state: "WY",
+      rate: "4.0000",
+      name: "State Tax",
+      shipping: true,
+      order: 48
+    }
+  ]
+}
+
+woocommerce.post("taxes/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 72,
+      "country": "US",
+      "state": "AL",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 1,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/72"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 73,
+      "country": "US",
+      "state": "AZ",
+      "postcode": "",
+      "city": "",
+      "rate": "5.6000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 2,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/73"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 74,
+      "country": "US",
+      "state": "AR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 3,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/74"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 75,
+      "country": "US",
+      "state": "CA",
+      "postcode": "",
+      "city": "",
+      "rate": "7.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 4,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/75"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 76,
+      "country": "US",
+      "state": "CO",
+      "postcode": "",
+      "city": "",
+      "rate": "2.9000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 5,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/76"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 77,
+      "country": "US",
+      "state": "CT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.3500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 6,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/77"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 78,
+      "country": "US",
+      "state": "DC",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 7,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/78"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 79,
+      "country": "US",
+      "state": "FL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 8,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/79"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 80,
+      "country": "US",
+      "state": "GA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 9,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/80"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 81,
+      "country": "US",
+      "state": "GU",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 10,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/81"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 82,
+      "country": "US",
+      "state": "HI",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 11,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/82"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 83,
+      "country": "US",
+      "state": "ID",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 12,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/83"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 84,
+      "country": "US",
+      "state": "IL",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 13,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/84"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 85,
+      "country": "US",
+      "state": "IN",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 14,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/85"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 86,
+      "country": "US",
+      "state": "IA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 15,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/86"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 87,
+      "country": "US",
+      "state": "KS",
+      "postcode": "",
+      "city": "",
+      "rate": "6.1500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 16,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/87"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 88,
+      "country": "US",
+      "state": "KY",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 17,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/88"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 89,
+      "country": "US",
+      "state": "LA",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 18,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/89"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 90,
+      "country": "US",
+      "state": "ME",
+      "postcode": "",
+      "city": "",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 19,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/90"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 91,
+      "country": "US",
+      "state": "MD",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 20,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/91"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 92,
+      "country": "US",
+      "state": "MA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 21,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/92"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 93,
+      "country": "US",
+      "state": "MI",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 22,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/93"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 94,
+      "country": "US",
+      "state": "MN",
+      "postcode": "",
+      "city": "",
+      "rate": "6.8750",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 23,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/94"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 95,
+      "country": "US",
+      "state": "MS",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 24,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/95"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 96,
+      "country": "US",
+      "state": "MO",
+      "postcode": "",
+      "city": "",
+      "rate": "4.2250",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 25,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/96"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 97,
+      "country": "US",
+      "state": "NE",
+      "postcode": "",
+      "city": "",
+      "rate": "5.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 26,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/97"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 98,
+      "country": "US",
+      "state": "NV",
+      "postcode": "",
+      "city": "",
+      "rate": "6.8500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 27,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/98"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 99,
+      "country": "US",
+      "state": "NJ",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 28,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/99"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 100,
+      "country": "US",
+      "state": "NM",
+      "postcode": "",
+      "city": "",
+      "rate": "5.1250",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 29,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/100"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 101,
+      "country": "US",
+      "state": "NY",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 30,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/101"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 102,
+      "country": "US",
+      "state": "NC",
+      "postcode": "",
+      "city": "",
+      "rate": "4.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 31,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/102"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 103,
+      "country": "US",
+      "state": "ND",
+      "postcode": "",
+      "city": "",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 32,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/103"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 104,
+      "country": "US",
+      "state": "OH",
+      "postcode": "",
+      "city": "",
+      "rate": "5.7500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 33,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/104"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 105,
+      "country": "US",
+      "state": "OK",
+      "postcode": "",
+      "city": "",
+      "rate": "4.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 34,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/105"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 106,
+      "country": "US",
+      "state": "PA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 35,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/106"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 107,
+      "country": "US",
+      "state": "PR",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 36,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/107"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 108,
+      "country": "US",
+      "state": "RI",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 37,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/108"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 109,
+      "country": "US",
+      "state": "SC",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 38,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/109"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 110,
+      "country": "US",
+      "state": "SD",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 39,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/110"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 111,
+      "country": "US",
+      "state": "TN",
+      "postcode": "",
+      "city": "",
+      "rate": "7.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 40,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/111"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 112,
+      "country": "US",
+      "state": "TX",
+      "postcode": "",
+      "city": "",
+      "rate": "6.2500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 41,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/112"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 113,
+      "country": "US",
+      "state": "UT",
+      "postcode": "",
+      "city": "",
+      "rate": "5.9500",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 42,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/113"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 114,
+      "country": "US",
+      "state": "VT",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 43,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/114"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 115,
+      "country": "US",
+      "state": "VA",
+      "postcode": "",
+      "city": "",
+      "rate": "5.3000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": false,
+      "order": 44,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/115"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 116,
+      "country": "US",
+      "state": "WA",
+      "postcode": "",
+      "city": "",
+      "rate": "6.5000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 45,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/116"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 117,
+      "country": "US",
+      "state": "WV",
+      "postcode": "",
+      "city": "",
+      "rate": "6.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 46,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/117"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 118,
+      "country": "US",
+      "state": "WI",
+      "postcode": "",
+      "city": "",
+      "rate": "5.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 47,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/118"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    },
+    {
+      "id": 119,
+      "country": "US",
+      "state": "WY",
+      "postcode": "",
+      "city": "",
+      "rate": "4.0000",
+      "name": "State Tax",
+      "priority": 0,
+      "compound": false,
+      "shipping": true,
+      "order": 48,
+      "class": "standard",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes/119"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/taxes"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Tax classes

+

The tax classes API allows you to create, view, and delete individual tax classes.

+

Tax class properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
slugstringUnique identifier for the resource. read-only
namestringTax class name. required
+

Create a tax class

+

This API helps you to create a new tax class.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/taxes/classes
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/taxes/classes \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Zero Rate"
+}'
+
const data = {
+  name: "Zero Rate"
+};
+
+WooCommerce.post("taxes/classes", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Zero Rate'
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+
data = {
+    "name": "Zero Rate"
+}
+
+print(wcapi.post("taxes/classes", data).json())
+
data = {
+  name: "Zero Rate"
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "slug": "zero-rate",
+  "name": "Zero Rate",
+  "_links": {
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+      }
+    ]
+  }
+}
+

List all tax classes

+

This API helps you to view all tax classes.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/taxes/classes
+
+
+
curl https://example.com/wp-json/wc/v2/taxes/classes \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("taxes/classes")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('taxes/classes')); ?>
+
print(wcapi.get("taxes/classes").json())
+
woocommerce.get("taxes/classes").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "slug": "standard",
+    "name": "Standard Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "reduced-rate",
+    "name": "Reduced Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+        }
+      ]
+    }
+  },
+  {
+    "slug": "zero-rate",
+    "name": "Zero Rate",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+        }
+      ]
+    }
+  }
+]
+

Delete a tax class

+

This API helps you delete a tax class.

+ + +

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/taxes/classes/<slug>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/taxes/classes/zero-rate?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("taxes/classes/zero-rate", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('taxes/classes/zero-rate', ['force' => true])); ?>
+
print(wcapi.delete("taxes/classes/zero-rate", params={"force": True}).json())
+
woocommerce.delete("taxes/classes/zero-rate", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "slug": "zero-rate",
+  "name": "Zero Rate",
+  "_links": {
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, since this resource does not support trashing.
+

Webhooks

+

The webhooks API allows you to create, view, update, and delete individual, or a batch, of webhooks.

+ +

Webhooks can be managed via the WooCommerce settings screen or by using the REST API endpoints. The WC_Webhook class manages all data storage and retrieval of the webhook custom post type, as well as enqueuing webhook actions and processing/delivering/logging webhooks. On woocommerce_init, active webhooks are loaded.

+ +

Each webhook has:

+ +
    +
  • status: active (delivers payload), paused (delivery paused by admin), disabled (delivery paused by failure).
  • +
  • topic: determines which resource events the webhook is triggered for.
  • +
  • delivery URL: URL where the payload is delivered, must be HTTP or HTTPS.
  • +
  • secret: an optional secret key that is used to generate a HMAC-SHA256 hash of the request body so the receiver can verify authenticity of the webhook.
  • +
  • hooks: an array of hook names that are added and bound to the webhook for processing.
  • +
+

Topics

+

The topic is a combination resource (e.g. order) and event (e.g. created) and maps to one or more hook names (e.g. woocommerce_checkout_order_processed). Webhooks can be created using the topic name and the appropriate hooks are automatically added.

+ +

Core topics are:

+ +
    +
  • Coupons: coupon.created, coupon.updated and coupon.deleted.
  • +
  • Customers: customer.created, customer.updated and customer.deleted.
  • +
  • Orders: order.created, order.updated and order.deleted.
  • +
  • Products: product.created, product.updated and product.deleted.
  • +
+ +

Custom topics can also be used which map to a single hook name, for example you could add a webhook with topic action.woocommerce_add_to_cart that is triggered on that event. Custom topics pass the first hook argument to the payload, so in this example the cart_item_key would be included in the payload.

+

Delivery/payload

+

Delivery is performed using wp_remote_post() (HTTP POST) and processed in the background by default using wp-cron. A few custom headers are added to the request to help the receiver process the webhook:

+ +
    +
  • X-WC-Webhook-Source: http://example.com/.
  • +
  • X-WC-Webhook-Topic - e.g. order.updated.
  • +
  • X-WC-Webhook-Resource - e.g. order.
  • +
  • X-WC-Webhook-Event - e.g. updated.
  • +
  • X-WC-Webhook-Signature - a base64 encoded HMAC-SHA256 hash of the payload.
  • +
  • X-WC-Webhook-ID - webhook's post ID.
  • +
  • X-WC-Webhook-Delivery-ID - delivery log ID (a comment).
  • +
+ +

The payload is JSON encoded and for API resources (coupons, customers, orders, products), the response is exactly the same as if requested via the REST API.

+

Logging

+

Requests/responses are logged as comments on the webhook custom post type. Each delivery log includes:

+ +
    +
  • Request duration.
  • +
  • Request URL, method, headers, and body.
  • +
  • Response Code, message, headers, and body.
  • +
+ +

Only the 25 most recent delivery logs are kept in order to reduce comment table bloat.

+ +

After 5 consecutive failed deliveries (as defined by a non HTTP 2xx response code), the webhook is disabled and must be edited via the REST API to re-enable.

+ +

Delivery logs can be fetched through the REST API endpoint or in code using WC_Webhook::get_delivery_logs().

+

Visual interface

+

You can find the Webhooks interface going to "WooCommerce" > "Settings" > "API" > "Webhooks", see our Visual Webhooks docs for more details.

+

Webhook properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringA friendly name for the webhook.
statusstringWebhook status. Options: active, paused and disabled. Default is active.
topicstringWebhook topic. mandatory
resourcestringWebhook resource. read-only
eventstringWebhook event. read-only
hooksarrayWooCommerce action names associated with the webhook. read-only
delivery_urlstringThe URL where the webhook payload is delivered. read-only mandatory
secretstringSecret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID
date_createddate-timeThe date the webhook was created, in the site's timezone. read-only
date_created_gmtdate-timeThe date the webhook was created, as GMT. read-only
date_modifieddate-timeThe date the webhook was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the webhook was last modified, as GMT. read-only
+

Webhook delivery properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
durationstringThe delivery duration, in seconds. read-only
summarystringA friendly summary of the response including the HTTP response code, message, and body. read-only
request_urlstringThe URL where the webhook was delivered. read-only
request_headersarrayRequest headers. read-only
request_bodystringRequest body. read-only
response_codestringThe HTTP response code from the receiving server. read-only
response_messagestringThe HTTP response message from the receiving server. read-only
response_headersarrayArray of the response headers from the receiving server. read-only
response_bodystringThe response body from the receiving server. read-only
date_createddate-timeThe date the webhook delivery was logged, in the site's timezone. read-only
date_created_gmtdate-timeThe date the webhook delivery was logged, GMT. read-only
+

Request header properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
User-AgentstringThe request user agent, default is "WooCommerce/{version} Hookshot (WordPress/{version})". read-only
Content-TypestringThe request content-type, default is "application/json". read-only
X-WC-Webhook-SourcestringThe webhook source. read-only
X-WC-Webhook-TopicstringThe webhook topic. read-only
X-WC-Webhook-ResourcestringThe webhook resource. read-only
X-WC-Webhook-EventstringThe webhook event. read-only
X-WC-Webhook-SignaturestringA base64 encoded HMAC-SHA256 hash of the payload. read-only
X-WC-Webhook-IDintegerThe webhook's ID. read-only
X-WC-Webhook-Delivery-IDintegerThe delivery ID. read-only
+

Create a webhook

+

This API helps you to create a new webhook.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/webhooks
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/webhooks \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Order updated",
+  "topic": "order.updated",
+  "delivery_url": "http://requestb.in/1g0sxmo1"
+}'
+
const data = {
+  name: "Order updated",
+  topic: "order.updated",
+  delivery_url: "http://requestb.in/1g0sxmo1"
+};
+
+WooCommerce.post("webhooks", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Order updated',
+    'topic' => 'order.updated',
+    'delivery_url' => 'http://requestb.in/1g0sxmo1'
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+
data = {
+    "name": "Order updated",
+    "topic": "order.updated",
+    "delivery_url": "http://requestb.in/1g0sxmo1"
+}
+
+print(wcapi.post("webhooks", data).json())
+
data = {
+  name: "Order updated",
+  topic: "order.updated",
+  delivery_url: "http://requestb.in/1g0sxmo1"
+}
+
+woocommerce.post("webhooks", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "active",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T23:17:52",
+  "date_modified_gmt": "2016-05-15T20:17:52",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks"
+      }
+    ]
+  }
+}
+

Retrieve a webhook

+

This API lets you retrieve and view a specific webhook.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/webhooks/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/webhooks/142 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142')); ?>
+
print(wcapi.get("webhooks/142").json())
+
woocommerce.get("webhooks/142").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "active",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T23:17:52",
+  "date_modified_gmt": "2016-05-15T20:17:52",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks"
+      }
+    ]
+  }
+}
+

List all webhooks

+

This API helps you to view all the webhooks.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/webhooks
+
+
+
curl https://example.com/wp-json/wc/v2/webhooks \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks')); ?>
+
print(wcapi.get("webhooks").json())
+
woocommerce.get("webhooks").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 143,
+    "name": "Customer created",
+    "status": "active",
+    "topic": "customer.created",
+    "resource": "customer",
+    "event": "created",
+    "hooks": [
+      "user_register",
+      "woocommerce_created_customer",
+      "woocommerce_api_create_customer"
+    ],
+    "delivery_url": "http://requestb.in/1g0sxmo1",
+    "date_created": "2016-05-15T23:17:52",
+    "date_created_gmt": "2016-05-15T20:17:52",
+    "date_modified": "2016-05-15T23:17:52",
+    "date_modified_gmt": "2016-05-15T20:17:52",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/143"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks"
+        }
+      ]
+    }
+  },
+  {
+    "id": 142,
+    "name": "Order updated",
+    "status": "active",
+    "topic": "order.updated",
+    "resource": "order",
+    "event": "updated",
+    "hooks": [
+      "woocommerce_process_shop_order_meta",
+      "woocommerce_api_edit_order",
+      "woocommerce_order_edit_status",
+      "woocommerce_order_status_changed"
+    ],
+    "delivery_url": "http://requestb.in/1g0sxmo1",
+    "date_created": "2016-05-15T23:17:52",
+    "date_created_gmt": "2016-05-15T20:17:52",
+    "date_modified": "2016-05-15T23:17:52",
+    "date_modified_gmt": "2016-05-15T20:17:52",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks"
+        }
+      ]
+    }
+  }
+]
+

Available parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title and slug. Default is date.
statusstringLimit result set to webhooks assigned a specific status. Options: all, active, paused and disabled. Default is all.
+

Update a webhook

+

This API lets you make changes to a webhook.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/webhook/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/webhook/142 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "status": "paused"
+}'
+
const data = {
+  status: "paused"
+}
+
+WooCommerce.put("webhooks/142", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'status' => 'paused'
+];
+
+print_r($woocommerce->put('webhooks/142', $data));
+?>
+
data = {
+    "status": "paused"
+}
+
+print(wcapi.put("webhooks/142", data).json())
+
data = {
+  status: "paused"
+}
+
+woocommerce.put("webhooks/142", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "paused",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T17:30:12",
+  "date_modified_gmt": "2016-05-15T20:30:12",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks"
+      }
+    ]
+  }
+}
+

Delete a webhook

+

This API helps you delete a webhook.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/webhooks/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/webhooks/142 \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("webhooks/142")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('webhooks/142')); ?>
+
print(wcapi.delete("webhooks/142").json())
+
woocommerce.delete("webhooks/142").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 142,
+  "name": "Order updated",
+  "status": "paused",
+  "topic": "order.updated",
+  "resource": "order",
+  "event": "updated",
+  "hooks": [
+    "woocommerce_process_shop_order_meta",
+    "woocommerce_api_edit_order",
+    "woocommerce_order_edit_status",
+    "woocommerce_order_status_changed"
+  ],
+  "delivery_url": "http://requestb.in/1g0sxmo1",
+  "date_created": "2016-05-15T23:17:52",
+  "date_created_gmt": "2016-05-15T20:17:52",
+  "date_modified": "2016-05-15T23:30:12",
+  "date_modified_gmt": "2016-05-15T20:30:12",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringUse true whether to permanently delete the webhook, Default is false.
+

Batch update webhooks

+

This API helps you to batch create, update and delete multiple webhooks.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/webhooks/batch
+
+
+
curl -X POST https://example.com//wp-json/wc/v2/webhooks/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "create": [
+    {
+      "name": "Coupon created",
+      "topic": "coupon.created",
+      "delivery_url": "http://requestb.in/1g0sxmo1"
+    },
+    {
+      "name": "Customer deleted",
+      "topic": "customer.deleted",
+      "delivery_url": "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  "delete": [
+    143
+  ]
+}'
+
const data = {
+  create: [
+    {
+      name: "Round toe",
+      topic: "coupon.created",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    },
+    {
+      name: "Customer deleted",
+      topic: "customer.deleted",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  delete: [
+    143
+  ]
+};
+
+WooCommerce.post("webhooks/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'name' => 'Round toe',
+            'topic' => 'coupon.created',
+            'delivery_url' => 'http://requestb.in/1g0sxmo1'
+        ],
+        [
+            'name' => 'Customer deleted',
+            'topic' => 'customer.deleted',
+            'delivery_url' => 'http://requestb.in/1g0sxmo1'
+        ]
+    ],
+    'delete' => [
+        143
+    ]
+];
+
+print_r($woocommerce->post('webhooks/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "name": "Round toe",
+            "topic": "coupon.created",
+            "delivery_url": "http://requestb.in/1g0sxmo1"
+        },
+        {
+            "name": "Customer deleted",
+            "topic": "customer.deleted",
+            "delivery_url": "http://requestb.in/1g0sxmo1"
+        }
+    ],
+    "delete": [
+        143
+    ]
+}
+
+print(wcapi.post("webhooks/batch", data).json())
+
data = {
+  create: [
+    {
+      name: "Round toe",
+      topic: "coupon.created",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    },
+    {
+      name: "Customer deleted",
+      topic: "customer.deleted",
+      delivery_url: "http://requestb.in/1g0sxmo1"
+    }
+  ],
+  delete: [
+    143
+  ]
+}
+
+woocommerce.post("webhooks/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "create": [
+    {
+      "id": 146,
+      "name": "Coupon created",
+      "status": "active",
+      "topic": "coupon.created",
+      "resource": "coupon",
+      "event": "created",
+      "hooks": [
+        "woocommerce_process_shop_coupon_meta",
+        "woocommerce_api_create_coupon"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-25T01:56:26",
+      "date_created_gmt": "2016-05-24T22:56:26",
+      "date_modified": "2016-05-25T01:56:26",
+      "date_modified_gmt": "2016-05-24T22:56:26",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/webhooks/146"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/webhooks"
+          }
+        ]
+      }
+    },
+    {
+      "id": 147,
+      "name": "Customer deleted",
+      "status": "active",
+      "topic": "customer.deleted",
+      "resource": "customer",
+      "event": "deleted",
+      "hooks": [
+        "delete_user"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-25T01:56:30",
+      "date_created_gmt": "2016-05-24T22:56:30",
+      "date_modified": "2016-05-25T01:56:30",
+      "date_modified_gmt": "2016-05-24T22:56:30",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/webhooks/147"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/webhooks"
+          }
+        ]
+      }
+    }
+  ],
+  "delete": [
+    {
+      "id": 143,
+      "name": "Webhook created on May 24, 2016 @ 03:20 AM",
+      "status": "active",
+      "topic": "customer.created",
+      "resource": "customer",
+      "event": "created",
+      "hooks": [
+        "user_register",
+        "woocommerce_created_customer",
+        "woocommerce_api_create_customer"
+      ],
+      "delivery_url": "http://requestb.in/1g0sxmo1",
+      "date_created": "2016-05-15T23:17:52",
+      "date_created_gmt": "2016-05-15T20:17:52",
+      "date_modified": "2016-05-15T23:17:52",
+      "date_modified_gmt": "2016-05-15T20:17:52",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/webhooks/143"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/webhooks"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Retrieve webhook delivery

+

This API lets you retrieve and view a specific webhook delivery.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/webhooks/<id>/deliveries/<delivery_id>
+
+
+
curl https://example.com/wp-json/wc/v2/webhooks/142/deliveries/54 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142/deliveries/54")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142/deliveries/54')); ?>
+
print(wcapi.get("webhooks/142/deliveries/54").json())
+
woocommerce.get("webhooks/142/deliveries/54").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 54,
+  "duration": "0.40888",
+  "summary": "HTTP 200 OK: ok",
+  "request_method": "POST",
+  "request_url": "http://requestb.in/1g0sxmo1",
+  "request_headers": {
+    "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
+    "Content-Type": "application/json",
+    "X-WC-Webhook-Source": "http://example.com/",
+    "X-WC-Webhook-Topic": "order.updated",
+    "X-WC-Webhook-Resource": "order",
+    "X-WC-Webhook-Event": "updated",
+    "X-WC-Webhook-Signature": "J72iu7hL93aUt2dFnyOBoBypwbmP6nt6Aor33nnOHxU=",
+    "X-WC-Webhook-ID": 142,
+    "X-WC-Webhook-Delivery-ID": 54
+  },
+  "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:30:30Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
+  "response_code": "200",
+  "response_message": "OK",
+  "response_headers": {
+    "connection": "close",
+    "server": "gunicorn/19.3.0",
+    "date": "Tue, 16 May 2016 03:30:31 GMT",
+    "content-type": "text/html; charset=utf-8",
+    "content-length": "2",
+    "sponsored-by": "https://www.runscope.com",
+    "via": "1.1 vegur"
+  },
+  "response_body": "ok",
+  "date_created": "2016-05-16T06:30:31",
+  "date_created_gmt": "2016-05-16T03:30:31",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142/deliveries/54"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142/deliveries"
+      }
+    ],
+    "up": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+      }
+    ]
+  }
+}
+
+ +

List all webhook deliveries

+

This API helps you to view all deliveries from a specific webhooks.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/webhooks/<id>/deliveries
+
+
+
curl https://example.com/wp-json/wc/v2/webhooks/142/deliveries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("webhooks/142/deliveries")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('webhooks/142/deliveries')); ?>
+
print(wcapi.get("webhooks/142/deliveries").json())
+
woocommerce.get("webhooks/142/deliveries").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 54,
+    "duration": "0.40888",
+    "summary": "HTTP 200 OK: ok",
+    "request_method": "POST",
+    "request_url": "http://requestb.in/1g0sxmo1",
+    "request_headers": {
+      "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
+      "Content-Type": "application/json",
+      "X-WC-Webhook-Source": "http://example.com/",
+      "X-WC-Webhook-Topic": "order.updated",
+      "X-WC-Webhook-Resource": "order",
+      "X-WC-Webhook-Event": "updated",
+      "X-WC-Webhook-Signature": "J72iu7hL93aUt2dFnyOBoBypwbmP6nt6Aor33nnOHxU=",
+      "X-WC-Webhook-ID": 142,
+      "X-WC-Webhook-Delivery-ID": 54
+    },
+    "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:30:30Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
+    "response_code": "200",
+    "response_message": "OK",
+    "response_headers": {
+      "connection": "close",
+      "server": "gunicorn/19.3.0",
+      "date": "Tue, 16 May 2016 03:30:31 GMT",
+      "content-type": "text/html; charset=utf-8",
+      "content-length": "2",
+      "sponsored-by": "https://www.runscope.com",
+      "via": "1.1 vegur"
+    },
+    "response_body": "ok",
+    "date_created": "2016-05-16T06:30:31",
+    "date_created_gmt": "2016-05-16T03:30:31",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142/deliveries/54"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142/deliveries"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+        }
+      ]
+    }
+  },
+  {
+    "id": 53,
+    "duration": "0.7615",
+    "summary": "HTTP 200 OK: ok",
+    "request_method": "POST",
+    "request_url": "http://requestb.in/1g0sxmo1",
+    "request_headers": {
+      "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
+      "Content-Type": "application/json",
+      "X-WC-Webhook-Source": "http://example.com/",
+      "X-WC-Webhook-Topic": "order.updated",
+      "X-WC-Webhook-Resource": "order",
+      "X-WC-Webhook-Event": "updated",
+      "X-WC-Webhook-Signature": "Z996ccyueeoqdXZFq2ND2ETpsPGrXmWKj+yvQ0c2N1w=",
+      "X-WC-Webhook-ID": 142,
+      "X-WC-Webhook-Delivery-ID": 53
+    },
+    "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:29:13Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
+    "response_code": "200",
+    "response_message": "OK",
+    "response_headers": {
+      "connection": "close",
+      "server": "gunicorn/19.3.0",
+      "date": "Tue, 16 May 2016 03:29:20 GMT",
+      "content-type": "text/html; charset=utf-8",
+      "content-length": "2",
+      "sponsored-by": "https://www.runscope.com",
+      "via": "1.1 vegur"
+    },
+    "response_body": "ok",
+    "date_created": "2016-05-16T06:29:19",
+    "date_created_gmt": "2016-05-16T03:29:19",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142/deliveries/53"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142/deliveries"
+        }
+      ],
+      "up": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/webhooks/142"
+        }
+      ]
+    }
+  }
+]
+

Settings

+

The settings API allows you to view all groups of settings available.

+

Setting group properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier that can be used to link settings together. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
parent_idstringID of parent grouping. read-only
sub_groupsstringIDs for settings sub groups. read-only
+

List all settings groups

+

This API helps you to view all the settings groups.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/settings
+
+
+
curl https://example.com/wp-json/wc/v2/settings \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("settings")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('settings')); ?>
+
print(wcapi.get("settings").json())
+
woocommerce.get("settings").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "general",
+    "label": "General",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "products",
+    "label": "Products",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/products"
+        }
+      ]
+    }
+  },
+  {
+    "id": "tax",
+    "label": "Tax",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/tax"
+        }
+      ]
+    }
+  },
+  {
+    "id": "shipping",
+    "label": "Shipping",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/shipping"
+        }
+      ]
+    }
+  },
+  {
+    "id": "checkout",
+    "label": "Checkout",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/checkout"
+        }
+      ]
+    }
+  },
+  {
+    "id": "account",
+    "label": "Accounts",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/account"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email",
+    "label": "Emails",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [
+      "email_new_order",
+      "email_cancelled_order",
+      "email_failed_order",
+      "email_customer_on_hold_order",
+      "email_customer_processing_order",
+      "email_customer_completed_order",
+      "email_customer_refunded_order",
+      "email_customer_invoice",
+      "email_customer_note",
+      "email_customer_reset_password",
+      "email_customer_new_account"
+    ],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email"
+        }
+      ]
+    }
+  },
+  {
+    "id": "integration",
+    "label": "Integration",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/integration"
+        }
+      ]
+    }
+  },
+  {
+    "id": "api",
+    "label": "API",
+    "description": "",
+    "parent_id": "",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/api"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_new_order",
+    "label": "New order",
+    "description": "New order emails are sent to chosen recipient(s) when a new order is received.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_new_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_cancelled_order",
+    "label": "Cancelled order",
+    "description": "Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold).",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_cancelled_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_failed_order",
+    "label": "Failed order",
+    "description": "Failed order emails are sent to chosen recipient(s) when orders have been marked failed (if they were previously processing or on-hold).",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_failed_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_on_hold_order",
+    "label": "Order on-hold",
+    "description": "This is an order notification sent to customers containing order details after an order is placed on-hold.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_on_hold_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_processing_order",
+    "label": "Processing order",
+    "description": "This is an order notification sent to customers containing order details after payment.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_processing_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_completed_order",
+    "label": "Completed order",
+    "description": "Order complete emails are sent to customers when their orders are marked completed and usually indicate that their orders have been shipped.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_completed_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_refunded_order",
+    "label": "Refunded order",
+    "description": "Order refunded emails are sent to customers when their orders are marked refunded.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_refunded_order"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_invoice",
+    "label": "Customer invoice",
+    "description": "Customer invoice emails can be sent to customers containing their order information and payment links.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_invoice"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_note",
+    "label": "Customer note",
+    "description": "Customer note emails are sent when you add a note to an order.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_note"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_reset_password",
+    "label": "Reset password",
+    "description": "Customer \"reset password\" emails are sent when customers reset their passwords.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_reset_password"
+        }
+      ]
+    }
+  },
+  {
+    "id": "email_customer_new_account",
+    "label": "New account",
+    "description": "Customer \"new account\" emails are sent to the customer when a customer signs up via checkout or account pages.",
+    "parent_id": "email",
+    "sub_groups": [],
+    "_links": {
+      "options": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/email_customer_new_account"
+        }
+      ]
+    }
+  }
+]
+

Setting options

Setting option properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the setting. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
valuemixedSetting value.
defaultmixedDefault value for the setting. read-only
tipstringAdditional help text shown to the user about the setting. read-only
placeholderstringPlaceholder text to be displayed in text inputs. read-only
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. read-only
optionsobjectArray of options (key value pairs) for inputs such as select, multiselect, and radio buttons. read-only
+

Retrieve an setting option

+

This API lets you retrieve and view a specific setting option.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/settings/<group_id>/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("settings/general/woocommerce_allowed_countries")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('settings/general/woocommerce_allowed_countries')); ?>
+
print(wcapi.get("settings/general/woocommerce_allowed_countries").json())
+
woocommerce.get("settings/general/woocommerce_allowed_countries").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "woocommerce_allowed_countries",
+  "label": "Selling location(s)",
+  "description": "This option lets you limit which countries you are willing to sell to.",
+  "type": "select",
+  "default": "all",
+  "options": {
+    "all": "Sell to all countries",
+    "all_except": "Sell to all countries, except for&hellip;",
+    "specific": "Sell to specific countries"
+  },
+  "tip": "This option lets you limit which countries you are willing to sell to.",
+  "value": "all",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/settings/general"
+      }
+    ]
+  }
+}
+

List all setting options

+

This API helps you to view all the setting options.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/settings/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/settings/general \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("settings/general")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('settings/general')); ?>
+
print(wcapi.get("settings/general").json())
+
woocommerce.get("settings/general").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "woocommerce_allowed_countries",
+    "label": "Selling location(s)",
+    "description": "This option lets you limit which countries you are willing to sell to.",
+    "type": "select",
+    "default": "all",
+    "options": {
+      "all": "Sell to all countries",
+      "all_except": "Sell to all countries, except for&hellip;",
+      "specific": "Sell to specific countries"
+    },
+    "tip": "This option lets you limit which countries you are willing to sell to.",
+    "value": "all",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_all_except_countries",
+    "label": "Sell to all countries, except for&hellip;",
+    "description": "",
+    "type": "multiselect",
+    "default": "",
+    "value": "",
+    "options": {
+      "AX": "&#197;land Islands",
+      "AF": "Afghanistan",
+      "AL": "Albania",
+      "DZ": "Algeria",
+      "AS": "American Samoa",
+      "AD": "Andorra",
+      "AO": "Angola",
+      "AI": "Anguilla",
+      "AQ": "Antarctica",
+      "AG": "Antigua and Barbuda",
+      "AR": "Argentina",
+      "AM": "Armenia",
+      "AW": "Aruba",
+      "AU": "Australia",
+      "AT": "Austria",
+      "AZ": "Azerbaijan",
+      "BS": "Bahamas",
+      "BH": "Bahrain",
+      "BD": "Bangladesh",
+      "BB": "Barbados",
+      "BY": "Belarus",
+      "PW": "Belau",
+      "BE": "Belgium",
+      "BZ": "Belize",
+      "BJ": "Benin",
+      "BM": "Bermuda",
+      "BT": "Bhutan",
+      "BO": "Bolivia",
+      "BQ": "Bonaire, Saint Eustatius and Saba",
+      "BA": "Bosnia and Herzegovina",
+      "BW": "Botswana",
+      "BV": "Bouvet Island",
+      "BR": "Brazil",
+      "IO": "British Indian Ocean Territory",
+      "VG": "British Virgin Islands",
+      "BN": "Brunei",
+      "BG": "Bulgaria",
+      "BF": "Burkina Faso",
+      "BI": "Burundi",
+      "KH": "Cambodia",
+      "CM": "Cameroon",
+      "CA": "Canada",
+      "CV": "Cape Verde",
+      "KY": "Cayman Islands",
+      "CF": "Central African Republic",
+      "TD": "Chad",
+      "CL": "Chile",
+      "CN": "China",
+      "CX": "Christmas Island",
+      "CC": "Cocos (Keeling) Islands",
+      "CO": "Colombia",
+      "KM": "Comoros",
+      "CG": "Congo (Brazzaville)",
+      "CD": "Congo (Kinshasa)",
+      "CK": "Cook Islands",
+      "CR": "Costa Rica",
+      "HR": "Croatia",
+      "CU": "Cuba",
+      "CW": "Cura&ccedil;ao",
+      "CY": "Cyprus",
+      "CZ": "Czech Republic",
+      "DK": "Denmark",
+      "DJ": "Djibouti",
+      "DM": "Dominica",
+      "DO": "Dominican Republic",
+      "EC": "Ecuador",
+      "EG": "Egypt",
+      "SV": "El Salvador",
+      "GQ": "Equatorial Guinea",
+      "ER": "Eritrea",
+      "EE": "Estonia",
+      "ET": "Ethiopia",
+      "FK": "Falkland Islands",
+      "FO": "Faroe Islands",
+      "FJ": "Fiji",
+      "FI": "Finland",
+      "FR": "France",
+      "GF": "French Guiana",
+      "PF": "French Polynesia",
+      "TF": "French Southern Territories",
+      "GA": "Gabon",
+      "GM": "Gambia",
+      "GE": "Georgia",
+      "DE": "Germany",
+      "GH": "Ghana",
+      "GI": "Gibraltar",
+      "GR": "Greece",
+      "GL": "Greenland",
+      "GD": "Grenada",
+      "GP": "Guadeloupe",
+      "GU": "Guam",
+      "GT": "Guatemala",
+      "GG": "Guernsey",
+      "GN": "Guinea",
+      "GW": "Guinea-Bissau",
+      "GY": "Guyana",
+      "HT": "Haiti",
+      "HM": "Heard Island and McDonald Islands",
+      "HN": "Honduras",
+      "HK": "Hong Kong",
+      "HU": "Hungary",
+      "IS": "Iceland",
+      "IN": "India",
+      "ID": "Indonesia",
+      "IR": "Iran",
+      "IQ": "Iraq",
+      "IE": "Ireland",
+      "IM": "Isle of Man",
+      "IL": "Israel",
+      "IT": "Italy",
+      "CI": "Ivory Coast",
+      "JM": "Jamaica",
+      "JP": "Japan",
+      "JE": "Jersey",
+      "JO": "Jordan",
+      "KZ": "Kazakhstan",
+      "KE": "Kenya",
+      "KI": "Kiribati",
+      "KW": "Kuwait",
+      "KG": "Kyrgyzstan",
+      "LA": "Laos",
+      "LV": "Latvia",
+      "LB": "Lebanon",
+      "LS": "Lesotho",
+      "LR": "Liberia",
+      "LY": "Libya",
+      "LI": "Liechtenstein",
+      "LT": "Lithuania",
+      "LU": "Luxembourg",
+      "MO": "Macao S.A.R., China",
+      "MK": "Macedonia",
+      "MG": "Madagascar",
+      "MW": "Malawi",
+      "MY": "Malaysia",
+      "MV": "Maldives",
+      "ML": "Mali",
+      "MT": "Malta",
+      "MH": "Marshall Islands",
+      "MQ": "Martinique",
+      "MR": "Mauritania",
+      "MU": "Mauritius",
+      "YT": "Mayotte",
+      "MX": "Mexico",
+      "FM": "Micronesia",
+      "MD": "Moldova",
+      "MC": "Monaco",
+      "MN": "Mongolia",
+      "ME": "Montenegro",
+      "MS": "Montserrat",
+      "MA": "Morocco",
+      "MZ": "Mozambique",
+      "MM": "Myanmar",
+      "NA": "Namibia",
+      "NR": "Nauru",
+      "NP": "Nepal",
+      "NL": "Netherlands",
+      "NC": "New Caledonia",
+      "NZ": "New Zealand",
+      "NI": "Nicaragua",
+      "NE": "Niger",
+      "NG": "Nigeria",
+      "NU": "Niue",
+      "NF": "Norfolk Island",
+      "KP": "North Korea",
+      "MP": "Northern Mariana Islands",
+      "NO": "Norway",
+      "OM": "Oman",
+      "PK": "Pakistan",
+      "PS": "Palestinian Territory",
+      "PA": "Panama",
+      "PG": "Papua New Guinea",
+      "PY": "Paraguay",
+      "PE": "Peru",
+      "PH": "Philippines",
+      "PN": "Pitcairn",
+      "PL": "Poland",
+      "PT": "Portugal",
+      "PR": "Puerto Rico",
+      "QA": "Qatar",
+      "RE": "Reunion",
+      "RO": "Romania",
+      "RU": "Russia",
+      "RW": "Rwanda",
+      "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
+      "BL": "Saint Barth&eacute;lemy",
+      "SH": "Saint Helena",
+      "KN": "Saint Kitts and Nevis",
+      "LC": "Saint Lucia",
+      "SX": "Saint Martin (Dutch part)",
+      "MF": "Saint Martin (French part)",
+      "PM": "Saint Pierre and Miquelon",
+      "VC": "Saint Vincent and the Grenadines",
+      "WS": "Samoa",
+      "SM": "San Marino",
+      "SA": "Saudi Arabia",
+      "SN": "Senegal",
+      "RS": "Serbia",
+      "SC": "Seychelles",
+      "SL": "Sierra Leone",
+      "SG": "Singapore",
+      "SK": "Slovakia",
+      "SI": "Slovenia",
+      "SB": "Solomon Islands",
+      "SO": "Somalia",
+      "ZA": "South Africa",
+      "GS": "South Georgia/Sandwich Islands",
+      "KR": "South Korea",
+      "SS": "South Sudan",
+      "ES": "Spain",
+      "LK": "Sri Lanka",
+      "SD": "Sudan",
+      "SR": "Suriname",
+      "SJ": "Svalbard and Jan Mayen",
+      "SZ": "Swaziland",
+      "SE": "Sweden",
+      "CH": "Switzerland",
+      "SY": "Syria",
+      "TW": "Taiwan",
+      "TJ": "Tajikistan",
+      "TZ": "Tanzania",
+      "TH": "Thailand",
+      "TL": "Timor-Leste",
+      "TG": "Togo",
+      "TK": "Tokelau",
+      "TO": "Tonga",
+      "TT": "Trinidad and Tobago",
+      "TN": "Tunisia",
+      "TR": "Turkey",
+      "TM": "Turkmenistan",
+      "TC": "Turks and Caicos Islands",
+      "TV": "Tuvalu",
+      "UG": "Uganda",
+      "UA": "Ukraine",
+      "AE": "United Arab Emirates",
+      "GB": "United Kingdom (UK)",
+      "US": "United States (US)",
+      "UM": "United States (US) Minor Outlying Islands",
+      "VI": "United States (US) Virgin Islands",
+      "UY": "Uruguay",
+      "UZ": "Uzbekistan",
+      "VU": "Vanuatu",
+      "VA": "Vatican",
+      "VE": "Venezuela",
+      "VN": "Vietnam",
+      "WF": "Wallis and Futuna",
+      "EH": "Western Sahara",
+      "YE": "Yemen",
+      "ZM": "Zambia",
+      "ZW": "Zimbabwe"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_all_except_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_specific_allowed_countries",
+    "label": "Sell to specific countries",
+    "description": "",
+    "type": "multiselect",
+    "default": "",
+    "value": "",
+    "options": {
+      "AX": "&#197;land Islands",
+      "AF": "Afghanistan",
+      "AL": "Albania",
+      "DZ": "Algeria",
+      "AS": "American Samoa",
+      "AD": "Andorra",
+      "AO": "Angola",
+      "AI": "Anguilla",
+      "AQ": "Antarctica",
+      "AG": "Antigua and Barbuda",
+      "AR": "Argentina",
+      "AM": "Armenia",
+      "AW": "Aruba",
+      "AU": "Australia",
+      "AT": "Austria",
+      "AZ": "Azerbaijan",
+      "BS": "Bahamas",
+      "BH": "Bahrain",
+      "BD": "Bangladesh",
+      "BB": "Barbados",
+      "BY": "Belarus",
+      "PW": "Belau",
+      "BE": "Belgium",
+      "BZ": "Belize",
+      "BJ": "Benin",
+      "BM": "Bermuda",
+      "BT": "Bhutan",
+      "BO": "Bolivia",
+      "BQ": "Bonaire, Saint Eustatius and Saba",
+      "BA": "Bosnia and Herzegovina",
+      "BW": "Botswana",
+      "BV": "Bouvet Island",
+      "BR": "Brazil",
+      "IO": "British Indian Ocean Territory",
+      "VG": "British Virgin Islands",
+      "BN": "Brunei",
+      "BG": "Bulgaria",
+      "BF": "Burkina Faso",
+      "BI": "Burundi",
+      "KH": "Cambodia",
+      "CM": "Cameroon",
+      "CA": "Canada",
+      "CV": "Cape Verde",
+      "KY": "Cayman Islands",
+      "CF": "Central African Republic",
+      "TD": "Chad",
+      "CL": "Chile",
+      "CN": "China",
+      "CX": "Christmas Island",
+      "CC": "Cocos (Keeling) Islands",
+      "CO": "Colombia",
+      "KM": "Comoros",
+      "CG": "Congo (Brazzaville)",
+      "CD": "Congo (Kinshasa)",
+      "CK": "Cook Islands",
+      "CR": "Costa Rica",
+      "HR": "Croatia",
+      "CU": "Cuba",
+      "CW": "Cura&ccedil;ao",
+      "CY": "Cyprus",
+      "CZ": "Czech Republic",
+      "DK": "Denmark",
+      "DJ": "Djibouti",
+      "DM": "Dominica",
+      "DO": "Dominican Republic",
+      "EC": "Ecuador",
+      "EG": "Egypt",
+      "SV": "El Salvador",
+      "GQ": "Equatorial Guinea",
+      "ER": "Eritrea",
+      "EE": "Estonia",
+      "ET": "Ethiopia",
+      "FK": "Falkland Islands",
+      "FO": "Faroe Islands",
+      "FJ": "Fiji",
+      "FI": "Finland",
+      "FR": "France",
+      "GF": "French Guiana",
+      "PF": "French Polynesia",
+      "TF": "French Southern Territories",
+      "GA": "Gabon",
+      "GM": "Gambia",
+      "GE": "Georgia",
+      "DE": "Germany",
+      "GH": "Ghana",
+      "GI": "Gibraltar",
+      "GR": "Greece",
+      "GL": "Greenland",
+      "GD": "Grenada",
+      "GP": "Guadeloupe",
+      "GU": "Guam",
+      "GT": "Guatemala",
+      "GG": "Guernsey",
+      "GN": "Guinea",
+      "GW": "Guinea-Bissau",
+      "GY": "Guyana",
+      "HT": "Haiti",
+      "HM": "Heard Island and McDonald Islands",
+      "HN": "Honduras",
+      "HK": "Hong Kong",
+      "HU": "Hungary",
+      "IS": "Iceland",
+      "IN": "India",
+      "ID": "Indonesia",
+      "IR": "Iran",
+      "IQ": "Iraq",
+      "IE": "Ireland",
+      "IM": "Isle of Man",
+      "IL": "Israel",
+      "IT": "Italy",
+      "CI": "Ivory Coast",
+      "JM": "Jamaica",
+      "JP": "Japan",
+      "JE": "Jersey",
+      "JO": "Jordan",
+      "KZ": "Kazakhstan",
+      "KE": "Kenya",
+      "KI": "Kiribati",
+      "KW": "Kuwait",
+      "KG": "Kyrgyzstan",
+      "LA": "Laos",
+      "LV": "Latvia",
+      "LB": "Lebanon",
+      "LS": "Lesotho",
+      "LR": "Liberia",
+      "LY": "Libya",
+      "LI": "Liechtenstein",
+      "LT": "Lithuania",
+      "LU": "Luxembourg",
+      "MO": "Macao S.A.R., China",
+      "MK": "Macedonia",
+      "MG": "Madagascar",
+      "MW": "Malawi",
+      "MY": "Malaysia",
+      "MV": "Maldives",
+      "ML": "Mali",
+      "MT": "Malta",
+      "MH": "Marshall Islands",
+      "MQ": "Martinique",
+      "MR": "Mauritania",
+      "MU": "Mauritius",
+      "YT": "Mayotte",
+      "MX": "Mexico",
+      "FM": "Micronesia",
+      "MD": "Moldova",
+      "MC": "Monaco",
+      "MN": "Mongolia",
+      "ME": "Montenegro",
+      "MS": "Montserrat",
+      "MA": "Morocco",
+      "MZ": "Mozambique",
+      "MM": "Myanmar",
+      "NA": "Namibia",
+      "NR": "Nauru",
+      "NP": "Nepal",
+      "NL": "Netherlands",
+      "NC": "New Caledonia",
+      "NZ": "New Zealand",
+      "NI": "Nicaragua",
+      "NE": "Niger",
+      "NG": "Nigeria",
+      "NU": "Niue",
+      "NF": "Norfolk Island",
+      "KP": "North Korea",
+      "MP": "Northern Mariana Islands",
+      "NO": "Norway",
+      "OM": "Oman",
+      "PK": "Pakistan",
+      "PS": "Palestinian Territory",
+      "PA": "Panama",
+      "PG": "Papua New Guinea",
+      "PY": "Paraguay",
+      "PE": "Peru",
+      "PH": "Philippines",
+      "PN": "Pitcairn",
+      "PL": "Poland",
+      "PT": "Portugal",
+      "PR": "Puerto Rico",
+      "QA": "Qatar",
+      "RE": "Reunion",
+      "RO": "Romania",
+      "RU": "Russia",
+      "RW": "Rwanda",
+      "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
+      "BL": "Saint Barth&eacute;lemy",
+      "SH": "Saint Helena",
+      "KN": "Saint Kitts and Nevis",
+      "LC": "Saint Lucia",
+      "SX": "Saint Martin (Dutch part)",
+      "MF": "Saint Martin (French part)",
+      "PM": "Saint Pierre and Miquelon",
+      "VC": "Saint Vincent and the Grenadines",
+      "WS": "Samoa",
+      "SM": "San Marino",
+      "SA": "Saudi Arabia",
+      "SN": "Senegal",
+      "RS": "Serbia",
+      "SC": "Seychelles",
+      "SL": "Sierra Leone",
+      "SG": "Singapore",
+      "SK": "Slovakia",
+      "SI": "Slovenia",
+      "SB": "Solomon Islands",
+      "SO": "Somalia",
+      "ZA": "South Africa",
+      "GS": "South Georgia/Sandwich Islands",
+      "KR": "South Korea",
+      "SS": "South Sudan",
+      "ES": "Spain",
+      "LK": "Sri Lanka",
+      "SD": "Sudan",
+      "SR": "Suriname",
+      "SJ": "Svalbard and Jan Mayen",
+      "SZ": "Swaziland",
+      "SE": "Sweden",
+      "CH": "Switzerland",
+      "SY": "Syria",
+      "TW": "Taiwan",
+      "TJ": "Tajikistan",
+      "TZ": "Tanzania",
+      "TH": "Thailand",
+      "TL": "Timor-Leste",
+      "TG": "Togo",
+      "TK": "Tokelau",
+      "TO": "Tonga",
+      "TT": "Trinidad and Tobago",
+      "TN": "Tunisia",
+      "TR": "Turkey",
+      "TM": "Turkmenistan",
+      "TC": "Turks and Caicos Islands",
+      "TV": "Tuvalu",
+      "UG": "Uganda",
+      "UA": "Ukraine",
+      "AE": "United Arab Emirates",
+      "GB": "United Kingdom (UK)",
+      "US": "United States (US)",
+      "UM": "United States (US) Minor Outlying Islands",
+      "VI": "United States (US) Virgin Islands",
+      "UY": "Uruguay",
+      "UZ": "Uzbekistan",
+      "VU": "Vanuatu",
+      "VA": "Vatican",
+      "VE": "Venezuela",
+      "VN": "Vietnam",
+      "WF": "Wallis and Futuna",
+      "EH": "Western Sahara",
+      "YE": "Yemen",
+      "ZM": "Zambia",
+      "ZW": "Zimbabwe"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_specific_allowed_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_ship_to_countries",
+    "label": "Shipping location(s)",
+    "description": "Choose which countries you want to ship to, or choose to ship to all locations you sell to.",
+    "type": "select",
+    "default": "",
+    "options": {
+      "": "Ship to all countries you sell to",
+      "all": "Ship to all countries",
+      "specific": "Ship to specific countries only",
+      "disabled": "Disable shipping &amp; shipping calculations"
+    },
+    "tip": "Choose which countries you want to ship to, or choose to ship to all locations you sell to.",
+    "value": "",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_ship_to_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_specific_ship_to_countries",
+    "label": "Ship to specific countries",
+    "description": "",
+    "type": "multiselect",
+    "default": "",
+    "value": "",
+    "options": {
+      "AX": "&#197;land Islands",
+      "AF": "Afghanistan",
+      "AL": "Albania",
+      "DZ": "Algeria",
+      "AS": "American Samoa",
+      "AD": "Andorra",
+      "AO": "Angola",
+      "AI": "Anguilla",
+      "AQ": "Antarctica",
+      "AG": "Antigua and Barbuda",
+      "AR": "Argentina",
+      "AM": "Armenia",
+      "AW": "Aruba",
+      "AU": "Australia",
+      "AT": "Austria",
+      "AZ": "Azerbaijan",
+      "BS": "Bahamas",
+      "BH": "Bahrain",
+      "BD": "Bangladesh",
+      "BB": "Barbados",
+      "BY": "Belarus",
+      "PW": "Belau",
+      "BE": "Belgium",
+      "BZ": "Belize",
+      "BJ": "Benin",
+      "BM": "Bermuda",
+      "BT": "Bhutan",
+      "BO": "Bolivia",
+      "BQ": "Bonaire, Saint Eustatius and Saba",
+      "BA": "Bosnia and Herzegovina",
+      "BW": "Botswana",
+      "BV": "Bouvet Island",
+      "BR": "Brazil",
+      "IO": "British Indian Ocean Territory",
+      "VG": "British Virgin Islands",
+      "BN": "Brunei",
+      "BG": "Bulgaria",
+      "BF": "Burkina Faso",
+      "BI": "Burundi",
+      "KH": "Cambodia",
+      "CM": "Cameroon",
+      "CA": "Canada",
+      "CV": "Cape Verde",
+      "KY": "Cayman Islands",
+      "CF": "Central African Republic",
+      "TD": "Chad",
+      "CL": "Chile",
+      "CN": "China",
+      "CX": "Christmas Island",
+      "CC": "Cocos (Keeling) Islands",
+      "CO": "Colombia",
+      "KM": "Comoros",
+      "CG": "Congo (Brazzaville)",
+      "CD": "Congo (Kinshasa)",
+      "CK": "Cook Islands",
+      "CR": "Costa Rica",
+      "HR": "Croatia",
+      "CU": "Cuba",
+      "CW": "Cura&ccedil;ao",
+      "CY": "Cyprus",
+      "CZ": "Czech Republic",
+      "DK": "Denmark",
+      "DJ": "Djibouti",
+      "DM": "Dominica",
+      "DO": "Dominican Republic",
+      "EC": "Ecuador",
+      "EG": "Egypt",
+      "SV": "El Salvador",
+      "GQ": "Equatorial Guinea",
+      "ER": "Eritrea",
+      "EE": "Estonia",
+      "ET": "Ethiopia",
+      "FK": "Falkland Islands",
+      "FO": "Faroe Islands",
+      "FJ": "Fiji",
+      "FI": "Finland",
+      "FR": "France",
+      "GF": "French Guiana",
+      "PF": "French Polynesia",
+      "TF": "French Southern Territories",
+      "GA": "Gabon",
+      "GM": "Gambia",
+      "GE": "Georgia",
+      "DE": "Germany",
+      "GH": "Ghana",
+      "GI": "Gibraltar",
+      "GR": "Greece",
+      "GL": "Greenland",
+      "GD": "Grenada",
+      "GP": "Guadeloupe",
+      "GU": "Guam",
+      "GT": "Guatemala",
+      "GG": "Guernsey",
+      "GN": "Guinea",
+      "GW": "Guinea-Bissau",
+      "GY": "Guyana",
+      "HT": "Haiti",
+      "HM": "Heard Island and McDonald Islands",
+      "HN": "Honduras",
+      "HK": "Hong Kong",
+      "HU": "Hungary",
+      "IS": "Iceland",
+      "IN": "India",
+      "ID": "Indonesia",
+      "IR": "Iran",
+      "IQ": "Iraq",
+      "IE": "Ireland",
+      "IM": "Isle of Man",
+      "IL": "Israel",
+      "IT": "Italy",
+      "CI": "Ivory Coast",
+      "JM": "Jamaica",
+      "JP": "Japan",
+      "JE": "Jersey",
+      "JO": "Jordan",
+      "KZ": "Kazakhstan",
+      "KE": "Kenya",
+      "KI": "Kiribati",
+      "KW": "Kuwait",
+      "KG": "Kyrgyzstan",
+      "LA": "Laos",
+      "LV": "Latvia",
+      "LB": "Lebanon",
+      "LS": "Lesotho",
+      "LR": "Liberia",
+      "LY": "Libya",
+      "LI": "Liechtenstein",
+      "LT": "Lithuania",
+      "LU": "Luxembourg",
+      "MO": "Macao S.A.R., China",
+      "MK": "Macedonia",
+      "MG": "Madagascar",
+      "MW": "Malawi",
+      "MY": "Malaysia",
+      "MV": "Maldives",
+      "ML": "Mali",
+      "MT": "Malta",
+      "MH": "Marshall Islands",
+      "MQ": "Martinique",
+      "MR": "Mauritania",
+      "MU": "Mauritius",
+      "YT": "Mayotte",
+      "MX": "Mexico",
+      "FM": "Micronesia",
+      "MD": "Moldova",
+      "MC": "Monaco",
+      "MN": "Mongolia",
+      "ME": "Montenegro",
+      "MS": "Montserrat",
+      "MA": "Morocco",
+      "MZ": "Mozambique",
+      "MM": "Myanmar",
+      "NA": "Namibia",
+      "NR": "Nauru",
+      "NP": "Nepal",
+      "NL": "Netherlands",
+      "NC": "New Caledonia",
+      "NZ": "New Zealand",
+      "NI": "Nicaragua",
+      "NE": "Niger",
+      "NG": "Nigeria",
+      "NU": "Niue",
+      "NF": "Norfolk Island",
+      "KP": "North Korea",
+      "MP": "Northern Mariana Islands",
+      "NO": "Norway",
+      "OM": "Oman",
+      "PK": "Pakistan",
+      "PS": "Palestinian Territory",
+      "PA": "Panama",
+      "PG": "Papua New Guinea",
+      "PY": "Paraguay",
+      "PE": "Peru",
+      "PH": "Philippines",
+      "PN": "Pitcairn",
+      "PL": "Poland",
+      "PT": "Portugal",
+      "PR": "Puerto Rico",
+      "QA": "Qatar",
+      "RE": "Reunion",
+      "RO": "Romania",
+      "RU": "Russia",
+      "RW": "Rwanda",
+      "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
+      "BL": "Saint Barth&eacute;lemy",
+      "SH": "Saint Helena",
+      "KN": "Saint Kitts and Nevis",
+      "LC": "Saint Lucia",
+      "SX": "Saint Martin (Dutch part)",
+      "MF": "Saint Martin (French part)",
+      "PM": "Saint Pierre and Miquelon",
+      "VC": "Saint Vincent and the Grenadines",
+      "WS": "Samoa",
+      "SM": "San Marino",
+      "SA": "Saudi Arabia",
+      "SN": "Senegal",
+      "RS": "Serbia",
+      "SC": "Seychelles",
+      "SL": "Sierra Leone",
+      "SG": "Singapore",
+      "SK": "Slovakia",
+      "SI": "Slovenia",
+      "SB": "Solomon Islands",
+      "SO": "Somalia",
+      "ZA": "South Africa",
+      "GS": "South Georgia/Sandwich Islands",
+      "KR": "South Korea",
+      "SS": "South Sudan",
+      "ES": "Spain",
+      "LK": "Sri Lanka",
+      "SD": "Sudan",
+      "SR": "Suriname",
+      "SJ": "Svalbard and Jan Mayen",
+      "SZ": "Swaziland",
+      "SE": "Sweden",
+      "CH": "Switzerland",
+      "SY": "Syria",
+      "TW": "Taiwan",
+      "TJ": "Tajikistan",
+      "TZ": "Tanzania",
+      "TH": "Thailand",
+      "TL": "Timor-Leste",
+      "TG": "Togo",
+      "TK": "Tokelau",
+      "TO": "Tonga",
+      "TT": "Trinidad and Tobago",
+      "TN": "Tunisia",
+      "TR": "Turkey",
+      "TM": "Turkmenistan",
+      "TC": "Turks and Caicos Islands",
+      "TV": "Tuvalu",
+      "UG": "Uganda",
+      "UA": "Ukraine",
+      "AE": "United Arab Emirates",
+      "GB": "United Kingdom (UK)",
+      "US": "United States (US)",
+      "UM": "United States (US) Minor Outlying Islands",
+      "VI": "United States (US) Virgin Islands",
+      "UY": "Uruguay",
+      "UZ": "Uzbekistan",
+      "VU": "Vanuatu",
+      "VA": "Vatican",
+      "VE": "Venezuela",
+      "VN": "Vietnam",
+      "WF": "Wallis and Futuna",
+      "EH": "Western Sahara",
+      "YE": "Yemen",
+      "ZM": "Zambia",
+      "ZW": "Zimbabwe"
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_specific_ship_to_countries"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_default_customer_address",
+    "label": "Default customer location",
+    "description": "",
+    "type": "select",
+    "default": "geolocation",
+    "options": {
+      "": "No location by default",
+      "base": "Shop base address",
+      "geolocation": "Geolocate",
+      "geolocation_ajax": "Geolocate (with page caching support)"
+    },
+    "tip": "This option determines a customers default location. The MaxMind GeoLite Database will be periodically downloaded to your wp-content directory if using geolocation.",
+    "value": "geolocation",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_default_customer_address"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_calc_taxes",
+    "label": "Enable taxes",
+    "description": "Enable taxes and tax calculations",
+    "type": "checkbox",
+    "default": "no",
+    "value": "yes",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_calc_taxes"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_demo_store",
+    "label": "Store notice",
+    "description": "Enable site-wide store notice text",
+    "type": "checkbox",
+    "default": "no",
+    "value": "no",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_demo_store"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_demo_store_notice",
+    "label": "Store notice text",
+    "description": "",
+    "type": "textarea",
+    "default": "This is a demo store for testing purposes &mdash; no orders shall be fulfilled.",
+    "value": "This is a demo store for testing purposes &mdash; no orders shall be fulfilled.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_demo_store_notice"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_currency",
+    "label": "Currency",
+    "description": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+    "type": "select",
+    "default": "GBP",
+    "options": {
+      "AED": "United Arab Emirates dirham (&#x62f;.&#x625;)",
+      "AFN": "Afghan afghani (&#x60b;)",
+      "ALL": "Albanian lek (L)",
+      "AMD": "Armenian dram (AMD)",
+      "ANG": "Netherlands Antillean guilder (&fnof;)",
+      "AOA": "Angolan kwanza (Kz)",
+      "ARS": "Argentine peso (&#36;)",
+      "AUD": "Australian dollar (&#36;)",
+      "AWG": "Aruban florin (&fnof;)",
+      "AZN": "Azerbaijani manat (AZN)",
+      "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+      "BBD": "Barbadian dollar (&#36;)",
+      "BDT": "Bangladeshi taka (&#2547;&nbsp;)",
+      "BGN": "Bulgarian lev (&#1083;&#1074;.)",
+      "BHD": "Bahraini dinar (.&#x62f;.&#x628;)",
+      "BIF": "Burundian franc (Fr)",
+      "BMD": "Bermudian dollar (&#36;)",
+      "BND": "Brunei dollar (&#36;)",
+      "BOB": "Bolivian boliviano (Bs.)",
+      "BRL": "Brazilian real (&#82;&#36;)",
+      "BSD": "Bahamian dollar (&#36;)",
+      "BTC": "Bitcoin (&#3647;)",
+      "BTN": "Bhutanese ngultrum (Nu.)",
+      "BWP": "Botswana pula (P)",
+      "BYR": "Belarusian ruble (Br)",
+      "BZD": "Belize dollar (&#36;)",
+      "CAD": "Canadian dollar (&#36;)",
+      "CDF": "Congolese franc (Fr)",
+      "CHF": "Swiss franc (&#67;&#72;&#70;)",
+      "CLP": "Chilean peso (&#36;)",
+      "CNY": "Chinese yuan (&yen;)",
+      "COP": "Colombian peso (&#36;)",
+      "CRC": "Costa Rican col&oacute;n (&#x20a1;)",
+      "CUC": "Cuban convertible peso (&#36;)",
+      "CUP": "Cuban peso (&#36;)",
+      "CVE": "Cape Verdean escudo (&#36;)",
+      "CZK": "Czech koruna (&#75;&#269;)",
+      "DJF": "Djiboutian franc (Fr)",
+      "DKK": "Danish krone (DKK)",
+      "DOP": "Dominican peso (RD&#36;)",
+      "DZD": "Algerian dinar (&#x62f;.&#x62c;)",
+      "EGP": "Egyptian pound (EGP)",
+      "ERN": "Eritrean nakfa (Nfk)",
+      "ETB": "Ethiopian birr (Br)",
+      "EUR": "Euro (&euro;)",
+      "FJD": "Fijian dollar (&#36;)",
+      "FKP": "Falkland Islands pound (&pound;)",
+      "GBP": "Pound sterling (&pound;)",
+      "GEL": "Georgian lari (&#x10da;)",
+      "GGP": "Guernsey pound (&pound;)",
+      "GHS": "Ghana cedi (&#x20b5;)",
+      "GIP": "Gibraltar pound (&pound;)",
+      "GMD": "Gambian dalasi (D)",
+      "GNF": "Guinean franc (Fr)",
+      "GTQ": "Guatemalan quetzal (Q)",
+      "GYD": "Guyanese dollar (&#36;)",
+      "HKD": "Hong Kong dollar (&#36;)",
+      "HNL": "Honduran lempira (L)",
+      "HRK": "Croatian kuna (Kn)",
+      "HTG": "Haitian gourde (G)",
+      "HUF": "Hungarian forint (&#70;&#116;)",
+      "IDR": "Indonesian rupiah (Rp)",
+      "ILS": "Israeli new shekel (&#8362;)",
+      "IMP": "Manx pound (&pound;)",
+      "INR": "Indian rupee (&#8377;)",
+      "IQD": "Iraqi dinar (&#x639;.&#x62f;)",
+      "IRR": "Iranian rial (&#xfdfc;)",
+      "IRT": "Iranian toman (&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;)",
+      "ISK": "Icelandic kr&oacute;na (kr.)",
+      "JEP": "Jersey pound (&pound;)",
+      "JMD": "Jamaican dollar (&#36;)",
+      "JOD": "Jordanian dinar (&#x62f;.&#x627;)",
+      "JPY": "Japanese yen (&yen;)",
+      "KES": "Kenyan shilling (KSh)",
+      "KGS": "Kyrgyzstani som (&#x441;&#x43e;&#x43c;)",
+      "KHR": "Cambodian riel (&#x17db;)",
+      "KMF": "Comorian franc (Fr)",
+      "KPW": "North Korean won (&#x20a9;)",
+      "KRW": "South Korean won (&#8361;)",
+      "KWD": "Kuwaiti dinar (&#x62f;.&#x643;)",
+      "KYD": "Cayman Islands dollar (&#36;)",
+      "KZT": "Kazakhstani tenge (KZT)",
+      "LAK": "Lao kip (&#8365;)",
+      "LBP": "Lebanese pound (&#x644;.&#x644;)",
+      "LKR": "Sri Lankan rupee (&#xdbb;&#xdd4;)",
+      "LRD": "Liberian dollar (&#36;)",
+      "LSL": "Lesotho loti (L)",
+      "LYD": "Libyan dinar (&#x644;.&#x62f;)",
+      "MAD": "Moroccan dirham (&#x62f;.&#x645;.)",
+      "MDL": "Moldovan leu (MDL)",
+      "MGA": "Malagasy ariary (Ar)",
+      "MKD": "Macedonian denar (&#x434;&#x435;&#x43d;)",
+      "MMK": "Burmese kyat (Ks)",
+      "MNT": "Mongolian t&ouml;gr&ouml;g (&#x20ae;)",
+      "MOP": "Macanese pataca (P)",
+      "MRO": "Mauritanian ouguiya (UM)",
+      "MUR": "Mauritian rupee (&#x20a8;)",
+      "MVR": "Maldivian rufiyaa (.&#x783;)",
+      "MWK": "Malawian kwacha (MK)",
+      "MXN": "Mexican peso (&#36;)",
+      "MYR": "Malaysian ringgit (&#82;&#77;)",
+      "MZN": "Mozambican metical (MT)",
+      "NAD": "Namibian dollar (&#36;)",
+      "NGN": "Nigerian naira (&#8358;)",
+      "NIO": "Nicaraguan c&oacute;rdoba (C&#36;)",
+      "NOK": "Norwegian krone (&#107;&#114;)",
+      "NPR": "Nepalese rupee (&#8360;)",
+      "NZD": "New Zealand dollar (&#36;)",
+      "OMR": "Omani rial (&#x631;.&#x639;.)",
+      "PAB": "Panamanian balboa (B/.)",
+      "PEN": "Peruvian nuevo sol (S/.)",
+      "PGK": "Papua New Guinean kina (K)",
+      "PHP": "Philippine peso (&#8369;)",
+      "PKR": "Pakistani rupee (&#8360;)",
+      "PLN": "Polish z&#x142;oty (&#122;&#322;)",
+      "PRB": "Transnistrian ruble (&#x440;.)",
+      "PYG": "Paraguayan guaran&iacute; (&#8370;)",
+      "QAR": "Qatari riyal (&#x631;.&#x642;)",
+      "RON": "Romanian leu (lei)",
+      "RSD": "Serbian dinar (&#x434;&#x438;&#x43d;.)",
+      "RUB": "Russian ruble (&#8381;)",
+      "RWF": "Rwandan franc (Fr)",
+      "SAR": "Saudi riyal (&#x631;.&#x633;)",
+      "SBD": "Solomon Islands dollar (&#36;)",
+      "SCR": "Seychellois rupee (&#x20a8;)",
+      "SDG": "Sudanese pound (&#x62c;.&#x633;.)",
+      "SEK": "Swedish krona (&#107;&#114;)",
+      "SGD": "Singapore dollar (&#36;)",
+      "SHP": "Saint Helena pound (&pound;)",
+      "SLL": "Sierra Leonean leone (Le)",
+      "SOS": "Somali shilling (Sh)",
+      "SRD": "Surinamese dollar (&#36;)",
+      "SSP": "South Sudanese pound (&pound;)",
+      "STD": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra (Db)",
+      "SYP": "Syrian pound (&#x644;.&#x633;)",
+      "SZL": "Swazi lilangeni (L)",
+      "THB": "Thai baht (&#3647;)",
+      "TJS": "Tajikistani somoni (&#x405;&#x41c;)",
+      "TMT": "Turkmenistan manat (m)",
+      "TND": "Tunisian dinar (&#x62f;.&#x62a;)",
+      "TOP": "Tongan pa&#x2bb;anga (T&#36;)",
+      "TRY": "Turkish lira (&#8378;)",
+      "TTD": "Trinidad and Tobago dollar (&#36;)",
+      "TWD": "New Taiwan dollar (&#78;&#84;&#36;)",
+      "TZS": "Tanzanian shilling (Sh)",
+      "UAH": "Ukrainian hryvnia (&#8372;)",
+      "UGX": "Ugandan shilling (UGX)",
+      "USD": "United States dollar (&#36;)",
+      "UYU": "Uruguayan peso (&#36;)",
+      "UZS": "Uzbekistani som (UZS)",
+      "VEF": "Venezuelan bol&iacute;var (Bs F)",
+      "VND": "Vietnamese &#x111;&#x1ed3;ng (&#8363;)",
+      "VUV": "Vanuatu vatu (Vt)",
+      "WST": "Samoan t&#x101;l&#x101; (T)",
+      "XAF": "Central African CFA franc (Fr)",
+      "XCD": "East Caribbean dollar (&#36;)",
+      "XOF": "West African CFA franc (Fr)",
+      "XPF": "CFP franc (Fr)",
+      "YER": "Yemeni rial (&#xfdfc;)",
+      "ZAR": "South African rand (&#82;)",
+      "ZMW": "Zambian kwacha (ZK)"
+    },
+    "tip": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+    "value": "USD",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_currency"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_currency_pos",
+    "label": "Currency position",
+    "description": "This controls the position of the currency symbol.",
+    "type": "select",
+    "default": "left",
+    "options": {
+      "left": "Left (&#36;99.99)",
+      "right": "Right (99.99&#36;)",
+      "left_space": "Left with space (&#36; 99.99)",
+      "right_space": "Right with space (99.99 &#36;)"
+    },
+    "tip": "This controls the position of the currency symbol.",
+    "value": "left",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_currency_pos"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_price_thousand_sep",
+    "label": "Thousand separator",
+    "description": "This sets the thousand separator of displayed prices.",
+    "type": "text",
+    "default": ",",
+    "tip": "This sets the thousand separator of displayed prices.",
+    "value": ",",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_price_thousand_sep"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_price_decimal_sep",
+    "label": "Decimal separator",
+    "description": "This sets the decimal separator of displayed prices.",
+    "type": "text",
+    "default": ".",
+    "tip": "This sets the decimal separator of displayed prices.",
+    "value": ".",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_price_decimal_sep"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  },
+  {
+    "id": "woocommerce_price_num_decimals",
+    "label": "Number of decimals",
+    "description": "This sets the number of decimal points shown in displayed prices.",
+    "type": "number",
+    "default": "2",
+    "tip": "This sets the number of decimal points shown in displayed prices.",
+    "value": "2",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_price_num_decimals"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/settings/general"
+        }
+      ]
+    }
+  }
+]
+

Update a setting option

+

This API lets you make changes to a setting option.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/settings/<group_id>/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "value": "all_except"
+}'
+
const data = {
+  value: "all_except"
+};
+
+WooCommerce.put("settings/general/woocommerce_allowed_countries", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'value' => 'all_except'
+];
+
+print_r($woocommerce->put('settings/general/woocommerce_allowed_countries', $data));
+?>
+
data = {
+    "value": "all_except"
+}
+
+print(wcapi.put("settings/general/woocommerce_allowed_countries", data).json())
+
data = {
+  value: "all_except"
+}
+
+woocommerce.put("settings/general/woocommerce_allowed_countries", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "woocommerce_allowed_countries",
+  "label": "Selling location(s)",
+  "description": "This option lets you limit which countries you are willing to sell to.",
+  "type": "select",
+  "default": "all",
+  "options": {
+    "all": "Sell to all countries",
+    "all_except": "Sell to all countries, except for&hellip;",
+    "specific": "Sell to specific countries"
+  },
+  "tip": "This option lets you limit which countries you are willing to sell to.",
+  "value": "all_except",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/settings/general"
+      }
+    ]
+  }
+}
+

Batch update setting options

+

This API helps you to batch update multiple setting options.

+ + +

HTTP request

+
+
+ POST +
/wp-json/wc/v2/settings/<id>/batch
+
+
+
curl -X POST https://example.com/wp-json/wc/v2/settings/general/batch \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "update": [
+    {
+      "id": "woocommerce_allowed_countries",
+      "value": "all"
+    },
+    {
+      "id": "woocommerce_demo_store",
+      "value": "yes"
+    },
+    {
+      "id": "woocommerce_currency",
+      "value": "GBP"
+    }
+  ]
+}'
+
const data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+};
+
+WooCommerce.post("products/22/settings/general/batch", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'create' => [
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'Blue'
+                ]
+            ]
+        ],
+        [
+            'regular_price' => '10.00',
+            'attributes' => [
+                [
+                    'id' => 6,
+                    'option' => 'White'
+                ]
+            ]
+        ]
+    ],
+    'update' => [
+        [
+            'id' => 733,
+            'regular_price' => '10.00'
+        ]
+    ],
+    'delete' => [
+        732
+    ]
+];
+
+print_r($woocommerce->post('products/22/settings/general/batch', $data));
+?>
+
data = {
+    "create": [
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "Blue"
+                }
+            ]
+        },
+        {
+            "regular_price": "10.00",
+            "attributes": [
+                {
+                    "id": 6,
+                    "option": "White"
+                }
+            ]
+        }
+    ],
+    "update": [
+        {
+            "id": 733,
+            "regular_price": "10.00"
+        }
+    ],
+    "delete": [
+        732
+    ]
+}
+
+print(wcapi.post("products/22/settings/general/batch", data).json())
+
data = {
+  create: [
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "Blue"
+        }
+      ]
+    },
+    {
+      regular_price: "10.00",
+      attributes: [
+        {
+          id: 6,
+          option: "White"
+        }
+      ]
+    }
+  ],
+  update: [
+    {
+      id: 733,
+      regular_price: "10.00"
+    }
+  ],
+  delete: [
+    732
+  ]
+}
+
+woocommerce.post("products/22/settings/general/batch", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "update": [
+    {
+      "id": "woocommerce_allowed_countries",
+      "label": "Selling location(s)",
+      "description": "This option lets you limit which countries you are willing to sell to.",
+      "type": "select",
+      "default": "all",
+      "options": {
+        "all": "Sell to all countries",
+        "all_except": "Sell to all countries, except for&hellip;",
+        "specific": "Sell to specific countries"
+      },
+      "tip": "This option lets you limit which countries you are willing to sell to.",
+      "value": "all",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/settings/general"
+          }
+        ]
+      }
+    },
+    {
+      "id": "woocommerce_demo_store",
+      "label": "Store notice",
+      "description": "Enable site-wide store notice text",
+      "type": "checkbox",
+      "default": "no",
+      "value": "yes",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_demo_store"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/settings/general"
+          }
+        ]
+      }
+    },
+    {
+      "id": "woocommerce_currency",
+      "label": "Currency",
+      "description": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+      "type": "select",
+      "default": "GBP",
+      "options": {
+        "AED": "United Arab Emirates dirham (&#x62f;.&#x625;)",
+        "AFN": "Afghan afghani (&#x60b;)",
+        "ALL": "Albanian lek (L)",
+        "AMD": "Armenian dram (AMD)",
+        "ANG": "Netherlands Antillean guilder (&fnof;)",
+        "AOA": "Angolan kwanza (Kz)",
+        "ARS": "Argentine peso (&#36;)",
+        "AUD": "Australian dollar (&#36;)",
+        "AWG": "Aruban florin (&fnof;)",
+        "AZN": "Azerbaijani manat (AZN)",
+        "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+        "BBD": "Barbadian dollar (&#36;)",
+        "BDT": "Bangladeshi taka (&#2547;&nbsp;)",
+        "BGN": "Bulgarian lev (&#1083;&#1074;.)",
+        "BHD": "Bahraini dinar (.&#x62f;.&#x628;)",
+        "BIF": "Burundian franc (Fr)",
+        "BMD": "Bermudian dollar (&#36;)",
+        "BND": "Brunei dollar (&#36;)",
+        "BOB": "Bolivian boliviano (Bs.)",
+        "BRL": "Brazilian real (&#82;&#36;)",
+        "BSD": "Bahamian dollar (&#36;)",
+        "BTC": "Bitcoin (&#3647;)",
+        "BTN": "Bhutanese ngultrum (Nu.)",
+        "BWP": "Botswana pula (P)",
+        "BYR": "Belarusian ruble (Br)",
+        "BZD": "Belize dollar (&#36;)",
+        "CAD": "Canadian dollar (&#36;)",
+        "CDF": "Congolese franc (Fr)",
+        "CHF": "Swiss franc (&#67;&#72;&#70;)",
+        "CLP": "Chilean peso (&#36;)",
+        "CNY": "Chinese yuan (&yen;)",
+        "COP": "Colombian peso (&#36;)",
+        "CRC": "Costa Rican col&oacute;n (&#x20a1;)",
+        "CUC": "Cuban convertible peso (&#36;)",
+        "CUP": "Cuban peso (&#36;)",
+        "CVE": "Cape Verdean escudo (&#36;)",
+        "CZK": "Czech koruna (&#75;&#269;)",
+        "DJF": "Djiboutian franc (Fr)",
+        "DKK": "Danish krone (DKK)",
+        "DOP": "Dominican peso (RD&#36;)",
+        "DZD": "Algerian dinar (&#x62f;.&#x62c;)",
+        "EGP": "Egyptian pound (EGP)",
+        "ERN": "Eritrean nakfa (Nfk)",
+        "ETB": "Ethiopian birr (Br)",
+        "EUR": "Euro (&euro;)",
+        "FJD": "Fijian dollar (&#36;)",
+        "FKP": "Falkland Islands pound (&pound;)",
+        "GBP": "Pound sterling (&pound;)",
+        "GEL": "Georgian lari (&#x10da;)",
+        "GGP": "Guernsey pound (&pound;)",
+        "GHS": "Ghana cedi (&#x20b5;)",
+        "GIP": "Gibraltar pound (&pound;)",
+        "GMD": "Gambian dalasi (D)",
+        "GNF": "Guinean franc (Fr)",
+        "GTQ": "Guatemalan quetzal (Q)",
+        "GYD": "Guyanese dollar (&#36;)",
+        "HKD": "Hong Kong dollar (&#36;)",
+        "HNL": "Honduran lempira (L)",
+        "HRK": "Croatian kuna (Kn)",
+        "HTG": "Haitian gourde (G)",
+        "HUF": "Hungarian forint (&#70;&#116;)",
+        "IDR": "Indonesian rupiah (Rp)",
+        "ILS": "Israeli new shekel (&#8362;)",
+        "IMP": "Manx pound (&pound;)",
+        "INR": "Indian rupee (&#8377;)",
+        "IQD": "Iraqi dinar (&#x639;.&#x62f;)",
+        "IRR": "Iranian rial (&#xfdfc;)",
+        "IRT": "Iranian toman (&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;)",
+        "ISK": "Icelandic kr&oacute;na (kr.)",
+        "JEP": "Jersey pound (&pound;)",
+        "JMD": "Jamaican dollar (&#36;)",
+        "JOD": "Jordanian dinar (&#x62f;.&#x627;)",
+        "JPY": "Japanese yen (&yen;)",
+        "KES": "Kenyan shilling (KSh)",
+        "KGS": "Kyrgyzstani som (&#x441;&#x43e;&#x43c;)",
+        "KHR": "Cambodian riel (&#x17db;)",
+        "KMF": "Comorian franc (Fr)",
+        "KPW": "North Korean won (&#x20a9;)",
+        "KRW": "South Korean won (&#8361;)",
+        "KWD": "Kuwaiti dinar (&#x62f;.&#x643;)",
+        "KYD": "Cayman Islands dollar (&#36;)",
+        "KZT": "Kazakhstani tenge (KZT)",
+        "LAK": "Lao kip (&#8365;)",
+        "LBP": "Lebanese pound (&#x644;.&#x644;)",
+        "LKR": "Sri Lankan rupee (&#xdbb;&#xdd4;)",
+        "LRD": "Liberian dollar (&#36;)",
+        "LSL": "Lesotho loti (L)",
+        "LYD": "Libyan dinar (&#x644;.&#x62f;)",
+        "MAD": "Moroccan dirham (&#x62f;.&#x645;.)",
+        "MDL": "Moldovan leu (MDL)",
+        "MGA": "Malagasy ariary (Ar)",
+        "MKD": "Macedonian denar (&#x434;&#x435;&#x43d;)",
+        "MMK": "Burmese kyat (Ks)",
+        "MNT": "Mongolian t&ouml;gr&ouml;g (&#x20ae;)",
+        "MOP": "Macanese pataca (P)",
+        "MRO": "Mauritanian ouguiya (UM)",
+        "MUR": "Mauritian rupee (&#x20a8;)",
+        "MVR": "Maldivian rufiyaa (.&#x783;)",
+        "MWK": "Malawian kwacha (MK)",
+        "MXN": "Mexican peso (&#36;)",
+        "MYR": "Malaysian ringgit (&#82;&#77;)",
+        "MZN": "Mozambican metical (MT)",
+        "NAD": "Namibian dollar (&#36;)",
+        "NGN": "Nigerian naira (&#8358;)",
+        "NIO": "Nicaraguan c&oacute;rdoba (C&#36;)",
+        "NOK": "Norwegian krone (&#107;&#114;)",
+        "NPR": "Nepalese rupee (&#8360;)",
+        "NZD": "New Zealand dollar (&#36;)",
+        "OMR": "Omani rial (&#x631;.&#x639;.)",
+        "PAB": "Panamanian balboa (B/.)",
+        "PEN": "Peruvian nuevo sol (S/.)",
+        "PGK": "Papua New Guinean kina (K)",
+        "PHP": "Philippine peso (&#8369;)",
+        "PKR": "Pakistani rupee (&#8360;)",
+        "PLN": "Polish z&#x142;oty (&#122;&#322;)",
+        "PRB": "Transnistrian ruble (&#x440;.)",
+        "PYG": "Paraguayan guaran&iacute; (&#8370;)",
+        "QAR": "Qatari riyal (&#x631;.&#x642;)",
+        "RON": "Romanian leu (lei)",
+        "RSD": "Serbian dinar (&#x434;&#x438;&#x43d;.)",
+        "RUB": "Russian ruble (&#8381;)",
+        "RWF": "Rwandan franc (Fr)",
+        "SAR": "Saudi riyal (&#x631;.&#x633;)",
+        "SBD": "Solomon Islands dollar (&#36;)",
+        "SCR": "Seychellois rupee (&#x20a8;)",
+        "SDG": "Sudanese pound (&#x62c;.&#x633;.)",
+        "SEK": "Swedish krona (&#107;&#114;)",
+        "SGD": "Singapore dollar (&#36;)",
+        "SHP": "Saint Helena pound (&pound;)",
+        "SLL": "Sierra Leonean leone (Le)",
+        "SOS": "Somali shilling (Sh)",
+        "SRD": "Surinamese dollar (&#36;)",
+        "SSP": "South Sudanese pound (&pound;)",
+        "STD": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra (Db)",
+        "SYP": "Syrian pound (&#x644;.&#x633;)",
+        "SZL": "Swazi lilangeni (L)",
+        "THB": "Thai baht (&#3647;)",
+        "TJS": "Tajikistani somoni (&#x405;&#x41c;)",
+        "TMT": "Turkmenistan manat (m)",
+        "TND": "Tunisian dinar (&#x62f;.&#x62a;)",
+        "TOP": "Tongan pa&#x2bb;anga (T&#36;)",
+        "TRY": "Turkish lira (&#8378;)",
+        "TTD": "Trinidad and Tobago dollar (&#36;)",
+        "TWD": "New Taiwan dollar (&#78;&#84;&#36;)",
+        "TZS": "Tanzanian shilling (Sh)",
+        "UAH": "Ukrainian hryvnia (&#8372;)",
+        "UGX": "Ugandan shilling (UGX)",
+        "USD": "United States dollar (&#36;)",
+        "UYU": "Uruguayan peso (&#36;)",
+        "UZS": "Uzbekistani som (UZS)",
+        "VEF": "Venezuelan bol&iacute;var (Bs F)",
+        "VND": "Vietnamese &#x111;&#x1ed3;ng (&#8363;)",
+        "VUV": "Vanuatu vatu (Vt)",
+        "WST": "Samoan t&#x101;l&#x101; (T)",
+        "XAF": "Central African CFA franc (Fr)",
+        "XCD": "East Caribbean dollar (&#36;)",
+        "XOF": "West African CFA franc (Fr)",
+        "XPF": "CFP franc (Fr)",
+        "YER": "Yemeni rial (&#xfdfc;)",
+        "ZAR": "South African rand (&#82;)",
+        "ZMW": "Zambian kwacha (ZK)"
+      },
+      "tip": "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.",
+      "value": "GBP",
+      "_links": {
+        "self": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/settings/general/woocommerce_currency"
+          }
+        ],
+        "collection": [
+          {
+            "href": "https://example.com/wp-json/wc/v2/settings/general"
+          }
+        ]
+      }
+    }
+  ]
+}
+

Payment gateways

+

The payment gateways API allows you to view, and update individual payment gateways. Results are not paginated - all gateways will be returned.

+

Payment gateway properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringPayment gateway ID. read-only
titlestringPayment gateway title on checkout.
descriptionstringPayment gateway description on checkout.
orderintegerPayment gateway sort order.
enabledbooleanPayment gateway enabled status.
method_titlestringPayment gateway method title. read-only
method_descriptionstringPayment gateway method description. read-only
settingsobjectPayment gateway settings. See Payment gateway - Settings properties
+

Payment gateway - Settings properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the setting. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. read-only
valuestringSetting value.
defaultstringDefault value for the setting. read-only
tipstringAdditional help text shown to the user about the setting. read-only
placeholderstringPlaceholder text to be displayed in text inputs. read-only
+

Retrieve an payment gateway

+

This API lets you retrieve and view a specific payment gateway.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/payment_gateways/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/payment_gateways/bacs \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("payment_gateways/bacs")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('payment_gateways/bacs')); ?>
+
print(wcapi.get("payment_gateways/bacs").json())
+
woocommerce.get("payment_gateways/bacs").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "bacs",
+  "title": "Direct bank transfer",
+  "description": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+  "order": 0,
+  "enabled": true,
+  "method_title": "BACS",
+  "method_description": "Allows payments by BACS, more commonly known as direct bank/wire transfer.",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Direct bank transfer",
+      "default": "Direct bank transfer",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "instructions": {
+      "id": "instructions",
+      "label": "Instructions",
+      "description": "Instructions that will be added to the thank you page and emails.",
+      "type": "textarea",
+      "value": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+      "default": "",
+      "tip": "Instructions that will be added to the thank you page and emails.",
+      "placeholder": ""
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/payment_gateways/bacs"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/payment_gateways"
+      }
+    ]
+  }
+}
+

List all payment gateways

+

This API helps you to view all the payment gateways.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/payment_gateways
+
+
+
curl https://example.com/wp-json/wc/v2/payment_gateways \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("payment_gateways")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('payment_gateways')); ?>
+
print(wcapi.get("payment_gateways").json())
+
woocommerce.get("payment_gateways").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "bacs",
+    "title": "Direct bank transfer",
+    "description": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+    "order": 0,
+    "enabled": true,
+    "method_title": "BACS",
+    "method_description": "Allows payments by BACS, more commonly known as direct bank/wire transfer.",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Direct bank transfer",
+        "default": "Direct bank transfer",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "instructions": {
+        "id": "instructions",
+        "label": "Instructions",
+        "description": "Instructions that will be added to the thank you page and emails.",
+        "type": "textarea",
+        "value": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+        "default": "",
+        "tip": "Instructions that will be added to the thank you page and emails.",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways/bacs"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways"
+        }
+      ]
+    }
+  },
+  {
+    "id": "cheque",
+    "title": "Check payments",
+    "description": "Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.",
+    "order": 1,
+    "enabled": false,
+    "method_title": "Check payments",
+    "method_description": "Allows check payments. Why would you take checks in this day and age? Well you probably wouldn't but it does allow you to make test purchases for testing order emails and the 'success' pages etc.",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Check payments",
+        "default": "Check payments",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "instructions": {
+        "id": "instructions",
+        "label": "Instructions",
+        "description": "Instructions that will be added to the thank you page and emails.",
+        "type": "textarea",
+        "value": "",
+        "default": "",
+        "tip": "Instructions that will be added to the thank you page and emails.",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways/cheque"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways"
+        }
+      ]
+    }
+  },
+  {
+    "id": "cod",
+    "title": "Cash on delivery",
+    "description": "Pay with cash upon delivery.",
+    "order": 2,
+    "enabled": false,
+    "method_title": "Cash on delivery",
+    "method_description": "Have your customers pay with cash (or by other means) upon delivery.",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "Payment method description that the customer will see on your checkout.",
+        "type": "text",
+        "value": "Cash on delivery",
+        "default": "Cash on delivery",
+        "tip": "Payment method description that the customer will see on your checkout.",
+        "placeholder": ""
+      },
+      "instructions": {
+        "id": "instructions",
+        "label": "Instructions",
+        "description": "Instructions that will be added to the thank you page.",
+        "type": "textarea",
+        "value": "",
+        "default": "Pay with cash upon delivery.",
+        "tip": "Instructions that will be added to the thank you page.",
+        "placeholder": ""
+      },
+      "enable_for_methods": {
+        "id": "enable_for_methods",
+        "label": "Enable for shipping methods",
+        "description": "If COD is only available for certain methods, set it up here. Leave blank to enable for all methods.",
+        "type": "multiselect",
+        "value": "",
+        "default": "",
+        "tip": "If COD is only available for certain methods, set it up here. Leave blank to enable for all methods.",
+        "placeholder": "",
+        "options": {
+          "flat_rate": "Flat rate",
+          "free_shipping": "Free shipping",
+          "local_pickup": "Local pickup"
+        }
+      },
+      "enable_for_virtual": {
+        "id": "enable_for_virtual",
+        "label": "Accept COD if the order is virtual",
+        "description": "",
+        "type": "checkbox",
+        "value": "yes",
+        "default": "yes",
+        "tip": "",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways/cod"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways"
+        }
+      ]
+    }
+  },
+  {
+    "id": "paypal",
+    "title": "PayPal",
+    "description": "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.",
+    "order": 3,
+    "enabled": true,
+    "method_title": "PayPal",
+    "method_description": "PayPal Standard sends customers to PayPal to enter their payment information. PayPal IPN requires fsockopen/cURL support to update order statuses after payment. Check the <a href=\"https://example.com/wp-admin/admin.php?page=wc-status\">system status</a> page for more details.",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "PayPal",
+        "default": "PayPal",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "email": {
+        "id": "email",
+        "label": "PayPal email",
+        "description": "Please enter your PayPal email address; this is needed in order to take payment.",
+        "type": "email",
+        "value": "me@example.com",
+        "default": "me@example.com",
+        "tip": "Please enter your PayPal email address; this is needed in order to take payment.",
+        "placeholder": "you@youremail.com"
+      },
+      "testmode": {
+        "id": "testmode",
+        "label": "Enable PayPal sandbox",
+        "description": "PayPal sandbox can be used to test payments. Sign up for a <a href=\"https://developer.paypal.com/\">developer account</a>.",
+        "type": "checkbox",
+        "value": "yes",
+        "default": "no",
+        "tip": "PayPal sandbox can be used to test payments. Sign up for a <a href=\"https://developer.paypal.com/\">developer account</a>.",
+        "placeholder": ""
+      },
+      "debug": {
+        "id": "debug",
+        "label": "Enable logging",
+        "description": "Log PayPal events, such as IPN requests, inside <code>/var/www/woocommerce/wp-content/uploads/wc-logs/paypal-de01f7c6894774e7ac8e4207bb8bac2f.log</code>",
+        "type": "checkbox",
+        "value": "yes",
+        "default": "no",
+        "tip": "Log PayPal events, such as IPN requests, inside <code>/var/www/woocommerce/wp-content/uploads/wc-logs/paypal-de01f7c6894774e7ac8e4207bb8bac2f.log</code>",
+        "placeholder": ""
+      },
+      "receiver_email": {
+        "id": "receiver_email",
+        "label": "Receiver email",
+        "description": "If your main PayPal email differs from the PayPal email entered above, input your main receiver email for your PayPal account here. This is used to validate IPN requests.",
+        "type": "email",
+        "value": "me@example.com",
+        "default": "",
+        "tip": "If your main PayPal email differs from the PayPal email entered above, input your main receiver email for your PayPal account here. This is used to validate IPN requests.",
+        "placeholder": "you@youremail.com"
+      },
+      "identity_token": {
+        "id": "identity_token",
+        "label": "PayPal identity token",
+        "description": "Optionally enable \"Payment Data Transfer\" (Profile > Profile and Settings > My Selling Tools > Website Preferences) and then copy your identity token here. This will allow payments to be verified without the need for PayPal IPN.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Optionally enable \"Payment Data Transfer\" (Profile > Profile and Settings > My Selling Tools > Website Preferences) and then copy your identity token here. This will allow payments to be verified without the need for PayPal IPN.",
+        "placeholder": ""
+      },
+      "invoice_prefix": {
+        "id": "invoice_prefix",
+        "label": "Invoice prefix",
+        "description": "Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number.",
+        "type": "text",
+        "value": "WC-",
+        "default": "WC-",
+        "tip": "Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number.",
+        "placeholder": ""
+      },
+      "send_shipping": {
+        "id": "send_shipping",
+        "label": "Send shipping details to PayPal instead of billing.",
+        "description": "PayPal allows us to send one address. If you are using PayPal for shipping labels you may prefer to send the shipping address rather than billing.",
+        "type": "checkbox",
+        "value": "no",
+        "default": "no",
+        "tip": "PayPal allows us to send one address. If you are using PayPal for shipping labels you may prefer to send the shipping address rather than billing.",
+        "placeholder": ""
+      },
+      "address_override": {
+        "id": "address_override",
+        "label": "Enable \"address_override\" to prevent address information from being changed.",
+        "description": "PayPal verifies addresses therefore this setting can cause errors (we recommend keeping it disabled).",
+        "type": "checkbox",
+        "value": "no",
+        "default": "no",
+        "tip": "PayPal verifies addresses therefore this setting can cause errors (we recommend keeping it disabled).",
+        "placeholder": ""
+      },
+      "paymentaction": {
+        "id": "paymentaction",
+        "label": "Payment action",
+        "description": "Choose whether you wish to capture funds immediately or authorize payment only.",
+        "type": "select",
+        "value": "sale",
+        "default": "sale",
+        "tip": "Choose whether you wish to capture funds immediately or authorize payment only.",
+        "placeholder": "",
+        "options": {
+          "sale": "Capture",
+          "authorization": "Authorize"
+        }
+      },
+      "page_style": {
+        "id": "page_style",
+        "label": "Page style",
+        "description": "Optionally enter the name of the page style you wish to use. These are defined within your PayPal account. This affects classic PayPal checkout screens.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Optionally enter the name of the page style you wish to use. These are defined within your PayPal account. This affects classic PayPal checkout screens.",
+        "placeholder": "Optional"
+      },
+      "image_url": {
+        "id": "image_url",
+        "label": "Image url",
+        "description": "Optionally enter the URL to a 150x50px image displayed as your logo in the upper left corner of the PayPal checkout pages.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Optionally enter the URL to a 150x50px image displayed as your logo in the upper left corner of the PayPal checkout pages.",
+        "placeholder": "Optional"
+      },
+      "api_username": {
+        "id": "api_username",
+        "label": "API username",
+        "description": "Get your API credentials from PayPal.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Get your API credentials from PayPal.",
+        "placeholder": "Optional"
+      },
+      "api_password": {
+        "id": "api_password",
+        "label": "API password",
+        "description": "Get your API credentials from PayPal.",
+        "type": "password",
+        "value": "",
+        "default": "",
+        "tip": "Get your API credentials from PayPal.",
+        "placeholder": "Optional"
+      },
+      "api_signature": {
+        "id": "api_signature",
+        "label": "API signature",
+        "description": "Get your API credentials from PayPal.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Get your API credentials from PayPal.",
+        "placeholder": "Optional"
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways/paypal"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/payment_gateways"
+        }
+      ]
+    }
+  }
+]
+

Update a payment gateway

+

This API lets you make changes to a payment gateway.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/payment_gateways/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/payment_gateways/bacs \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "enabled": false
+}'
+
const data = {
+  enabled: true
+};
+
+WooCommerce.put("payment_gateways/bacs", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php 
+$data = [
+    'enabled' => true
+];
+
+print_r($woocommerce->put('payment_gateways/bacs', $data));
+?>
+
data = {
+    "enabled": True
+}
+
+print(wcapi.put("payment_gateways/bacs", data).json())
+
data = {
+  enabled: true
+}
+
+woocommerce.put("payment_gateways/bacs", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "bacs",
+  "title": "Direct bank transfer",
+  "description": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+  "order": 0,
+  "enabled": false,
+  "method_title": "BACS",
+  "method_description": "Allows payments by BACS, more commonly known as direct bank/wire transfer.",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Direct bank transfer",
+      "default": "Direct bank transfer",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "instructions": {
+      "id": "instructions",
+      "label": "Instructions",
+      "description": "Instructions that will be added to the thank you page and emails.",
+      "type": "textarea",
+      "value": "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won't be shipped until the funds have cleared in our account.",
+      "default": "",
+      "tip": "Instructions that will be added to the thank you page and emails.",
+      "placeholder": ""
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/payment_gateways/bacs"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/payment_gateways"
+      }
+    ]
+  }
+}
+

Shipping zones

+

The shipping zones API allows you to create, view, update, and delete individual shipping zones.

+

Shipping zone properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
namestringShipping zone name. mandatory
orderintegerShipping zone order.
+

Create a shipping zone

+

This API helps you to create a new shipping zone.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/shipping/zones
+
+
+ +
+

JSON response example:

+
+
curl -X POST https://example.com/wp-json/wc/v2/shipping/zones \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "name": "Brazil"
+}'
+
const data = {
+  name: "Brazil"
+};
+
+WooCommerce.post("shipping/zones", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'name' => 'Brazil'
+];
+
+print_r($woocommerce->post('shipping/zones', $data));
+?>
+
data = {
+    "name": "Brazil"
+}
+
+print(wcapi.post("shipping/zones", data).json())
+
data = {
+  name: "Brazil"
+}
+
+woocommerce.post("shipping/zones", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

Retrieve a shipping zone

+

This API lets you retrieve and view a specific shipping zone by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping/zones/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/shipping/zones/5 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5')); ?>
+
print(wcapi.get("shipping/zones/5").json())
+
woocommerce.get("shipping/zones/5").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 0,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

List all shipping zones

+

This API helps you to view all the shipping zones.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping/zones
+
+
+
curl https://example.com/wp-json/wc/v2/shipping/zones \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones')); ?>
+
print(wcapi.get("shipping/zones").json())
+
woocommerce.get("shipping/zones").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": 0,
+    "name": "Rest of the World",
+    "order": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/0"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones"
+        }
+      ],
+      "describedby": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/0/locations"
+        }
+      ]
+    }
+  },
+  {
+    "id": 5,
+    "name": "Brazil",
+    "order": 0,
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones"
+        }
+      ],
+      "describedby": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+        }
+      ]
+    }
+  }
+]
+

Update a shipping zone

+

This API lets you make changes to a shipping zone.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/shipping/zones/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/shipping/zones/5 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "order": 1
+}'
+
const data = {
+  order: 1
+};
+
+WooCommerce.put("shipping/zones/5", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'order' => 1
+];
+
+print_r($woocommerce->put('shipping/zones/5', $data));
+?>
+
data = {
+    "order": 1
+}
+
+print(wcapi.put("shipping/zones/5", data).json())
+
data = {
+  order: 1
+}
+
+woocommerce.put("shipping/zones/5", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

Delete a shipping zone

+

This API helps you delete a shipping zone.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/shipping/zones/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/shipping/zones/5?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("shipping/zones/5", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('shipping/zones/5', ['force' => true])); ?>
+
print(wcapi.delete("shipping/zones/5", params={"force": True}).json())
+
woocommerce.delete("shipping/zones/5", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": 5,
+  "name": "Brazil",
+  "order": 1,
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones"
+      }
+    ],
+    "describedby": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Shipping zone locations

+

The shipping zone locations API allows you to view and batch update locations of a shipping zone.

+

Shipping location properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
codestringShipping zone location code.
typestringShipping zone location type. Options: postcode, state, country and continent. Default is country.
+

List all locations of a shipping zone

+

This API helps you to view all the locations of a shipping zone.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping/zones/<id>/locations
+
+
+
curl https://example.com/wp-json/wc/v2/shipping/zones/5/locations \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5/locations")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5/locations')); ?>
+
print(wcapi.get("shipping/zones/5/locations").json())
+
woocommerce.get("shipping/zones/5/locations").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "code": "BR",
+    "type": "country",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+        }
+      ]
+    }
+  }
+]
+

Update a locations of a shipping zone

+

This API lets you make changes to locations of a shipping zone.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/shipping/zones/<id>/locations
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/shipping/zones/5/locations \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '[
+  {
+    "code": "BR:SP",
+    "type": "state"
+  },
+  {
+    "code": "BR:RJ",
+    "type": "state"
+  }
+]'
+
var data = [
+  {
+    code: 'BR:SP',
+    type: 'state'
+  },
+  {
+    code: 'BR:RJ',
+    type: 'state'
+  }
+];
+
+WooCommerce.put("shipping/zones/5/locations", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    [
+        'code' => 'BR:SP',
+        'type' => 'state'
+    ],
+    [
+        'code' => 'BR:RJ',
+        'type' => 'state'
+    ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/locations', $data));
+?>
+
data = [
+    {
+        "code": "BR:SP",
+        "type": "state"
+    },
+    {
+        "code": "BR:RJ",
+        "type": "state"
+    }
+]
+
+print(wcapi.put("shipping/zones/5/locations", data).json())
+
data = [
+  {
+    code: "BR:SP",
+    type: "state"
+  },
+  {
+    code: "BR:RJ",
+    type: "state"
+  }
+]
+
+woocommerce.put("shipping/zones/5/locations", data).parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "code": "BR:SP",
+    "type": "state",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+        }
+      ]
+    }
+  },
+  {
+    "code": "BR:RJ",
+    "type": "state",
+    "_links": {
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/locations"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+        }
+      ]
+    }
+  }
+]
+

Shipping zone methods

+

The shipping zone methods API allows you to create, view, update, and delete individual methods of a shipping zone.

+

Shipping method properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
instance_idintegerShipping method instance ID. read-only
titlestringShipping method customer facing title. read-only
orderintegerShipping method sort order.
enabledbooleanShipping method enabled status.
method_idstringShipping method ID. read-only mandatory
method_titlestringShipping method title. read-only
method_descriptionstringShipping method description. read-only
settingsobjectShipping method settings. See Shipping method - Settings properties
+

Shipping method - Settings properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the setting. read-only
labelstringA human readable label for the setting used in interfaces. read-only
descriptionstringA human readable description for the setting used in interfaces. read-only
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. read-only
valuestringSetting value.
defaultstringDefault value for the setting. read-only
tipstringAdditional help text shown to the user about the setting. read-only
placeholderstringPlaceholder text to be displayed in text inputs. read-only
+

Include a shipping method to a shipping zone

+

This API helps you to create a new shipping method to a shipping zone.

+

HTTP request

+
+
+ POST +
/wp-json/wc/v2/shipping/zones/<id>/methods
+
+
+ +
+

JSON response example:

+
+
curl -X POST https://example.com/wp-json/wc/v2/shipping/zones/5/methods \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "method_id": "flat_rate"
+}'
+
const data = {
+  method_id: "flat_rate"
+};
+
+WooCommerce.post("shipping/zones/5/methods", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'method_id' => 'flat_rate'
+];
+
+print_r($woocommerce->post('shipping/zones/5/methods', $data));
+?>
+
data = {
+    "method_id": "flat_rate"
+}
+
+print(wcapi.post("shipping/zones/5/methods", data).json())
+
data = {
+  method_id: "flat_rate"
+}
+
+woocommerce.post("shipping/zones/5/methods", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "0",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ]
+  }
+}
+

Retrieve a shipping method from a shipping zone

+

This API lets you retrieve and view a specific shipping method from a shipping zone by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26 \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5/methods/26")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5/methods/26')); ?>
+
print(wcapi.get("shipping/zones/5/methods/26").json())
+
woocommerce.get("shipping/zones/5/methods/26").parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "0",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ]
+  }
+}
+

List all shipping methods from a shipping zone

+

This API helps you to view all the shipping methods from a shipping zone.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping/zones/<id>/methods
+
+
+
curl https://example.com/wp-json/wc/v2/shipping/zones/5/methods \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping/zones/5/methods")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping/zones/5/methods')); ?>
+
print(wcapi.get("shipping/zones/5/methods").json())
+
woocommerce.get("shipping/zones/5/methods").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "instance_id": 26,
+    "title": "Flat rate",
+    "order": 1,
+    "enabled": true,
+    "method_id": "flat_rate",
+    "method_title": "Flat rate",
+    "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Method title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Flat rate",
+        "default": "Flat rate",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "tax_status": {
+        "id": "tax_status",
+        "label": "Tax status",
+        "description": "",
+        "type": "select",
+        "value": "taxable",
+        "default": "taxable",
+        "tip": "",
+        "placeholder": "",
+        "options": {
+          "taxable": "Taxable",
+          "none": "None"
+        }
+      },
+      "cost": {
+        "id": "cost",
+        "label": "Cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "0",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": ""
+      },
+      "class_costs": {
+        "id": "class_costs",
+        "label": "Shipping class costs",
+        "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+        "type": "title",
+        "value": "",
+        "default": "",
+        "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+        "placeholder": ""
+      },
+      "class_cost_92": {
+        "id": "class_cost_92",
+        "label": "\"Express\" shipping class cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": "N/A"
+      },
+      "class_cost_91": {
+        "id": "class_cost_91",
+        "label": "\"Priority\" shipping class cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": "N/A"
+      },
+      "no_class_cost": {
+        "id": "no_class_cost",
+        "label": "No shipping class cost",
+        "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "type": "text",
+        "value": "",
+        "default": "",
+        "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+        "placeholder": "N/A"
+      },
+      "type": {
+        "id": "type",
+        "label": "Calculation type",
+        "description": "",
+        "type": "select",
+        "value": "class",
+        "default": "class",
+        "tip": "",
+        "placeholder": "",
+        "options": {
+          "class": "Per class: Charge shipping for each shipping class individually",
+          "order": "Per order: Charge shipping for the most expensive shipping class"
+        }
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+        }
+      ]
+    }
+  },
+  {
+    "instance_id": 27,
+    "title": "Free shipping",
+    "order": 2,
+    "enabled": true,
+    "method_id": "free_shipping",
+    "method_title": "Free shipping",
+    "method_description": "<p>Free shipping is a special method which can be triggered with coupons and minimum spends.</p>\n",
+    "settings": {
+      "title": {
+        "id": "title",
+        "label": "Title",
+        "description": "This controls the title which the user sees during checkout.",
+        "type": "text",
+        "value": "Free shipping",
+        "default": "Free shipping",
+        "tip": "This controls the title which the user sees during checkout.",
+        "placeholder": ""
+      },
+      "requires": {
+        "id": "requires",
+        "label": "Free shipping requires...",
+        "description": "",
+        "type": "select",
+        "value": "",
+        "default": "",
+        "tip": "",
+        "placeholder": "",
+        "options": {
+          "": "N/A",
+          "coupon": "A valid free shipping coupon",
+          "min_amount": "A minimum order amount",
+          "either": "A minimum order amount OR a coupon",
+          "both": "A minimum order amount AND a coupon"
+        }
+      },
+      "min_amount": {
+        "id": "min_amount",
+        "label": "Minimum order amount",
+        "description": "Users will need to spend this amount to get free shipping (if enabled above).",
+        "type": "price",
+        "value": "0",
+        "default": "",
+        "tip": "Users will need to spend this amount to get free shipping (if enabled above).",
+        "placeholder": ""
+      }
+    },
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods/27"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods"
+        }
+      ],
+      "describes": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+        }
+      ]
+    }
+  }
+]
+

Update a shipping method of a shipping zone

+

This API lets you make changes to a shipping method of a shipping zone.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26 \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "settings": {
+    "cost": "20.00"
+  }
+}'
+
const data = {
+  settings: {
+    cost: "20.00"
+  }
+};
+
+WooCommerce.put("shipping/zones/5/methods/26", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'regular_price' => [
+        'cost' => '20.00'
+    ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/methods/26', $data));
+?>
+
data = {
+    "regular_price": {
+        "cost": "20.00"
+    }
+}
+
+print(wcapi.put("shipping/zones/5/methods/26", data).json())
+
data = {
+  regular_price: {
+    "cost": "20.00"
+  }
+}
+
+woocommerce.put("shipping/zones/5/methods/26", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "20.00",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ]
+  }
+}
+

Delete a shipping method from a shipping zone

+

This API helps you delete a shipping method from a shipping zone.

+

HTTP request

+
+
+ DELETE +
/wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
+
+
+
curl -X DELETE https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26?force=true \
+    -u consumer_key:consumer_secret
+
WooCommerce.delete("shipping/zones/5/methods/26", {
+  force: true
+})
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->delete('shipping/zones/5/methods/26', ['force' => true])); ?>
+
print(wcapi.delete("shipping/zones/5/methods/26", params={"force": True}).json())
+
woocommerce.delete("shipping/zones/5/methods/26", force: true).parsed_response
+
+
+

JSON response example:

+
+
{
+  "instance_id": 26,
+  "title": "Flat rate",
+  "order": 1,
+  "enabled": true,
+  "method_id": "flat_rate",
+  "method_title": "Flat rate",
+  "method_description": "<p>Lets you charge a fixed rate for shipping.</p>\n",
+  "settings": {
+    "title": {
+      "id": "title",
+      "label": "Method title",
+      "description": "This controls the title which the user sees during checkout.",
+      "type": "text",
+      "value": "Flat rate",
+      "default": "Flat rate",
+      "tip": "This controls the title which the user sees during checkout.",
+      "placeholder": ""
+    },
+    "tax_status": {
+      "id": "tax_status",
+      "label": "Tax status",
+      "description": "",
+      "type": "select",
+      "value": "taxable",
+      "default": "taxable",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "taxable": "Taxable",
+        "none": "None"
+      }
+    },
+    "cost": {
+      "id": "cost",
+      "label": "Cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "20.00",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": ""
+    },
+    "class_costs": {
+      "id": "class_costs",
+      "label": "Shipping class costs",
+      "description": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "type": "title",
+      "value": "",
+      "default": "",
+      "tip": "These costs can optionally be added based on the <a href=\"https://example.com/wp-admin/admin.php?page=wc-settings&tab=shipping&section=classes\">product shipping class</a>.",
+      "placeholder": ""
+    },
+    "class_cost_92": {
+      "id": "class_cost_92",
+      "label": "\"Express\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "class_cost_91": {
+      "id": "class_cost_91",
+      "label": "\"Priority\" shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "no_class_cost": {
+      "id": "no_class_cost",
+      "label": "No shipping class cost",
+      "description": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "type": "text",
+      "value": "",
+      "default": "",
+      "tip": "Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.<br/><br/>Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent=\"10\" min_fee=\"20\" max_fee=\"\"]</code> for percentage based fees.",
+      "placeholder": "N/A"
+    },
+    "type": {
+      "id": "type",
+      "label": "Calculation type",
+      "description": "",
+      "type": "select",
+      "value": "class",
+      "default": "class",
+      "tip": "",
+      "placeholder": "",
+      "options": {
+        "class": "Per class: Charge shipping for each shipping class individually",
+        "order": "Per order: Charge shipping for the most expensive shipping class"
+      }
+    }
+  },
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5/methods"
+      }
+    ],
+    "describes": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping/zones/5"
+      }
+    ]
+  }
+}
+

Available parameters

+ + + + + + + + + + + + +
ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.
+

Shipping methods

+

The shipping methods API allows you to view individual shipping methods.

+

Shipping method properties

+ + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringMethod ID. read-only
titlestringShipping method title. read-only
descriptionstringShipping method description. read-only
+

Retrieve a shipping method

+

This API lets you retrieve and view a specific shipping method.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping_methods/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/shipping_methods/flat_rate \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping_methods/flat_rate")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping_methods/flat_rate')); ?>
+
print(wcapi.get("shipping_methods/flat_rate").json())
+
woocommerce.get("shipping_methods/flat_rate").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "flat_rate",
+  "title": "Flat rate",
+  "description": "Lets you charge a fixed rate for shipping.",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping_methods/flat_rate"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/shipping_methods"
+      }
+    ]
+  }
+}
+

List all shipping methods

+

This API helps you to view all the shipping methods.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/shipping_methods
+
+
+
curl https://example.com/wp-json/wc/v2/shipping_methods \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("shipping_methods")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('shipping_methods')); ?>
+
print(wcapi.get("shipping_methods").json())
+
woocommerce.get("shipping_methods").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "flat_rate",
+    "title": "Flat rate",
+    "description": "Lets you charge a fixed rate for shipping.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping_methods/flat_rate"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping_methods"
+        }
+      ]
+    }
+  },
+  {
+    "id": "free_shipping",
+    "title": "Free shipping",
+    "description": "Free shipping is a special method which can be triggered with coupons and minimum spends.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping_methods/free_shipping"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping_methods"
+        }
+      ]
+    }
+  },
+  {
+    "id": "local_pickup",
+    "title": "Local pickup",
+    "description": "Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping_methods/local_pickup"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/shipping_methods"
+        }
+      ]
+    }
+  }
+]
+

System status

+

The system status API allows you to view all system status items.

+

System status properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
environmentobjectEnvironment. See System status - Environment properties read-only
databaseobjectDatabase. See System status - Database properties read-only
active_pluginsarrayActive plugins. read-only
themeobjectTheme. See System status - Theme properties read-only
settingsobjectSettings. See System status - Settings properties read-only
securityobjectSecurity. See System status - Security properties read-only
pagesarrayWooCommerce pages. read-only
+

System status - Environment properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
home_urlstringHome URL. read-only
site_urlstringSite URL. read-only
wc_versionstringWooCommerce version. read-only
log_directorystringLog directory. read-only
log_directory_writablebooleanIs log directory writable? read-only
wp_versionstringWordPress version. read-only
wp_multisitebooleanIs WordPress multisite? read-only
wp_memory_limitintegerWordPress memory limit. read-only
wp_debug_modebooleanIs WordPress debug mode active? read-only
wp_cronbooleanAre WordPress cron jobs enabled? read-only
languagestringWordPress language. read-only
server_infostringServer info. read-only
php_versionstringPHP version. read-only
php_post_max_sizeintegerPHP post max size. read-only
php_max_execution_timeintegerPHP max execution time. read-only
php_max_input_varsintegerPHP max input vars. read-only
curl_versionstringcURL version. read-only
suhosin_installedbooleanIs SUHOSIN installed? read-only
max_upload_sizeintegerMax upload size. read-only
mysql_versionstringMySQL version. read-only
default_timezonestringDefault timezone. read-only
fsockopen_or_curl_enabledbooleanIs fsockopen/cURL enabled? read-only
soapclient_enabledbooleanIs SoapClient class enabled? read-only
domdocument_enabledbooleanIs DomDocument class enabled? read-only
gzip_enabledbooleanIs GZip enabled? read-only
mbstring_enabledbooleanIs mbstring enabled? read-only
remote_post_successfulbooleanRemote POST successful? read-only
remote_post_responsestringRemote POST response. read-only
remote_get_successfulbooleanRemote GET successful? read-only
remote_get_responsestringRemote GET response. read-only
+

System status - Database properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
wc_database_versionstringWC database version. read-only
database_prefixstringDatabase prefix. read-only
maxmind_geoip_databasestringMaxMind GeoIP database. read-only
database_tablesarrayDatabase tables. read-only
+

System status - Theme properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
namestringTheme name. read-only
versionstringTheme version. read-only
version_lateststringLatest version of theme. read-only
author_urlstringTheme author URL. read-only
is_child_themebooleanIs this theme a child theme? read-only
has_woocommerce_supportbooleanDoes the theme declare WooCommerce support? read-only
has_woocommerce_filebooleanDoes the theme have a woocommerce.php file? read-only
has_outdated_templatesbooleanDoes this theme have outdated templates? read-only
overridesarrayTemplate overrides. read-only
parent_namestringParent theme name. read-only
parent_versionstringParent theme version. read-only
parent_author_urlstringParent theme author URL. read-only
+

System status - Settings properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
api_enabledbooleanREST API enabled? read-only
force_sslbooleanSSL forced? read-only
currencystringCurrency. read-only
currency_symbolstringCurrency symbol. read-only
currency_positionstringCurrency position. read-only
thousand_separatorstringThousand separator. read-only
decimal_separatorstringDecimal separator. read-only
number_of_decimalsintegerNumber of decimals. read-only
geolocation_enabledbooleanGeolocation enabled? read-only
taxonomiesarrayTaxonomy terms for product/order statuses. read-only
+

System status - Security properties

+ + + + + + + + + + + + + + + + + +
AttributeTypeDescription
secure_connectionbooleanIs the connection to your store secure? read-only
hide_errorsbooleanHide errors from visitors? read-only
+

List all system status items

+

This API helps you to view all the system status items.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/system_status
+
+
+
curl https://example.com/wp-json/wc/v2/system_status \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("system_status")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('system_status')); ?>
+
print(wcapi.get("system_status").json())
+
woocommerce.get("system_status").parsed_response
+
+
+

JSON response example:

+
+
{
+  "environment": {
+    "home_url": "http://example.com",
+    "site_url": "http://example.com",
+    "version": "3.0.0",
+    "log_directory": "/var/www/woocommerce/wp-content/uploads/wc-logs/",
+    "log_directory_writable": true,
+    "wp_version": "4.7.3",
+    "wp_multisite": false,
+    "wp_memory_limit": 134217728,
+    "wp_debug_mode": true,
+    "wp_cron": true,
+    "language": "en_US",
+    "server_info": "Apache/2.4.18 (Ubuntu)",
+    "php_version": "7.1.3-2+deb.sury.org~yakkety+1",
+    "php_post_max_size": 8388608,
+    "php_max_execution_time": 30,
+    "php_max_input_vars": 1000,
+    "curl_version": "7.50.1, OpenSSL/1.0.2g",
+    "suhosin_installed": false,
+    "max_upload_size": 2097152,
+    "mysql_version": "5.7.17",
+    "default_timezone": "UTC",
+    "fsockopen_or_curl_enabled": true,
+    "soapclient_enabled": true,
+    "domdocument_enabled": true,
+    "gzip_enabled": true,
+    "mbstring_enabled": true,
+    "remote_post_successful": true,
+    "remote_post_response": "200",
+    "remote_get_successful": true,
+    "remote_get_response": "200"
+  },
+  "database": {
+    "wc_database_version": "3.0.0",
+    "database_prefix": "wp_",
+    "maxmind_geoip_database": "/var/www/woocommerce/wp-content/uploads/GeoIP.dat",
+    "database_tables": {
+      "woocommerce_sessions": true,
+      "woocommerce_api_keys": true,
+      "woocommerce_attribute_taxonomies": true,
+      "woocommerce_downloadable_product_permissions": true,
+      "woocommerce_order_items": true,
+      "woocommerce_order_itemmeta": true,
+      "woocommerce_tax_rates": true,
+      "woocommerce_tax_rate_locations": true,
+      "woocommerce_shipping_zones": true,
+      "woocommerce_shipping_zone_locations": true,
+      "woocommerce_shipping_zone_methods": true,
+      "woocommerce_payment_tokens": true,
+      "woocommerce_payment_tokenmeta": true
+    }
+  },
+  "active_plugins": [
+    {
+      "plugin": "woocommerce/woocommerce.php",
+      "name": "WooCommerce",
+      "version": "3.0.0-rc.1",
+      "version_latest": "2.6.14",
+      "url": "https://woocommerce.com/",
+      "author_name": "Automattic",
+      "author_url": "https://woocommerce.com",
+      "network_activated": false
+    }
+  ],
+  "theme": {
+    "name": "Twenty Sixteen",
+    "version": "1.3",
+    "version_latest": "1.3",
+    "author_url": "https://wordpress.org/",
+    "is_child_theme": false,
+    "has_woocommerce_support": true,
+    "has_woocommerce_file": false,
+    "has_outdated_templates": false,
+    "overrides": [],
+    "parent_name": "",
+    "parent_version": "",
+    "parent_version_latest": "",
+    "parent_author_url": ""
+  },
+  "settings": {
+    "api_enabled": true,
+    "force_ssl": false,
+    "currency": "USD",
+    "currency_symbol": "&#36;",
+    "currency_position": "left",
+    "thousand_separator": ",",
+    "decimal_separator": ".",
+    "number_of_decimals": 2,
+    "geolocation_enabled": false,
+    "taxonomies": {
+      "external": "external",
+      "grouped": "grouped",
+      "simple": "simple",
+      "variable": "variable"
+    }
+  },
+  "security": {
+    "secure_connection": true,
+    "hide_errors": true
+  },
+  "pages": [
+    {
+      "page_name": "Shop base",
+      "page_id": "4",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "",
+      "shortcode_required": false,
+      "shortcode_present": false
+    },
+    {
+      "page_name": "Cart",
+      "page_id": "5",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "[woocommerce_cart]",
+      "shortcode_required": true,
+      "shortcode_present": true
+    },
+    {
+      "page_name": "Checkout",
+      "page_id": "6",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "[woocommerce_checkout]",
+      "shortcode_required": true,
+      "shortcode_present": true
+    },
+    {
+      "page_name": "My account",
+      "page_id": "7",
+      "page_set": true,
+      "page_exists": true,
+      "page_visible": true,
+      "shortcode": "[woocommerce_my_account]",
+      "shortcode_required": true,
+      "shortcode_present": true
+    }
+  ]
+}
+

System status tools

+

The system status tools API allows you to view and run tools from system status.

+

System status tool properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescription
idstringA unique identifier for the tool. read-only
namestringTool name. read-only
actionstringWhat running the tool will do. read-only
descriptionstringTool description. read-only
successbooleanDid the tool run successfully? read-only write-only
messagestringTool return message. read-only write-only
confirmbooleanConfirm execution of the tool. Default is false. write-only
+

Retrieve a tool from system status

+

This API lets you retrieve and view a specific tool from system status by ID.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/system_status/tools/<id>
+
+
+
curl https://example.com/wp-json/wc/v2/system_status/tools/clear_transients \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("system_status/tools/clear_transients")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('system_status/tools/clear_transients')); ?>
+
print(wcapi.get("system_status/tools/clear_transients").json())
+
woocommerce.get("system_status/tools/clear_transients").parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "clear_transients",
+  "name": "WC transients",
+  "action": "Clear transients",
+  "description": "This tool will clear the product/shop transients cache.",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_transients"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+      }
+    ]
+  }
+}
+

List all tools from system status

+

This API helps you to view all tools from system status.

+

HTTP request

+
+
+ GET +
/wp-json/wc/v2/system_status/tools
+
+
+
curl https://example.com/wp-json/wc/v2/system_status/tools \
+    -u consumer_key:consumer_secret
+
WooCommerce.get("system_status/tools")
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php print_r($woocommerce->get('system_status/tools')); ?>
+
print(wcapi.get("system_status/tools").json())
+
woocommerce.get("system_status/tools").parsed_response
+
+
+

JSON response example:

+
+
[
+  {
+    "id": "clear_transients",
+    "name": "WC transients",
+    "action": "Clear transients",
+    "description": "This tool will clear the product/shop transients cache.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_transients"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "clear_expired_transients",
+    "name": "Expired transients",
+    "action": "Clear expired transients",
+    "description": "This tool will clear ALL expired transients from WordPress.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_expired_transients"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "delete_orphaned_variations",
+    "name": "Orphaned variations",
+    "action": "Delete orphaned variations",
+    "description": "This tool will delete all variations which have no parent.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/delete_orphaned_variations"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "recount_terms",
+    "name": "Term counts",
+    "action": "Recount terms",
+    "description": "This tool will recount product terms - useful when changing your settings in a way which hides products from the catalog.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/recount_terms"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "reset_roles",
+    "name": "Capabilities",
+    "action": "Reset capabilities",
+    "description": "This tool will reset the admin, customer and shop_manager roles to default. Use this if your users cannot access all of the WooCommerce admin pages.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/reset_roles"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "clear_sessions",
+    "name": "Customer sessions",
+    "action": "Clear all sessions",
+    "description": "<strong class=\"red\">Note:</strong> This tool will delete all customer session data from the database, including any current live carts.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_sessions"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "install_pages",
+    "name": "Install WooCommerce pages",
+    "action": "Install pages",
+    "description": "<strong class=\"red\">Note:</strong> This tool will install all the missing WooCommerce pages. Pages already defined and set up will not be replaced.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/install_pages"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "delete_taxes",
+    "name": "Delete all WooCommerce tax rates",
+    "action": "Delete ALL tax rates",
+    "description": "<strong class=\"red\">Note:</strong> This option will delete ALL of your tax rates, use with caution.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/delete_taxes"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  },
+  {
+    "id": "reset_tracking",
+    "name": "Reset usage tracking settings",
+    "action": "Reset usage tracking settings",
+    "description": "This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.",
+    "_links": {
+      "self": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools/reset_tracking"
+        }
+      ],
+      "collection": [
+        {
+          "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+        }
+      ]
+    }
+  }
+]
+

Run a tool from system status

+

This API lets you run a tool from system status.

+

HTTP request

+
+
+ PUT +
/wp-json/wc/v2/system_status/tools/<id>
+
+
+
curl -X PUT https://example.com/wp-json/wc/v2/system_status/tools/clear_transients \
+    -u consumer_key:consumer_secret \
+    -H "Content-Type: application/json" \
+    -d '{
+  "confirm": true
+}'
+
const data = {
+  confirm: true
+};
+
+WooCommerce.put("system_status/tools/clear_transients", data)
+  .then((response) => {
+    console.log(response.data);
+  })
+  .catch((error) => {
+    console.log(error.response.data);
+  });
+
<?php
+$data = [
+    'confirm' => true
+];
+
+print_r($woocommerce->put('system_status/tools/clear_transients', $data));
+?>
+
data = {
+    "confirm": True
+}
+
+print(wcapi.put("system_status/tools/clear_transients", data).json())
+
data = {
+  confirm: true
+}
+
+woocommerce.put("system_status/tools/clear_transients", data).parsed_response
+
+
+

JSON response example:

+
+
{
+  "id": "clear_transients",
+  "name": "WC transients",
+  "action": "Clear transients",
+  "description": "This tool will clear the product/shop transients cache.",
+  "success": true,
+  "message": "Product transients cleared",
+  "_links": {
+    "self": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_transients"
+      }
+    ],
+    "collection": [
+      {
+        "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+      }
+    ]
+  }
+}
+
+
+
+
+ cURL + Node.js + PHP + Python + Ruby +
+
+
+ + + +